Aegis
Enables governing tenant-aware MCP tools with policy enforcement, scoped access, human approval workflows, and tamper-evident audit logging.
README
Aegis MCP Governance Registry
Aegis is a production-oriented reference implementation for governing tenant-aware MCP tools. It combines two deliberately bounded Streamable HTTP reference endpoints with a secure registry dashboard, policy outcomes, a short-lived human-approval flow, and a tamper-evident audit ledger. It does not connect to or operate customer systems.
What You Can Demonstrate
| Capability | Implementation in this repository |
|---|---|
| Reference MCP endpoints | POST /mcp/read hosts safe deterministic tools and POST /mcp/write hosts a simulated destructive tool. Both expect modern MCP request metadata headers. |
| Capability discovery | Each endpoint has internal capability metadata at /.well-known/mcp-capabilities?server=read or ?server=write. |
| Tenant and scope enforcement | A bearer token adapter resolves a tenant, principal, and scopes before every MCP tool call. |
| Policy gate | The local policy evaluator enforces scope and payload caps. Setting OPA_URL enables an OPA-compatible decision request while retaining a safe local fallback. |
| Human approval | change.create generates a queue item, expires after fifteen minutes, and consumes an approved elevation once. |
| Auditability | Policy, approval, and execution activities are redacted, append-only through the application surface, tenant-isolated, and hash-chained. |
| Operator console | Authenticated users can inspect registry services, tenants, policies, approvals, and the audit ledger. Administrators may validate and enable/disable reference services and make approval decisions. |
The implementation aligns its transport and resource discovery shape with the MCP Streamable HTTP and authorization specifications.[1] [2] Its private registry metadata is an internal extension; it is not presented as the public MCP Registry server.json format.[3]
Local Development
You need Node.js 22+ and a MySQL-compatible database. Copy the environment values required by your host, install dependencies, and launch the app.
pnpm install
pnpm drizzle-kit generate
pnpm db:push
pnpm dev
When the service starts, visit the dashboard URL and sign in. Seed records are created lazily the first time a governance endpoint or dashboard query accesses the registry. The reference interface uses only deterministic seed data, not real customer systems.
MCP Quick Start
During local development, demo tokens take the exact form below. They are a development adapter, not an OAuth substitute.
demo|northstar|demo:alice|project:read,incident:read,metrics:read,change:write
To confirm the endpoint contract, run the included smoke test after the service starts.
pnpm exec node scripts/mcp-smoke.mjs
To issue a direct JSON-RPC tool call:
curl -sS -X POST http://localhost:3000/mcp/read \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer demo|northstar|demo:alice|project:read' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: tools/call' \
-H 'Mcp-Name: project.search' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"project.search","arguments":{"query":"telemetry"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'
The write endpoint follows the same contract at /mcp/write, but change.create will first create an approval record. Approve it from the Aegis console, then submit the identical call again before the elevation expires.
Beginner Deployment: TiDB Cloud + Render
This is the recommended low-cost deployment path for a learning or portfolio environment. TiDB Cloud Starter is MySQL compatible and requires TLS for public connections, while Render can host this Node application as a Web Service.[4] [5] Free Render services can sleep when idle, so expect the first visit after inactivity to take longer.[6]
A. Create and connect TiDB Cloud
Create a Starter instance with its spending limit set to 0. On the instance page, click Connect in the upper-right corner, keep Public selected, choose General, and generate a password. Keep the password private.
B. Create the Render Web Service
After pushing this repository to GitHub, open the Render dashboard. Click + New in the upper-right corner, select Web Service, click Connect beside this repository, and use these exact values.
| Render form field | Value |
|---|---|
| Name | mcp-governance-registry |
| Branch | main |
| Language | Node |
| Build Command | corepack enable && pnpm install --frozen-lockfile && pnpm db:render-migrate && pnpm build |
| Start Command | pnpm start |
| Instance Type | Free |
| Root Directory | Leave empty |
C. Add Render environment variables
In the same Render form, open Advanced. Under Environment Variables, add each row below. Do not put any secret value in GitHub or in a screenshot.
| Key | Value |
|---|---|
DATABASE_URL |
The TiDB URL in this shape: mysql://USERNAME:PASSWORD@HOST:4000/test. URL-encode special characters in the username or password. |
TIDB_ENABLE_SSL |
true |
NODE_VERSION |
22 |
VITE_PORTABLE_AUTH |
true |
JWT_SECRET |
A newly generated long random secret. |
DASHBOARD_ACCESS_KEY |
A separate long password that you will type into the dashboard after deployment. |
ALLOW_DEMO_MCP_TOKENS |
false |
The database URL is private. TiDB Cloud Starter requires TLS for a public connection, and the app’s TIDB_ENABLE_SSL=true configuration enables it.[5]
Click Create Web Service at the bottom of the form. Render opens the service’s Events page. Wait until the status is Live, then click the displayed onrender.com link. On the first visit, enter the value you set for DASHBOARD_ACCESS_KEY and click Open dashboard.
D. Verify
After the dashboard opens, visit Registry, Approvals, and Audit ledger. Use the smoke test with your Render URL only after you deliberately configure a real OAuth access-token validator for MCP clients; demo tokens are disabled by default.
Verification and Load Scaffold
Run the application tests before every release.
pnpm check
pnpm test
pnpm exec node scripts/mcp-smoke.mjs
The load scaffold sends independent JSON-RPC requests, which is appropriate for validating a stateless Streamable HTTP deployment behind a load balancer. Begin with 100 requests and 20 concurrent clients, then repeat after scaling the deployment to a second replica and compare p50/p95 latency and error rate.
CONCURRENCY=20 REQUESTS=100 pnpm exec node scripts/load-test.mjs
For an official protocol conformance run, install and execute the current official MCP conformance suite separately against both /mcp/read and /mcp/write. Retain its versioned output as release evidence; this repository's smoke script is intentionally narrow and does not claim to replace that suite.
Extending the Platform
Add a new safe reference tool by inserting its registry record and schema into defaultToolRows in server/governance.ts, extending simulatedToolOutput, then adding a test and rerunning the smoke script. A real integration should live behind a least-privilege service identity and return redacted results only.
Replace the demo bearer adapter in server/mcp.ts with JWT validation against your configured issuer or perform validation at an API gateway. The MCP authorization specification expects HTTP-based implementations that support authorization to act as OAuth resource servers and publish protected-resource metadata.[2] For production audit retention, export the hash-chained events to immutable object storage or a SIEM and restrict database credentials so the service principal has no update/delete permission on auditEvents.
References
[1] Model Context Protocol — Streamable HTTP
[2] Model Context Protocol — Authorization
[3] Model Context Protocol — Registry overview
[4] TiDB Cloud — Select Your Plan
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。