governed-mcp-gateway

governed-mcp-gateway

This MCP server preserves a Bearer principal on every tool call and SSE frame, rotates vaulted credentials in place, and enforces per-tool allowlists for agents.

Category
访问服务器

README

Cubiczan Agent Platform

Identity, money, and evidence for agents that actually ship.

Three SKUs, one workspace. MCP clients keep a Bearer principal through tools/call and SSE. Spend cannot settle without a mandate and, over cap, a human second key. Board claims cannot seal without an agent, a CHP lock, and a hashed document.

Three SKUs: governed MCP gateway, spend mandate plane, CFO agent mesh

SKU Port Repo Job
Governed MCP Gateway :7474 icohangar-ops/governed-mcp-gateway Principal on every tool call and SSE frame. Vaulted credential rotation. Tool allowlists.
Agent Spend & Mandate Plane :7475 icohangar-ops/spend-mandate-plane Propose → mandate → countersign → settle. Stripe by default; x402 is a rail.
Auditable CFO Agent Mesh :7476 icohangar-ops/cfo-agent-mesh Claim → agent → lock → document. ASC 842 / 606 / 718 engines. HMAC-chained evidence pack.

Shared primitives (packages/shared): CHP gate, HMAC ledger, HTTP/SSE helpers. Zero runtime npm dependencies. Stripe and x402 are rails — tests never call live networks.

Quickstart

npm install
npm test
npm run gateway   # :7474
npm run spend     # :7475
npm run cfo       # :7476

Demo Bearer keys (also in .env.example):

Role Key
Gateway agent mcp_agt_payops_demo
Gateway human mcp_human_controller_demo
Gateway research (no stripe.charge) mcp_agt_research_demo
Spend agent spend_agt_payops_demo
Spend human spend_human_controller_demo
CFO agent cfo_agt_lease_demo
CFO human cfo_human_controller_demo

Regenerate the README cards from live local APIs:

npm run shots

1. Governed MCP Gateway

Production MCP drops identity. listTools runs on the request thread; tools/call and SSE run somewhere else. This gateway resolves a Bearer credential to a Principal, injects it on every JSON-RPC call, and repeats it on every SSE frame. Named vault inputs rotate in place — github_token stays github_token.

Principal injected on tools/call

SSE repeats principal on every frame

Rotate github_token without a new input id

curl -sS -H "Authorization: Bearer mcp_agt_payops_demo" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"echo.ping","arguments":{"hello":"world"}}}' \
  http://127.0.0.1:7474/mcp
Method Path What
POST /mcp JSON-RPC initialize, tools/list, tools/call
GET /mcp/sse?once=1 SSE notification with _meta.cubiczan.principal
POST /v1/credentials/:name/rotate Human-only vault rotate; old hash dies
POST /v1/credentials/verify Check a secret against the current hash

2. Agent Spend & Mandate Plane

Agents propose. Mandates authorize. A human countersigns when the amount is over the auto cap. The proposing agent cannot countersign itself. Settlement is a rail: Stripe meter event by default, x402 payment-required if you ask for it. No chain calls in this MVP.

Under-cap proposal auto-locks

Over-cap requires a human second key

Stripe meter vs x402 payment-required

curl -sS -H "Authorization: Bearer spend_agt_payops_demo" \
  -H "Content-Type: application/json" \
  -d '{"agent":"agt_payops","merchant":{"name":"Stripe","url":"https://stripe.com","country":"US"},"total":"12.00","rationale":"tool meter"}' \
  http://127.0.0.1:7475/v1/proposals
Method Path What
POST /v1/mandates Operator creates remaining-cents coverage
POST /v1/proposals Agent propose; lane auto | approval | blocked
POST /v1/countersign Human second key; agents are rejected
POST /v1/settle { "rail": "stripe" } or "x402"

3. Auditable CFO Agent Mesh

A board claim is not done until it has an agent, a LOCKED CHP state, and at least one source document hash. Engines measure (ASC 842 lease rollforward, ASC 606 constrained POC, ASC 718 SBC). They do not decide facts of law. Token spend attaches as a source on the same HMAC-chained ledger.

Unsealed claim without documents

Sealed evidence pack

ASC 842 finance lease ends at 0.00

curl -sS -H "Authorization: Bearer cfo_agt_lease_demo" \
  -H "Content-Type: application/json" \
  -d '{"title":"AI spend is $12.00 this period","narrative":"Token ledger supports the board claim.","agentId":"agt_lease"}' \
  http://127.0.0.1:7476/v1/claims
Method Path What
POST /v1/claims Open a claim
POST /v1/claims/:id/documents Attach a named source; SHA-256 stored
POST /v1/claims/:id/lock Human lock → LOCKED
POST /v1/engines/lease ASC 842 classification + rollforward
GET /v1/evidence/:id Seal; 400 if no documents or not locked

Specs

OpenSpec change: openspec/changes/ship-three-sku-platform/.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选