MCP Policy Gateway
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Policy Gateway Draft a customer email to Riverlane Coffee about the spring menu"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Policy Gateway
An MCP server that wraps everyday commercial tools with guardrails: allowlists, simulate-before-act, approval gates, a cost limit, and an audit trail.
A sales or operations assistant can draft a customer email, propose a spend, or update an account record. It cannot send or execute a material spend until policy passes and, above a set amount, a human approves.
This repo is a companion to governed-agent-demo. That project is the control plane; this one shows how a commercial agent uses the same idea through MCP. All accounts and names are fictional. No API keys are required.
Scenario
Draft a customer email to Riverlane Coffee — allowed, counted toward a daily send cap
Draft to a blocked domain — refused
Propose an A$200 spend — simulated, auto-approved, executed only when you confirm
Propose an A$800 campaign spend — simulated, held for approval, refused if you try to execute early
Related MCP server: Squidbrake
Tools
Tool | What it does |
| Drafts mail to a known fictional account. Enforces blocked domains and a daily cap of 5. |
| Simulates a spend. Auto-approves below A$500. Holds larger amounts. Execute is a separate step. |
| Updates an allowlisted field ( |
| Returns every tool call, including blocked and waiting actions. |
Policy lives in policy/example.json.
Quick start
npm install
npm test
npm run demoThe demo walks through a blocked email, an auto-approved spend and a spend that needs approval.
Connect an MCP client
npm run mcpExample Cursor / Claude Desktop snippet:
{
"mcpServers": {
"mcp-policy-gateway": {
"command": "npx",
"args": ["tsx", "src/server.ts"],
"cwd": "/path/to/mcp-policy-gateway"
}
}
}The server speaks JSON-RPC 2.0, one message per line, on stdin/stdout. A spend that needs a human, then execution:
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"propose_spend","arguments":{"action":"propose","accountId":"acct-northshore","amount":800,"memo":"Spring catalogue campaign"}}}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"propose_spend","arguments":{"action":"decide","proposalId":"spend-........","approve":true,"execute":true}}}Design notes
Simulate-before-act matters in a regulated business because a model can propose a spend that looks locally reasonable and still breach a daily cap, a counterpart deny list, or an approval threshold. The simulation is visible in the tool result and in the audit log, and it does not move funds.
The audit log is the record you would hand to a risk, finance or customer-operations reviewer: what was proposed, what was blocked, who approved, and what actually executed.
This is not a production CRM, payments or email integration.
License
MIT. See LICENSE.
Available Tools
4 toolsdraft_customer_emailB
Draft a customer email to a known fictional account. Blocked domains and the daily send cap are enforced. This does not contact a real person.
Inputs: body (required), subject (required), accountId (required).
get_audit_logB
Return the audit trail of every tool call, including blocked and waiting actions.
Inputs: no named parameters.
propose_spendB
Propose a spend against a fictional account. The gateway simulates first, auto-approves below A$500, and holds larger amounts for approval. Use action=propose, decide, or execute.
Inputs: memo, action, amount, approve, +2 more.
update_account_recordB
Update an allowed field on a fictional account record (status, owner, segment, notes).
Inputs: field (required), value (required), accountId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct resource: email drafting, spend proposal, account record update, and audit retrieval, so misselection risk is low. The only wrinkle is propose_spend folding propose/decide/execute into one action parameter, which blends several operations into a single tool and can make the approval flow less obvious.
All four names follow a clean verb_noun snake_case pattern (draft_customer_email, propose_spend, update_account_record, get_audit_log). The convention is predictable and readable throughout.
Four tools map neatly onto the gateway's governed actions plus an audit trail, so each earns its place. The surface is slightly thin, but nothing feels redundant or bolted on.
Governed write actions and observability via get_audit_log are covered, but there is no read/list tool for account records or accounts, so update_account_record has no corresponding read path. There is also no way to inspect policy rules or pending approvals except indirectly through the audit log.
Maintenance
Related MCP Connectors
Permission checks, human approval cards, and signed audit trails for AI agent tool calls.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Pre-spend firewall for AI agents. Approves, blocks, flags transactions against policy rules.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible AI agents to safely act on business backends by enforcing per-agent permissions, autonomy thresholds, human approval with review-and-edit, and full audit trails.MIT
- AlicenseBqualityBmaintenanceEnables AI agents and MCP clients to route every tool call through configurable rules that allow, block, or hold risky actions for human approval, while recording decisions in a tamper-evident audit trail.12636 PyPI19Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables agents to invoke declared API capabilities through a governed MCP surface where each call is risk-tiered — low-risk calls execute immediately, medium-risk writes queue for human approval, and high-risk actions are withheld from the tool list entirely. Every call, decision and denial is recorded in an audit trail, and responses carrying third-party text are scanned for prompt-injection signals before an agent can read them.2MIT
- AlicenseNot gradedqualityBmaintenanceProvides governed tools for evaluating proposed agent actions against policy, classifying risk, and creating structured governance and audit records, while pausing consequential steps for explicit human approval. This lets agentic workflows run under traceable, least-privilege control rather than unrestricted automation.MIT