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 GatewayApprove the pending billing refund request"
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
A zero-trust policy enforcement gateway that sits between AI agents/MCP clients and real MCP servers.
MCP Client / AI Agent
↓
Identity + Rate Limit + Policy + Approval + Egress Guard
↓
MCP Policy Gateway
↓
Schema Pin + Circuit Breaker + Audit
↓
one or many MCP upstream serversWhy it exists
MCP makes tool access easy; production systems also need to answer who may call a tool, with which arguments, how often, to which destinations, and when a human must approve the action. MCP Policy Gateway keeps those controls outside the agent prompt and applies them before the upstream tool executes.
Tools are namespaced at the gateway boundary to prevent collisions:
local__filesystem_read
crm__customer_lookup
billing__refund_paymentRelated MCP server: MCP-Gatekeeper
v0.3 — zero-trust controls
real MCP stdio and Streamable HTTP gateway from v0.2
per-agent identity (
agent_id, tenant, roles)identity/role-aware policy rules
argument-level
argument_equalspolicy conditionsshort-lived HMAC approval tokens bound to agent + tool + exact arguments
approval resume without weakening the original rule
per-agent/per-tool sliding-window rate limits
outbound URL/domain allowlists
prompt-injection signal detection before high-risk tool execution
secret/email redaction helpers for logs and operator surfaces
upstream circuit breakers and request timeouts
schema pinning and drift enforcement
structured JSONL audit
tests and CI
Policy example
{
"default": "deny",
"rules": [
{
"id": "finance-refund-usd",
"tool": "billing__refund*",
"effect": "approval",
"risk": "high",
"roles_any": ["finance"],
"argument_equals": {"currency": "USD"}
},
{
"id": "block-delete",
"tool": "billing__delete*",
"effect": "deny",
"risk": "critical"
}
]
}Signed approval flow
identity = AgentIdentity("agent-42", tenant="acme", roles=("finance",))
args = {"invoice_id": "INV-7", "amount": 50, "currency": "USD"}
first = await service.call_tool("billing__refund", args, identity=identity)
# -> approval_required
token = signer.issue(tool="billing__refund", arguments=args, identity=identity)
result = await service.call_tool(
"billing__refund",
args,
identity=identity,
approval_token=token,
)Changing the amount, tool, agent or tenant invalidates the token.
Install
pip install -e .The gateway targets the stable MCP Python SDK v2 line (mcp>=2.1,<3).
Run over stdio
mcp-policy-gateway --config examples/gateway.json --transport stdioRun over Streamable HTTP
mcp-policy-gateway \
--config examples/gateway.json \
--transport streamable-http \
--host 127.0.0.1 \
--port 8000Clients connect to http://127.0.0.1:8000/mcp.
Security boundary
v0.3 provides a practical policy layer, not a claim of complete isolation. Persistent identity extraction from every client transport, external approval APIs, signed schema registries, policy hot reload, OpenTelemetry, deployment hardening and a formal threat model remain roadmap items.
See ROADMAP.md.
License
MIT.
Maintenance
Related MCP Connectors
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGoverns AI agent HTTP requests with policy enforcement, security scanning, and audit logging via MCP.MIT
- FlicenseNot gradedqualityDmaintenanceRuntime security gateway and FastMCP server that protects MCP clients from tool poisoning, prompt injection, and unauthorized tool schema changes through policy enforcement, fail-closed scanning, and human approval gates.-
- AlicenseNot gradedqualityCmaintenanceEnables centralized proxy and orchestration of MCP servers, providing unified tool discovery, authentication, and secure request routing. It adds a human-in-the-loop approval gate for high-risk actions and audit logging.Apache 2.0
- AlicenseAqualityCmaintenanceProvides a security governance layer for AI agents to safely access upstream MCP servers, enforcing tool-level RBAC, parameter constraints, authentication via static tokens or OIDC, and tamper-evident audit logging.21Apache 2.0