Skip to main content
Glama
clinic-hr-mcp

clinic-hr-mcp

by iemaly

clinic-hr-mcp

A small Model Context Protocol server that lets an AI agent work with clinic HR data, but only the parts it has been granted.

It is a public, demo-data version of a pattern I use at work. Every person and record in it is fictional.

The idea

Giving an AI agent access to HR data is easy. Making sure it sees only what it should is the actual work. This server enforces two rules:

  1. Scopes decide which tools exist. A tool is registered only when its scope is granted, so a read-only agent never even sees request_leave. It has nothing to try.

  2. Locations decide which records exist. An agent scoped to one clinic gets staff, shifts and balances from that clinic only. A record from another clinic returns the same "not found" as an id that doesn't exist, so nothing leaks.

Writes are drafts. request_leave checks the balance and returns a request that a manager still has to approve. The agent never makes the final decision.

Related MCP server: leave-manager-mcp-server

Tools

Tool

Scope

What it does

list_staff

staff:read

Staff at the visible clinics, optional role filter

get_leave_balance

staff:read

Remaining leave days for one person

list_shifts

planning:read

Shifts on a date at the visible clinics

request_leave

leave:write

Draft leave request, checked against the balance

Run it

npm install
npm run build
MCP_SCOPES=staff:read,planning:read MCP_LOCATIONS=amsterdam npm start
  • MCP_SCOPES: comma-separated, from staff:read, planning:read, leave:write. Defaults to staff:read.

  • MCP_LOCATIONS: comma-separated, from amsterdam, zaandam, venlo, dubai. Empty means no clinic is visible. Access is opt-in.

An unknown scope or location stops the server at startup instead of being ignored.

Use it from an MCP client

{
  "mcpServers": {
    "clinic-hr": {
      "command": "node",
      "args": ["/path/to/clinic-hr-mcp/dist/index.js"],
      "env": { "MCP_SCOPES": "staff:read,planning:read", "MCP_LOCATIONS": "amsterdam" }
    }
  }
}

In production

Here the access context comes from environment variables so the demo runs anywhere. In a real deployment it comes from an OAuth 2.0 access token, issued through the authorization code flow with PKCE, and validated on every request. The tool code does not change: createServer(ctx) takes the same AccessContext either way.

Tests

npm test

The tests connect a real MCP client to the server in memory and check that tools appear and disappear with scopes, that records from other clinics stay hidden, and that leave requests respect the balance.

Stack

TypeScript · @modelcontextprotocol/sdk · Zod · Vitest

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Your Nailted HRIS in your AI agent: time off, time tracking, reviews and hiring, as yourself.

      https://hris.nailted.com/api/mcp
    • Read shifts, people, leave and timesheets; add people and approve leave in Shiftbrook.

    • Run your TalentoHQ company from an AI agent: people, time, absences, hiring, and more.

      https://mcp.talentohq.com/mcp
    • SmartShifts is employee scheduling and workforce management (WFM) software for multi-location businesses such as restaurants, with an MCP server that works with ChatGPT, Claude, Cursor and VS Code. Its MCP server gives Claude, ChatGPT and other MCP clients scheduling, time-off and task tools for the shifts, locations, positions, team members, availability, time off and tasks the user's role can see. Tools: list_team_shifts (team shifts), find_staffing_gaps (coverage gaps), list_team_availability (availability), request_time_off and approve_time_off (time-off requests and approvals), complete_task (mark a task complete), get_workforce_overview (workforce priorities, team tasks and time off) and get_my_workday (your own workday). Connect in ChatGPT (web): Plugins (chatgpt.com/plugins) → + → Add custom MCP server → Server URL https://app.smartshifts.com/api/mcp → Authentication: OAuth → create the plugin, install it and sign in. Connect in Claude: Settings → Connectors → Add custom connector → paste https://app.smartshifts.com/api/mcp → Connect and sign in. Cursor, VS Code and other clients: add https://app.smartshifts.com/api/mcp as a remote HTTP MCP server. How to connect: open the SmartShifts MCP setup guide (https://app.smartshifts.com/mcp) for your client, add SmartShifts as a custom MCP connection, sign in with OAuth and choose read only or read + write. Every action runs with the user's own role, location and module permissions, changes wait for approval by default, and sensitive personal and financial fields are left out. Setup guide: https://smartshifts.com/ai-assistants-mcp/ Support: kcatolico@smartshifts.com

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query staff shifts, customer bookings, and operational calendar events for multiple locations, and to retrieve hourly staffing-versus-demand summaries with understaffing alerts and flagged open shifts. All access is strictly read-only, validated against JSON schemas, and served over stateless MCP Streamable HTTP on Cloudflare Workers.
      MIT