HR System MCP Server

An unofficial prototype MCP server providing HR system functionality with Okta token validation. For evaluation and testing purposes only.

๐Ÿ“š Documentation

Complete documentation available in the docs/ folder:

  • docs/RAILWAY_README.md - Deploy to Railway.com (3 steps) ๐Ÿš€
  • docs/DOCKER_QUICK_START.md - Run locally with Docker ๐Ÿณ
  • docs/README_INTEGRATION.md - Use the deployed server ๐Ÿ”Œ
  • docs/CLAUDE.md - Developer guide & architecture ๐Ÿ’ป
  • docs/INDEX.md - Complete documentation index ๐Ÿ“–

Overview

The HR System MCP Server provides:

  • โœ… Employee information lookup
  • โœ… Employee directory listing
  • โœ… Payroll information access
  • โœ… Time-off request management
  • โœ… Okta OAuth 2.0 token validation for all tool calls
  • โœ… HTTP/NDJSON streaming support (FastMCP)
  • โœ… Ready for Railway deployment ๐Ÿš€

Authentication

This server validates Okta access tokens for all tool calls (except initialize):

  • Token Source: Okta authorization server
  • Validation: JWT signature, expiration, audience claims
  • Authorization Header: Authorization: Bearer <access_token>

Quick Start

# Setup
cp env.example .env
# Edit .env with your Okta credentials

# Install dependencies
pip install -r requirements.txt

# Run in HTTP mode (for Okta MCP Adapter)
python main.py --http 8001

Configuration

.env (Environment Variables)

OKTA_DOMAIN=ijtestcustom.oktapreview.com
OKTA_AUTHORIZATION_SERVER_ID=auss2fth0mcIXHzVO1d7
OKTA_AUDIENCE=
OKTA_REQUIRED_SCOPES=
# When true (default), tools/list without auth returns 401. When false, allows unauthenticated tools/list (e.g. for gateway registration).
# PROTECTED_DISCOVERY=true

Available Tools

Tool Description Parameters
get_employee Get employee by ID employee_id: str
list_employees List all employees None
get_employee_payroll Get payroll info employee_id: str
get_time_off_requests Get time-off requests employee_id: str (optional)

Usage Examples

Direct via VS Code/Copilot

# Endpoint
http://localhost:8001/mcp

# Authorization
Authorization: Bearer <okta_access_token>

Via Okta MCP Adapter Gateway

# Gateway will:
# 1. Receive request from client
# 2. Validate Okta token
# 3. Forward to HR System MCP
# 4. Attach authorization header

Implementation Details

  • Framework: FastMCP 3.0.0b1
  • Server: Uvicorn (async HTTP)
  • Protocol: MCP (Model Context Protocol) with NDJSON streaming
  • Token Validation: JWKS-based JWT validation with signature verification
  • Caching: JWKS keys cached with TTL

Request Flow

Client Request
    โ†“
Authorization Header (Okta token)
    โ†“
Initialize (no token needed)
    โ†“
tools/list (validate token)
    โ†“
tools/call (validate token)
    โ†“
Response

๐Ÿš€ Deployment Options

Vercel (Serverless) โšก

Deploy as serverless function - automatic scaling, pay-per-use

  • โœ… Best for: Sporadic usage, automatic scale-to-zero
  • โœ… Free tier: 100GB bandwidth/month
  • โš ๏ธ Constraint: 10-second timeout (free), 5-min (Pro)
  • ๐Ÿ“– Guide: docs/VERCEL_README.md

Railway.com (Traditional Server) ๐Ÿš‚

Deploy as long-running server - always-on, unlimited timeout

  • โœ… Best for: Constant traffic, persistent connections
  • โœ… Free tier: 500 hours/month ($5/month after)
  • โœ… No timeout: Unlimited request duration
  • ๐Ÿ“– Guide: docs/RAILWAY_README.md

Docker (Local Development) ๐Ÿณ

Run locally with Docker - full control, testing

  • ๐Ÿ“– Guide: docs/DOCKER_QUICK_START.md
docker-compose up -d

Recommendation:

  • Use Vercel for sporadic/unpredictable usage (cheaper, auto-scales)
  • Use Railway for constant traffic or if you need long timeouts

Troubleshooting

See docs/RAILWAY_DEPLOYMENT.md for complete troubleshooting guide.

Quick fixes:

  • Token validation fails: Verify OKTA_DOMAIN and OKTA_AUTHORIZATION_SERVER_ID in .env
  • Port already in use: Change port in startup command: python main.py --http 8002
  • Missing environment variables: Copy .env example and fill in values
  • JWKS fetch error: Verify Okta domain and authorization server ID are correct

Project Structure

hr-mcp-server/
โ”œโ”€โ”€ main.py                    # FastMCP server with HTTP handler
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ Dockerfile                 # Docker container definition
โ”œโ”€โ”€ docker-compose.yml         # Docker Compose configuration
โ”œโ”€โ”€ railway.json               # Railway deployment config
โ”œโ”€โ”€ deploy-railway.sh          # Deployment helper script
โ”œโ”€โ”€ test_server.sh            # Server test script
โ”œโ”€โ”€ auth/                      # Authentication module
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ okta_validator.py     # Okta token validation
โ””โ”€โ”€ docs/                      # Documentation
    โ”œโ”€โ”€ INDEX.md              # Documentation index
    โ”œโ”€โ”€ RAILWAY_README.md     # Railway quick start
    โ”œโ”€โ”€ RAILWAY_DEPLOYMENT.md # Complete deployment guide
    โ”œโ”€โ”€ DOCKER_QUICK_START.md # Docker reference
    โ”œโ”€โ”€ README_INTEGRATION.md # Usage guide
    โ”œโ”€โ”€ CLAUDE_CODE_SETUP.md  # Claude Code setup
    โ”œโ”€โ”€ CLAUDE.md             # Developer documentation
    โ””โ”€โ”€ ...more docs

See docs/INDEX.md for complete documentation guide.

Testing

# Using curl with Okta token
curl -X POST http://localhost:8001/mcp \
  -H "Authorization: Bearer <your_okta_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
  }'

๐Ÿ“– Documentation

For complete documentation, see the docs/ folder:

  • Getting Started - Documentation index
  • Deploy to Railway - Cloud deployment guide
  • Run with Docker - Local development
  • Integration Guide - How to use the server
  • Developer Guide - Architecture & development

References

Status

โš ๏ธ Unofficial Prototype - For evaluation and testing only. Not for production use.

License: Apache 2.0

MCP Server ยท Populars

MCP Server ยท New