ops-mcp
An MCP server that enables non-technical operations users to resolve common commerce-ops tickets, such as orders charged but failed, through an investigate, recommend, approve, and execute workflow with read-only and write tools.
README
ops-mcp
A remotely-hosted MCP server that lets a non-technical operations user resolve a specific, common commerce-ops ticket end-to-end through an AI agent, instead of escalating to an engineer.
The workflow this covers
"Customer says they were charged but the order shows as failed."
Root cause: payment was captured, but the inventory hold expired before the order could be confirmed. The agent:
- Investigates via read-only tools (order, payment, inventory hold, stock).
- Diagnoses the mismatch and checks current stock.
- Recommends one of two resolutions:
- Stock available -> reconfirm the order (re-reserve stock, move to confirmed).
- Stock unavailable -> issue a refund.
- Waits for the operator to explicitly approve.
- Executes the approved action via a write tool.
- Verifies the outcome (checks shipment status after a reconfirm) before reporting success back to the operator.
Out of scope (deliberate): fulfillment/tracking mismatches, returns, fraud review, catalog/pricing issues, multi-item orders, and full inventory reconciliation across warehouses. These are structurally similar problems we'd extend to next using the same investigate -> recommend -> approve -> execute pattern.
Data
Hosted PostgreSQL, seeded once via npm run seed. Set the DATABASE_URL
environment variable (see .env.example) to point at your Postgres instance
(e.g. Supabase, Neon, or a local Docker container). The schema is defined in
src/db/schema.sql; seed data lives in src/db/seed.ts and uses
INSERT ... ON CONFLICT DO NOTHING for idempotent re-seeding. 10 orders
are seeded, covering: normal happy-path orders, the two core scenario
orders (A1023 = reconfirm path, A1024 = refund path), and three deliberate
edge cases (an already-refunded order, a cancelled order, and a "decoy"
order that looks similar but isn't actually broken).
Supabase pooler: If your DB host only has IPv6 DNS (Supabase's direct
db.[ref].supabase.coendpoint), use the Supabase Connection Pooler endpoint instead — it resolves to IPv4 and works from any hosting environment. Get it from the Supabase dashboard under Database → Connection Pooling. Format:postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres
MCP tools
Read (freely callable, no side effects):
get_order_detailsget_payment_statusget_inventory_hold_statuscheck_stock_availabilityget_shipment_status
Write (require an explicit confirmed_by_operator: true flag, only to be
set once a human has approved the specific action):
reconfirm_orderissue_refund
Full tool descriptions (including preconditions and safety notes fed to
the calling model) are in src/tools/definitions.ts.
Running locally
Set up your environment first:
cp .env.example .env
# Edit .env to add your DATABASE_URL pointing at a PostgreSQL instance
# Load it: `export $(cat .env | xargs)` or use a .env loader
npm run seed # one-time: creates tables and inserts seed data
Default (no flags): seed data is inserted with ON CONFLICT DO NOTHING —
safe to re-run on a live database; it will not overwrite or undo mutations
an agent may have made (e.g. an order reconfirmed from failed to confirmed
stays confirmed).
To reset demo state (truncate all tables and re-seed from scratch):
npm run seed -- --reset
Then:
npm install
npm run dev # starts the MCP server on :3000 with tsx (no build step)
Health check: GET http://localhost:3000/health
MCP endpoint: POST http://localhost:3000/mcp
Running the tests
Tests use pg-mem (in-memory PostgreSQL), so no external database is needed:
npm test
This runs src/tests/tools.test.ts, which calls the tool handlers directly
(bypassing HTTP/MCP transport) against an in-memory Postgres DB (via
pg-mem) and checks both resolution paths plus all safety-rejection cases.
Building for deployment
npm run build
npm start # runs dist/server.js, respects $PORT
Remember to set DATABASE_URL in your deployment environment.
Platform notes:
- Render / Railway / Fly / Heroku — Ideal. These run a persistent process;
just set
DATABASE_URL(to the Supabase pooler connection string) and deploy. These are recommended. - Vercel — Not recommended. Vercel uses serverless functions with cold starts and timeouts (10–15s). MCP over Streamable HTTP works but will be unreliable for longer-running operations. Use Render or Railway instead.
Connecting an MCP client
Point any MCP-over-HTTP client (Streamable HTTP transport, stateless mode)
at POST /mcp on the deployed URL.
OpenCode
OpenCode discovers MCP servers from the mcpServers field in your
~/.opencode.json or a .opencode.json in your project root.
{
"mcpServers": {
"ops-mcp": {
"url": "http://<host>:<port>/mcp"
}
}
}
In a conversation, invoke the agent directly on an order:
/opencode ops-mcp help me with order A1023 — customer says they were charged but the order failed
OpenCode will start a session with the MCP tools registered. No extra configuration needed beyond the JSON snippet above.
Claude Code
Claude Code reads MCP server config from the Claude Desktop config file
(claude_desktop_config.json on macOS/Windows, ~/.config/Claude/claude_desktop_config.json
on Linux) or from a local .mcp.json in the project root (Claude Code 1.95+).
Local .mcp.json (recommended for per-project scoping):
{
"mcpServers": {
"ops-mcp": {
"command": "node",
"args": ["dist/server.js"],
"env": {
"DATABASE_URL": "postgresql://..."
},
"transport": "stdio"
}
}
}
If the server is running remotely (Streamable HTTP), use the URL form:
{
"mcpServers": {
"ops-mcp": {
"url": "http://<host>:<port>/mcp",
"transport": "httpStream"
}
}
}
Then in Claude Code, run:
/opencode ops-mcp investigate order A1023
or simply mention the tools in a normal prompt — Claude Code will discover and call them automatically.
Codex
Codex reads MCP config from ~/.codex/mcp.json or .codex/mcp.json in
the project root.
{
"mcpServers": {
"ops-mcp": {
"command": "node",
"args": ["/abs/path/to/ops-mcp/dist/server.js"],
"env": {
"DATABASE_URL": "postgresql://..."
},
"transport": "stdio"
}
}
}
If the server is already running over HTTP:
{
"mcpServers": {
"ops-mcp": {
"url": "http://<host>:<port>/mcp"
}
}
}
Then in a Codex task prompt:
Use the ops-mcp server to investigate order A1023: a customer says they were
charged but the order shows as failed. Check order details, payment status,
inventory hold, and stock. Recommend a resolution and wait for approval.
Codex will auto-discover the registered MCP tools and use them.
License
MIT License with a commercial attribution clause — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。