mcp-policy-gateway
Click on "Install 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-gatewayGet the account summary for account 9876543210"
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 policy-first MCP server reference implementation. It shows how to give an agent useful tools without allowing the model to decide authorization, cross tenant boundaries, leak direct PII, or execute high-impact mutations on its own.
This is a portfolio/reference implementation. Every record is synthetic; it is not production software and does not claim to integrate with a bank, payment processor, or customer system.
Why this exists
A common MCP demo exposes a raw API to a model and treats a successful tool call as a security model. This project takes the opposite position:
Policy is deterministic. The model cannot authorize itself.
Tenant boundary is enforced server-side. A tool argument cannot switch tenant.
Tool output is minimized. The account summary intentionally excludes owner name and email.
High-impact actions stop at an approval gate. A freeze request produces no state change.
Every decision is auditable. Allow, deny and approval-required outcomes create structured audit events.
Mutation requests require a reason and idempotency key.
Related MCP server: scopeguard-mcp
Architecture
MCP client / agent
│ tool call
▼
FastMCP stdio adapter
│ verified principal (demo fixture here)
▼
GatewayService ──► PolicyEngine ──► allow / deny / require approval
│ │
▼ ▼
synthetic domain data structured audit eventIn a production deployment, the principal would be derived from a verified identity/session outside the model context. Never accept tenant_id, roles, or scopes from a tool argument or model output.
Tools
Tool | Risk | Behaviour |
| Read | Allows only cases in the caller's tenant with the right scope. |
| Read | Returns a minimized summary; never direct PII. |
| Mutation | Requires a scope, reason and idempotency key, then always requires human approval. |
Quickstart
Requires Python 3.11+.
python -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytest
.venv/bin/ruff check .Run as an MCP stdio server:
.venv/bin/mcp-policy-gatewayThe adapter uses a deliberately fixed demo principal for local exploration. Real identity propagation is intentionally documented as a production integration concern rather than faked here.
Demonstrated abuse controls
The tests prove the gateway:
denies an agent from
tenant_redtrying to readtenant_bluedata;denies a tool call without its required scope;
does not return owner name or email through the summary tool;
returns
require_approvalrather than mutating account state; andrejects state-changing requests that omit a reason or idempotency key.
Threat model and non-goals
See THREAT_MODEL.md. The design is intentionally narrow: it demonstrates a policy boundary around MCP tools, not full identity infrastructure, durable audit storage, secrets management, or a payment/ledger system.
Interview walkthrough
A concise way to explain the project:
I designed the MCP boundary so the model can reason over safe, scoped data but cannot decide access or execute high-impact actions. Authorization is deterministic, tenant isolation is enforced server-side, the tool surface minimizes PII, and sensitive mutations terminate in an auditable human approval gate.
Development
.venv/bin/pytest
.venv/bin/ruff check .CI runs both checks on pushes and pull requests.
License
MIT. See LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceA governance and policy enforcement gateway for MCP servers that provides hard guardrails, dynamic parameter bounds, human-in-the-loop approvals, and audit telemetry.211MIT
- AlicenseAqualityCmaintenanceEnables policy-first defensive security operations for MCP, providing repository and web-security analysis with controlled authorization, scoped execution, and auditability.9MIT
- FlicenseNot gradedqualityCmaintenanceEnables approval-gated incident response workflows that gather evidence through read-only MCP tools, perform idempotent writes, and preserve a durable audit trail.1
- AlicenseNot gradedqualityCmaintenanceEnforces fine-grained, context-aware access control on MCP tool calls, with a tamper-evident, replayable audit log that records denials and verifies every decision.MIT
Related MCP Connectors
Remote MCP for A2A caller identity, scope policy, verdict receipts, and audit history.
Paid remote MCP for AI Studio Workspace approval gate MCP, structured receipts, audit logs, and revi
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcorrego/mcp-policy-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server