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.
ops-mcp
A multi-tenant MCP gateway for the ops-platform CRM. A small, safe, fast tool surface for AI agents and staff. One Hono app, stateless, on Cloudflare Workers or Node.
Contents: Overview · How it works · Tool sets and profiles · What you can ask it to do · Safety model · White-label · Quick start · Configuration · Performance · Multi-tenancy · Project layout · Testing · Documentation · Contributing · Licence
Overview
ops-mcp lets an AI assistant or an AI agent work in an ops-platform CRM through the Model Context Protocol (MCP). It is a gateway: it holds no data and no credentials of its own. Every call is made to the CRM with the caller's own token, so the CRM's roles and record scope apply to everything.
It is for two groups:
Staff who talk to Claude, Codex or another MCP client and want "what is due", "how is this client doing" or "draft the invoice" answered in one step.
Agent operators who run AI workers that claim tasks from the CRM's queue, follow written procedures, and report back.
The problem it solves is surface area. A CRM's full API has well over a hundred operations. Handing all of them to a model costs context, invites wrong calls and makes every answer slow. ops-mcp ships a small default set of 14 tools, each doing a whole job in one call (the daily profile), and keeps the rest of the API available behind an explicit profile choice.
Small by default.
dailyis a stable contract of 14 tools. Changing it is a breaking change.Composite tools. One call replaces a chain of CRM calls and returns a lean answer with names, not ids.
No state. Each request builds a fresh MCP server and transport, so any Worker isolate or Node process can answer any request.
Same code on two runtimes. One Hono app serves from a Cloudflare Worker and from Node.
White-label. Each tenant has its own URL, name, instructions, logo and connect page.
Traceable. Every tool result reports how many CRM calls it made and how long it took.
Related MCP server: Exir MCP Server
How it works
flowchart LR
Client["MCP client<br/>(Claude, Codex, an agent)"]
subgraph gw["ops-mcp gateway (Hono)"]
Route["/t/slug/mcp"]
Core["token check, profile,<br/>MCP server per request"]
Route --> Core
end
subgraph crm["Tenant CRM (ops-platform)"]
API["/api/v1 REST + OpenAPI"]
OAuth["OAuth authorization server"]
end
Client -->|"POST JSON-RPC + Bearer token"| Route
Core -->|"openapi.json, /me, tool calls<br/>(caller's token)"| API
Client -.->|"sign in (OAuth, PKCE)"| OAuth
Client -.->|"401 + resource_metadata"| RouteA request to POST /t/<slug>/mcp goes through these steps:
The gateway looks up
<slug>in the tenant registry. An unknown slug answers 404.It reads
Authorization: Bearer <token>. A missing token, or one that does not start withops_, answers 401 with aWWW-Authenticateheader that carriesresource_metadata. The client follows it to the CRM's OAuth server and signs the person in.It checks the token against the CRM (
GET /api/v1/me), cached per token (30 s fresh, then stale-while-revalidate). A 401 from the CRM answers 401 witherror="invalid_token".It builds a new MCP server for the connection's profile (
?profile=, defaultdaily) and answers the JSON-RPC request.tools/listreturns the profile's tools.tools/callruns only a tool that is in that profile, calls the CRM with the caller's token, and returns the result with_meta.crmCallsand_meta.ms.
The full walk-through, with caching and module map, is in docs/ARCHITECTURE.md.
Tool sets and profiles
A profile is chosen per connection with a query string, for example https://mcp.example.com/t/acme/mcp?profile=agent. Without one, the connection gets daily. An unknown profile answers 400 and lists the valid names.
Profile | Contents | Composite tools | Use it for |
| Exactly the 14 composite tools listed below; a stable contract | 14 | Everyday staff use and agent work loops |
| Nine composite tools plus a filtered set of generated list, get and update tools | 9 | People who need record lookups too |
| The work-queue tools, | 13 | AI workers that claim and finish tasks |
| Team, agency, calling and billing composites, plus filtered generated tools (members, attendance, invitations, projects, tasks, leads and deals lists) | 25 | Owners and managers |
| Every composite tool plus every generated tool | 34 | Power use and automation. |
The composite counts come from running the code (npm run docs:tools lists each tool with its profiles). The number of generated tools in staff, agent, admin and full depends on the CRM's OpenAPI document at runtime, so it is not fixed here.
The 14 daily tools: my_day, client_status, agent_queue_peek, agent_claim_task, agent_heartbeat, agent_progress, agent_complete_task, agent_release_task, review_handoff, whats_due, create_task, record_context, setup_overview, what_can_i_do.
Every composite tool, with inputs and profile membership, is in docs/TOOLS.md.
What you can ask it to do
The composite tools, grouped by area. Each example is something a person or an agent might say.
Area | Tools | Example request |
Daily work |
| "What is on my plate today?" or "What can I do here?" |
Agent work queue |
| "Take the next urgent task, follow its guide, and mark it done with a summary." |
Team and clients |
| "Which tasks are overdue, and who is free to take the unassigned ones?" |
Money |
| "Draft an invoice for this client with two line items, then show me the email before it goes out." |
Calling prep |
| "Who should I phone today?" |
Routines |
| "Every week, ask for newsletter content on Monday and send it on Wednesday." |
Bulk |
| "Create these 40 tasks and give them to Sam." |
A tool cannot place a phone call. The CRM connects each call to a person's browser session, so the calling tools prepare calls (who to phone, what happened) and request_call creates a callback task for a person.
Safety model
A profile is not a permission boundary. It chooses what a connection sees in
tools/listand may call. The gateway rejects a call to a tool outside the profile. The CRM, not the gateway, decides what the signed-in person may do, whatever profile they pick.Confirmed actions. Every generated tool that maps to a
DELETE, plusemail_sendandsms_send, takes a requiredconfirmedinput and refuses to run unless it istrue. The schema tells the model to set it only after the user approved that exact action.Blocked tools. The gateway never generates tools for file upload and download, demo status and purge, voice number purchase, update and release, voice settings, voice sessions or voice calls. The list is
BLOCKEDinsrc/tools.mjs.Invoice sending previews first.
invoice_sendwithoutconfirmed: truereturns the recipient, subject, body and total and sends nothing. With it, the email goes out first and the status changes second. If the status step fails, the result says so and tells the caller not to email again.Retries. Reads retry once, after 150 ms, on a network error or a 5xx, for composite and generated tools alike. Writes are never retried, because a failed write may have been applied.
Bulk create is repeat-safe when the CRM allows it.
tasks_bulk_createreturns abatchKeyand sends<batchKey>:<index>as each task'srequestKey, but only when the CRM'stasks_createaccepts a request key. The result saysretrySafe: trueorfalse. When it is false, re-send only the failed items.tasks_bulk_completeis safe to retry: a task already completed reportsalreadyDone.Credentials. Nothing is written to disk. Tokens are forwarded to the CRM and held in memory only as cache keys.
The details and the exact failure messages are in SECURITY.md and docs/ARCHITECTURE.md.
White-label
Each tenant in the registry can carry:
Field | Effect |
| The tenant's CRM origin; the gateway's upstream and the OAuth authorization server |
| Shown to the model as the server title, on the connect page, and as |
| Replaces the default instructions the model receives on connect |
| Shown on the connect page; ignored unless it starts with |
| Link colour on the connect page; ignored unless it is a |
| Published as |
GET /t/<slug> serves a connect page for that tenant: the connector address, the Claude Code command (claude mcp add --transport http crm <url>) and notes for other clients.
Quick start
Prerequisites: Node.js 22. The Worker path also needs a Cloudflare account and npx wrangler login.
npm installNode. Point the gateway at a CRM and start it:
TENANTS='{"acme":"https://crm.example.com"}' PUBLIC_URL=http://localhost:8080 npm start
# connector address: http://localhost:8080/t/acme/mcpCloudflare Workers. Copy the example config, edit the tenant, and deploy:
cp wrangler.example.jsonc wrangler.jsonc # git-ignored
npx wrangler dev # local Workers runtime
npm run deploy # wrangler deployConnect a client.
claude mcp add --transport http crm https://mcp.example.com/t/acme/mcpThen run /mcp in Claude Code and choose Authenticate. Other clients: add a custom connector (Streamable HTTP) with the same address and no headers. As an alternative to OAuth, send Authorization: Bearer <API token> with a CRM-issued token that starts with ops_. The full procedure and a verification checklist are in docs/DEPLOYMENT.md.
Configuration
Variable | Where | Meaning | Default |
| Worker var, Node env | JSON object: slug to a CRM origin string, or to an object with | none |
| both | Adds one tenant with slug | none |
| both | Public origin of the gateway, used in metadata and the 401 challenge. Without it the origin of the incoming request is used | request origin |
| both | Set to | logging on |
| Node | Listening port |
|
| Worker service binding | Reaches that tenant's CRM Worker without the public edge. Slug upper-cased, dashes to underscores | public fetch |
At least one tenant must be configured through TENANTS or OPS_API_URL, or the gateway refuses to start.
Performance
In one reference deployment and region, a Worker with a service binding answered /health at p50 88 ms against 249 ms from a container host, and a read-only sweep of 39 tools had a median of medians of 135 ms, with 31 of 39 under 200 ms. Numbers vary by deployment and region. The gains came from the platform and from fewer CRM calls per tool (whats_due went from 5 CRM calls to 1), not from the web framework. Methodology, tables and how to re-run are in docs/BENCHMARKS.md.
Multi-tenancy
The registry maps a slug to a CRM origin and its branding. The slug appears in the URL (/t/<slug>/mcp) and must match [a-z0-9-]+. On a Worker, a tenant's CRM can be reached through a service binding named CRM_<SLUG> (slug upper-cased, dashes to underscores), which skips DNS, TLS and the public edge. Without a binding the gateway uses a public fetch. The tool-list cache is keyed by tenant origin; the token check and member list caches are keyed by origin and token.
To add a tenant, add it to TENANTS and, on Workers, add a CRM_<SLUG> binding to wrangler.jsonc. See docs/DEPLOYMENT.md.
Project layout
src/
worker.mjs Cloudflare Worker entry: service bindings, app cache
server.mjs Node entry (@hono/node-server)
app.mjs Hono routes: health, OAuth metadata, connect page, MCP endpoint
core.mjs profiles, MCP server per request, token and tool caches, tracing
tools.mjs OpenAPI document to MCP tools, confirmation gating, blocked list
tenants.mjs tenant registry parser, default instructions
connect-page.mjs per-tenant connect page
crm.mjs shared CRM client: retry, member list cache, paging, lookups
agent.mjs admin.mjs agency.mjs dialer.mjs billing.mjs staff.mjs
composite tools by area
scripts/ gen-tools-doc.mjs (writes docs/TOOLS.md), local-setup.mjs
test/ unit tests and the benchmark and flow harnesses
docs/ architecture, tools, deployment, benchmarksTesting
npm testruns node --test test/unit. The other files in test/ are harnesses that run against a live gateway and CRM; their headers explain usage:
File | What it does |
| calls every read-only tool and reports latency and CRM calls per tool |
| before and after comparison of two checkouts, counting CRM requests per tool call |
| times the CRM's web pages |
| compares two gateway deployments (p50, p95) without a real token |
| latency of chosen tools and of the agent write loop |
| races two agents over the queue and checks each task is claimed once |
| the full OAuth connect, refresh and revoke flow through the gateway |
Documentation
Read | For |
request lifecycle, modules, caching, statelessness, trade-offs | |
every composite tool: inputs, read-only flag, profiles (generated) | |
Workers and Node deployment, adding a tenant, connecting clients, verification, rollback | |
measured latency, CRM call counts, how to re-run | |
setup, conventions, adding a composite tool | |
reporting a vulnerability and the security model |
Contributing
Contributions are welcome. CONTRIBUTING.md covers setup, npm test, conventions and how to add a composite tool. Report security issues privately as described in SECURITY.md.
Licence
MIT, copyright 2026 Abdullah Saeed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
An MCP gateway for teams deploying AI tools at scale to employee-facing and headless agents.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP Gateway: wrap any MCP server with cold-start retries, uptime SLA, and per-execution MPP billing.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA secure MCP gateway for enterprise AI tool execution, enabling governed invocation of business tools with authentication, RBAC, audit logging, PII redaction, and async processing.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA multi-tenant MCP gateway that connects AI agents to the Exir CRM API, enabling secure, permissioned access to customers, leads, tasks, invoices, and more through natural language.-
- AlicenseNot gradedqualityDmaintenanceProvides a unified MCP gateway enabling AI agents to securely access multiple tool servers (knowledge base, database, repo, etc.) with dynamic tool selection and OAuth2/RBAC security.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI clients to search and view CRM customers, deals, contracts, tasks, calendars, and outbound jobs, and to propose opt-in write actions that require human approval in the CRM.Apache 2.0