Read-only Ops MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
readonly-mcp-worker
A read-only Model Context Protocol (MCP) server that runs on Cloudflare Workers. It pulls operational data together (staff shifts, customer bookings and calendar events) and exposes it to AI agents such as Claude as a set of read-only tools.
It ships with deterministic mock providers, so it runs and passes its tests without any credentials. Clean provider interfaces let you plug in real APIs later, for example a workforce/scheduling tool (Connecteam-style), a ticketing/booking tool (Roller-style) and Microsoft Graph calendars.
About this project. I built this with Claude Code as a portfolio/demo project. All data is mock data about fictional businesses. The real API providers are skeletons that are not wired yet. It has not been deployed or used in production.
Contents
Related MCP server: planday-bridge
Architecture
MCP client (Claude Desktop / Claude Code / any agent)
│ POST /mcp (JSON-RPC 2.0)
▼
┌──────────────────────── Cloudflare Worker ────────────────────────┐
│ src/index.ts routing · CORS · Origin check · bearer auth │
│ src/mcp/protocol.ts initialize · ping · tools/list · tools/call │
│ src/mcp/schema.ts JSON Schema validation of tool arguments │
│ src/tools/ list_locations · list_shifts · list_bookings │
│ list_calendar_events · get_daily_summary │
│ src/lib/summary.ts pure staffing-vs-demand aggregation │
│ src/providers/ ShiftsProvider · BookingsProvider · │
│ CalendarProvider (chosen by env var) │
│ ├─ mock/ deterministic fixtures (default) │
│ └─ real/ Connecteam / Roller / MS Graph skeletons │
└───────────────────────────────────────────────────────────────────┘Transport: MCP Streamable HTTP, stateless.
POST /mcpaccepts a single JSON-RPC message or a batch and answers withapplication/json. Notifications get202 Accepted.GET /mcpreturns405because the server does not open server-initiated SSE streams.Protocol versions:
2025-06-18(latest),2025-03-26,2024-11-05. An unsupportedMCP-Protocol-Versionheader gets400.No SDK dependency. The protocol surface needed here is small, so it is implemented by hand in about 200 lines, with no runtime dependencies. That keeps the Worker bundle tiny and avoids Node compatibility shims.
Errors: protocol problems use JSON-RPC codes (
-32700parse error,-32600invalid request,-32601method not found,-32602invalid params/unknown tool,-32603internal). Bad tool arguments and provider failures come back as a tool result withisError: true, so the model can read the message and correct itself.Providers are lazy: a misconfigured calendar provider only breaks the tools that need the calendar, not
list_shifts.
Staffing rule used by get_daily_summary
For each location and each opening hour (UTC):
staff_on_shift= distinct staff on assigned shifts overlapping the hour (open, unassigned shifts do not count)guests= total guests on confirmed bookings overlapping the hourrequired_staff=max(min_staff, ceil(guests / guests_per_staff))the slot is understaffed when
staff_on_shift < required_staff
Neighbouring understaffed hours are merged into one alert, and open shifts are flagged as well.
Tools
Every tool is annotated readOnlyHint: true, destructiveHint: false, idempotentHint: true.
All inputs are validated against the published JSON Schema (additionalProperties: false).
Dates are YYYY-MM-DD (UTC), ranges are inclusive, and a range can be at most 31 days.
Tool | Arguments | Returns |
| none | Locations with opening hours and staffing rules |
|
| Scheduled and open shifts |
|
| Bookings (confirmed + cancelled) and confirmed guest total |
|
| Operational calendar events |
|
| Hourly staff vs. demand per location, understaffed slots, open shifts, the day's events, alerts |
Mock data
Two fictional sites, loc-downtown (Downtown Arcade) and loc-riverside (Riverside Trampoline
Park), with weekly patterns so any date returns stable data. Useful reference dates:
2026-12-04 (Friday: understaffing at both sites, one cancelled booking),
2026-12-05 (Saturday: a large party and an open shift), 2026-12-07 (Monday: fully staffed).
Example requests
Start the server with npm run dev (default http://localhost:8787).
initialize
curl -s http://localhost:8787/mcp \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":false}},"serverInfo":{"name":"readonly-mcp-worker","title":"Read-only Ops MCP","version":"0.1.0"},"instructions":"Read-only operational data ..."}}tools/list
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'list_shifts
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_shifts","arguments":{"start_date":"2026-12-05","end_date":"2026-12-05","location_id":"loc-downtown"}}}'result.structuredContent (abridged):
{
"range": { "start": "2026-12-05", "end": "2026-12-05" },
"count": 5,
"shifts": [
{ "id": "shf-2026-12-05-4", "location_id": "loc-downtown", "staff_id": "stf-ana", "staff_name": "Ana Silva",
"role": "Host", "start": "2026-12-05T10:00:00Z", "end": "2026-12-05T16:00:00Z", "status": "scheduled" },
{ "id": "shf-2026-12-05-8", "location_id": "loc-downtown", "staff_id": null, "staff_name": null,
"role": "Party Host", "start": "2026-12-05T12:00:00Z", "end": "2026-12-05T18:00:00Z", "status": "open" }
]
}list_bookings
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"list_bookings","arguments":{"start_date":"2026-12-04","end_date":"2026-12-04","location_id":"loc-downtown"}}}'Returns 4 bookings (one cancelled) and "confirmed_guests": 61.
list_calendar_events
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"list_calendar_events","arguments":{"start_date":"2026-12-04","end_date":"2026-12-04"}}}'Returns Ops stand-up and Weekly staffing review.
get_daily_summary
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"get_daily_summary","arguments":{"date":"2026-12-05","location_id":"loc-riverside"}}}'result.structuredContent (slots abridged):
{
"date": "2026-12-05",
"locations": [{
"location_id": "loc-riverside",
"location_name": "Riverside Trampoline Park",
"totals": { "scheduled_shifts": 4, "open_shifts": 0, "staff_hours": 28,
"confirmed_bookings": 1, "cancelled_bookings": 0, "guests": 40 },
"slots": [
{ "start": "2026-12-05T14:00:00Z", "end": "2026-12-05T15:00:00Z", "staff_on_shift": 4,
"guests": 40, "required_staff": 5, "shortfall": 1, "status": "understaffed" },
{ "start": "2026-12-05T15:00:00Z", "end": "2026-12-05T16:00:00Z", "staff_on_shift": 3,
"guests": 40, "required_staff": 5, "shortfall": 2, "status": "understaffed" }
],
"understaffed_slots": 2,
"peak_shortfall": 2
}],
"calendar_events": [],
"alerts": ["Riverside Trampoline Park: understaffed 14:00-16:00 UTC (short by up to 2 staff)"]
}Validation error (tool result, not a protocol error)
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"list_shifts","arguments":{"start_date":"2026-12-07","end_date":"2026-12-01"}}}'{"jsonrpc":"2.0","id":7,"result":{"content":[{"type":"text","text":"Invalid arguments: end_date must be on or after start_date"}],"isError":true}}Each successful tool result carries the data twice: as structuredContent and as pretty-printed
JSON in content[0].text, for clients that only read text.
Run locally
Requirements: Node.js 18+ (tested with Node 22) and npm.
npm install
cp .dev.vars.example .dev.vars # optional: set MCP_AUTH_TOKEN, provider choice
npm run dev # wrangler dev → http://localhost:8787
curl http://localhost:8787/healthwrangler dev runs the Worker locally in the Workers runtime. You do not need a Cloudflare
account for local development. This repo does not include a deploy step. To deploy your own copy
later, run npx wrangler deploy and set secrets with npx wrangler secret put MCP_AUTH_TOKEN.
Test
npm test # vitest
npx tsc --noEmit # type-checkThe tests call the Worker's fetch handler directly with standard Request objects. They cover:
the JSON-RPC protocol (initialize/version negotiation, ping, tools/list, batches, notifications,
every error code, HTTP status codes, CORS, the Origin allow-list), each tool and its argument
validation, the aggregation rules, bearer auth, provider selection and config errors, and the
GET-only HTTP helper.
Authentication
If
MCP_AUTH_TOKENis set, every/mcprequest must sendAuthorization: Bearer <token>. Anything else gets401withWWW-Authenticate: Bearer. Auth is checked before the body is parsed, and the token comparison uses SHA-256 digests compared in constant time.If
MCP_AUTH_TOKENis not set, the server is open. That is fine for local mock data, but do not run it open with real data./healthnever needs a token and returns no business data.Optional
ALLOWED_ORIGINS(comma-separated) rejects browser requests from other origins (403), which guards against DNS rebinding. Requests without anOriginheader (CLIs, server clients) are not affected.
This is a single shared token. It is not OAuth and has no per-user scopes. See Limitations.
Read-only guarantees
Read-only is a design rule, enforced in several places:
Tools: only list/get tools exist, and every tool is annotated
readOnlyHint: true.Provider interfaces (
src/providers/types.ts) only declare read methods. There is no create/update/delete method for a tool to call.HTTP: real providers must use
readOnlyFetch(src/lib/http.ts), which always sendsGETwith no body. A test checks this.Credentials: when you wire a real API, issue the least-privilege, read-only API key or OAuth scope the vendor offers (for Microsoft Graph,
Calendars.Read). This is the guarantee that actually holds if the code changes later.
Plugging in real APIs
Each data source is chosen by an environment variable (default mock):
Variable | Values | Required config when not |
|
|
|
|
|
|
|
|
|
Base URLs must be https://. If you select a real provider without its config, its tools return a
clear error (Provider configuration error: roller provider selected but missing config: ...).
With config in place, the skeletons currently return Provider not available: ... is a skeleton and is not wired yet. No real API mapping is implemented yet.
To wire one up (src/providers/real/index.ts):
Read the vendor's API docs for the list endpoint (shifts/schedules, bookings, or the Graph
calendarViewendpoint) and its auth scheme.Call it with
readOnlyFetch(baseUrl, path, { headers, query }), handling pagination.Map the response to the domain types in
src/providers/types.ts, and normalize every timestamp to UTC ISO 8601.Add tests with recorded (sanitized) responses by injecting
fetchImpl.Put secrets in
.dev.varslocally orwrangler secret putin production. Never commit them.
Microsoft Graph access tokens expire. A production setup needs a token refresh flow (for example
client credentials with Calendars.Read application permission) instead of a static
MSGRAPH_ACCESS_TOKEN.
Connecting from Claude
Claude Code (direct HTTP)
claude mcp add --transport http ops-readonly http://localhost:8787/mcp
# with auth:
claude mcp add --transport http ops-readonly http://localhost:8787/mcp \
--header "Authorization: Bearer $MCP_AUTH_TOKEN"Then ask, for example: "Use ops-readonly to check staffing for 2026-12-05."
Claude Desktop (via mcp-remote)
Claude Desktop's config file launches local (stdio) servers, so use
mcp-remote as a bridge. Edit
claude_desktop_config.json:
{
"mcpServers": {
"ops-readonly": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:8787/mcp",
"--header", "Authorization:${MCP_AUTH_HEADER}"],
"env": { "MCP_AUTH_HEADER": "Bearer change-me" }
}
}
}Leave out --header and env if MCP_AUTH_TOKEN is not set. Restart Claude Desktop after you
edit the file. For a deployed Worker, replace the URL with your https://...workers.dev/mcp
address. mcp-remote needs --allow-http for plain http:// URLs other than localhost.
Any other client
Any MCP client that speaks Streamable HTTP can POST JSON-RPC to /mcp (see the curl examples).
Limitations
Mock data only. The real providers are skeletons, and no vendor API has been called or verified against a real account.
UTC only. Times and opening hours are UTC. Locations have no time zone handling yet, so a "day" is a UTC day.
Simple staffing model: one ratio and one minimum per location, hourly slots, and any overlap counts. It does not model roles, skills, breaks or partial-hour coverage.
Stateless transport: no
Mcp-Session-Id, no server-to-client SSE stream, no resumability, noresourcesorprompts. Tools are the only capability.Auth is a single shared bearer token. There is no OAuth 2.1 authorization server, no per-user identity and no rate limiting. Put it behind Cloudflare Access or add OAuth before exposing real data.
No pagination on tool results. The 31-day range cap keeps responses bounded.
No caching of upstream calls.
License
MIT © 2026 Marcio Prado
Built with Claude Code
See CLAUDE.md for the conventions given to Claude Code and PROMPTS.md for the prompt used to build this project.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Field workforce scheduling for AI agents. GPS punches, forms, timesheets. No dashboard.
Hosted MCP server for Cliniko — patients, appointments, availability, and invoices for AI agents.
Field operations on a deterministic solver — run jobs, crews & fleet from Claude or ChatGPT.
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Related MCP Servers
- AlicenseAqualityCmaintenanceA read-only MCP server that transforms Deputy workforce records into operational workflows, enabling AI assistants to answer questions about coverage gaps, overtime risk, timesheet exceptions, availability conflicts, and staffing summaries.544 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables natural-language interaction with the full Planday API, including all 125 operations, composed timesheet reporting, staff cost summaries, and safe write access controls.MIT
- AlicenseNot gradedqualityCmaintenanceLets MCP clients such as Claude and ChatGPT read a rota and time-and-attendance account, exposing venues, groups, shifts, absences and absence types, time entries, venue events and staff names through read-only tools that never return pay data.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to browse customers, bookings, and availability while any booking creation or cancellation stays gated behind a human-approved, single-use token cryptographically bound to the exact arguments. Runs over stdio or Streamable HTTP and enforces the read/write separation in host code with a full audit trail.7MIT