Governed MCP Starter
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.
Governed MCP Starter
A vendor-neutral, secure-by-default reference starter for enterprise AI agent tool servers built around the Model Context Protocol (MCP).
Core design principle: Rules give the verdicts, AI advises, and people approve every change.
Why This Exists
Enterprise AI agents that inspect collaboration suites, directories, or financial systems often need powerful admin-level read access. Giving raw credentials, unmasked PII, and inconsistent authorization logic to every agent is a risk no enterprise security team accepts.
This starter demonstrates a reusable governed tool boundary where:
Agents never hold upstream credentials — only a small, auditable, read-only tool server does.
Authorization fails closed — an Open Policy Agent (Rego) policy checks caller role, tenant clearance, tool allowlist, and
READ-only scope before every call. If the policy engine is unreachable, the call is denied.Identities are pseudonymised before the model sees data — an HMAC-SHA256 keyed pseudonymizer + strict field allowlist strips names, emails, and phone numbers at the tool boundary.
Every call is recorded in a tamper-evident audit chain — hash-chained, content-free entries detect post-hoc modification.
Operators have an immediate kill switch — global or per-tool halts stop agent tool execution cleanly.
Controls are enforced by automated contract tests in CI, not by convention.
Related MCP server: governed-mcp
Architecture
flowchart LR
Agent["AI Agent / LLM"] -->|"Verified CallerContext"| KS{"Kill Switch"}
KS -->|"Halted"| Audit["Hash-Chained Audit Log"]
KS -->|"Active"| OPA{"OPA Policy Sidecar<br/>(Fail-Closed Rego)"}
OPA -->|"DENY / Unreachable"| Audit
OPA -->|"ALLOW (READ-only)"| Audit
OPA -->|"ALLOW"| Data["Read-Only Enterprise Store"]
Data -->|"Raw Records"| Pseudo["Keyed Pseudonymizer +<br/>Field Allowlist"]
Pseudo -->|"Pseudonymised Snapshot<br/>(Zero PII)"| AgentQuick Start (No API Keys Required)
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Run the security contract test suite
pytest -v
# Run the end-to-end CLI walkthrough
PYTHONPATH=src python3 -m governed_mcp.demoTo expose the gateway as a live FastMCP server:
pip install -e ".[mcp]"from governed_mcp import (
GovernedToolGateway,
HashChainedAuditLog,
KeyedPseudonymizer,
KillSwitch,
OPAPolicyClient,
create_fastmcp_server,
)
gateway = GovernedToolGateway(
policy=OPAPolicyClient(), # talks to pod-local OPA sidecar; fails closed if unreachable
pseudonymizer=KeyedPseudonymizer(b"replace-with-vault-secret-32byte"),
audit_log=HashChainedAuditLog(),
kill_switch=KillSwitch(),
)
mcp = create_fastmcp_server(gateway)Security Contract Tests Included
Control | Contract Verified in |
Zero PII leakage | Raw names, emails, and phone numbers never appear in agent-facing payloads; only |
Fail-closed policy | Missing roles, uncleared tenants, write attempts, and unreachable OPA sidecars all deny by default. |
Kill switch | Global and per-tool halts immediately block execution and record |
Tamper-evident audit | Hash-chain verification passes on intact logs and fails immediately if any historical entry is modified. |
Tenant isolation | Pseudonyms are deterministic within a tenant and distinct across tenants. |
Related Reading
Enterprise Agent Playbook: karthikeyanselvam.com/playbook.html
Interactive Architecture Diagrams: karthikeyanselvam.com/projects.html
License
MIT — © 2026 Karthikeyan Selvam
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Permission checks, human approval cards, and signed audit trails for AI agent tool calls.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables a language model to safely query internal services through a closed set of read-only, schema-validated tools, with full auditing and refusal logging.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query a read-only data surface through typed tools, enforcing caller-specific row access, field masking, and withheld-row disclosure so they can retrieve entitled information without writes or silent data leakage.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely query SQL databases through read-only tools for describing entities, reading records, and aggregating records, with view-based access and fail-closed per-user row-level security.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to safely explore and query SQL databases through read-only, AST-checked SQL, database-enforced read-only transactions, timeouts, row caps, PII masking, and audit logging.MIT