governed-mcp-gateway
Cubiczan Agent Platform
Идентичность, деньги и доказательства для агентов, которые реально работают.
Три SKU, одно рабочее пространство. MCP-клиенты сохраняют Bearer-принципала через tools/call и SSE. Списание не может быть завершено без мандата, а сверх лимита — без второго ключа человека. Утверждение для совета директоров не может быть опечатано без агента, CHP-замка и хэшированного документа.

SKU | Порт | Репозиторий | Задача |
| Принципал на каждом вызове инструмента и SSE-кадре. Ротация учётных данных в vault. Списки разрешённых инструментов. | ||
| Предложение → мандат → контрассигнование → расчёт. Stripe по умолчанию; x402 — как рельса. | ||
| Утверждение → агент → замок → документ. Движки ASC 842 / 606 / 718. Доказательственный пакет с HMAC-цепочкой. |
Общие примитивы (packages/shared): CHP-шлюз, HMAC-реестр, HTTP/SSE-хелперы. Ноль зависимостей npm в рантайме. Stripe и x402 — это рельсы — тесты никогда не обращаются к живым сетям.
Быстрый старт
npm install
npm test
npm run gateway # :7474
npm run spend # :7475
npm run cfo # :7476Демонстрационные Bearer-ключи (также в .env.example):
Роль | Ключ |
Агент шлюза |
|
Человек шлюза |
|
Исследование шлюза (без |
|
Агент расходов |
|
Человек расходов |
|
CFO-агент |
|
CFO-человек |
|
Перегенерируйте карточки README из живых локальных API:
npm run shotsRelated MCP server: identity-aware-mcp-server
1. Управляемый MCP-шлюз
Продакшн-MCP теряет идентичность. listTools выполняется в потоке запроса; tools/call и SSE выполняются где-то ещё. Этот шлюз преобразует Bearer-учётные данные в Принципала, внедряет его в каждый JSON-RPC-вызов и повторяет его в каждом SSE-кадре. Именованные входы vault ротируются на месте — github_token остаётся github_token.



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Метод | Путь | Что |
|
| JSON-RPC |
|
| SSE-уведомление с |
|
| Ротация vault только для человека; старый хэш умирает |
|
| Проверка секрета против текущего хэша |
2. Плоскость расходов и мандатов агента
Агенты предлагают. Мандаты авторизуют. Человек контрассигнует, когда сумма превышает автоматический лимит. Предлагающий агент не может контрассигновать сам себя. Расчёт — это рельса: событие счётчика Stripe по умолчанию, x402 payment-required, если вы об этом просите. Никаких вызовов блокчейна в этом MVP.



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Метод | Путь | Что |
|
| Оператор создаёт покрытие в оставшихся центах |
|
| Предложение агента; полоса |
|
| Второй ключ человека; агенты отклоняются |
|
|
|
3. Аудируемая сеть CFO-агентов
Утверждение для совета директоров не завершено, пока у него нет агента, состояния LOCKED в CHP и хотя бы одного хэша исходного документа. Движки измеряют (ASC 842 lease rollforward, ASC 606 constrained POC, ASC 718 SBC). Они не определяют факты права. Расход токенов прикрепляется как источник в том же реестре с HMAC-цепочкой.



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Метод | Путь | Что |
|
| Открыть утверждение |
|
| Прикрепить именованный источник; SHA-256 сохраняется |
|
| Замок человека → |
|
| Классификация ASC 842 + rollforward |
|
| Опечатать; |
Спецификации
Изменение OpenSpec: openspec/changes/ship-three-sku-platform/.
Лицензия
MIT
Available Tools
3 toolscontext.inspectA
Read the current session pack and schema token-tax report for the authenticated principal. Returns the bytes→tokens heuristic, session tool names, savedTokens versus the full allowlist, and (unless includeEstate=false) the estate including oversized flags. Does not admit tools and does not execute other tools. Call this before context.need to see what is already loaded. Fail-closed: requires the same principal as the session.
Inputs: sessionId, includeEstate.
context.needA
Admit extra tools or a named pack into this session (allow-by-need). Always intersected with the principal allowlist — fail-closed. Research cannot admit stripe.charge. Does not run the admitted tools; call tools/list afterwards to see the new pack, or context.inspect to see tax. sessionId defaults to ses_. Denied names are returned in denied[] and recorded on the ledger.
Inputs: pack, tools, sessionId.
echo.pingA
Identity probe. Echoes the call arguments and the authenticated Principal the gateway injected onto this tools/call (id, kind, org). Use it to confirm Bearer identity survived onto the tool worker. Does not hit a network, mutate vault state, or charge. Idempotent except for an audit-ledger append. Not a substitute for context.inspect.
Inputs: message.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
context.inspect is read-only session state, context.need is a mutating admission action, and echo.ping is an identity probe. The descriptions explicitly distinguish their purposes, so an agent should not confuse them.
All tool names follow a consistent namespace.action pattern: context.inspect, context.need, and echo.ping. Even though the namespaces differ, the lowercase dot-separated verb suffix style is uniform across the set.
Three tools is small but well-scoped for a governance gateway: inspect current state, request admission, and verify identity. Each tool provides a distinct, non-redundant operation that earns its place.
The core read and admit operations are covered, and built-in tools/list handles discovery, but there is no way to revoke, release, or reset previously admitted tools or packs. This creates a notable lifecycle gap for an over-admission scenario.
Related MCP Connectors
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Open-source MCP gateway with per-agent tool permissions, call approvals and tool-change review.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA production-grade MCP server designed for multi-tenant, authenticated, and observable AI agent systems, enabling secure tool execution across heterogeneous data sources.69MIT
- FlicenseNot gradedqualityDmaintenanceA production-ready MCP server that authenticates agents via OAuth 2.1 Bearer tokens, validates JWTs with JWKS, enforces tool-level scopes and roles, and logs the full delegation chain.-
- AlicenseNot gradedqualityDmaintenanceGoverned MCP server for bank-grade agent tool access with RBAC, PII redaction, rate limiting, and audit logging.MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides a security gateway for AI agents, enforcing allow/confirm/deny policies on tool calls and requiring human approval for risky operations, with full audit logging.-