Skip to main content
Glama

Cubiczan Agent Platform

为真正交付的代理提供身份、资金和证据。

三个 SKU,一个工作区。MCP 客户端通过 tools/call 和 SSE 保持 Bearer 主体。没有授权委托,且超过上限时没有人工第二密钥,支出无法结算。没有代理、CHP 锁定和哈希文档,董事会声明无法封存。

三个 SKU:受治理的 MCP 网关、支出授权平面、CFO 代理网格

SKU

端口

仓库

职责

受治理的 MCP 网关

:7474

icohangar-ops/governed-mcp-gateway

每个工具调用和 SSE 帧上的主体。保管库凭据轮换。工具白名单。

代理支出与授权平面

:7475

icohangar-ops/spend-mandate-plane

提议 → 授权 → 会签 → 结算。默认使用 Stripe;x402 是一条轨道。

可审计的 CFO 代理网格

:7476

icohangar-ops/cfo-agent-mesh

声明 → 代理 → 锁定 → 文档。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 中):

角色

密钥

网关代理

mcp_agt_payops_demo

网关人工

mcp_human_controller_demo

网关研究(无 stripe.charge)

mcp_agt_research_demo

支出代理

spend_agt_payops_demo

支出人工

spend_human_controller_demo

CFO 代理

cfo_agt_lease_demo

CFO 人工

cfo_human_controller_demo

从实时本地 API 重新生成 README 卡片:

npm run shots

Related MCP server: identity-aware-mcp-server

1. 受治理的 MCP 网关

生产环境 MCP 会丢弃身份。listTools 在请求线程上运行;tools/call 和 SSE 在其他地方运行。此网关将 Bearer 凭据解析为主体,将其注入到每个 JSON-RPC 调用中,并在每个 SSE 帧上重复它。命名保管库输入原地轮换——github_token 保持为 github_token。

主体注入到 tools/call

SSE 在每个帧上重复主体

无需新输入 ID 即可轮换 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

方法

路径

说明

POST

/mcp

JSON-RPC initialize、tools/list、tools/call

GET

/mcp/sse?once=1

带有 _meta.cubiczan.principal 的 SSE 通知

POST

/v1/credentials/:name/rotate

仅限人工的保管库轮换;旧哈希失效

POST

/v1/credentials/verify

根据当前哈希检查密钥


2. 代理支出与授权平面

代理提议。授权委托批准。当金额超过自动上限时,人工会签。提议代理不能自行会签。结算是一条轨道:默认 Stripe 计量事件,如果你要求,则使用 x402 付款要求。此 MVP 中没有链调用。

低于上限的提议自动锁定

超过上限需要人工第二密钥

Stripe 计量与 x402 付款要求

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

方法

路径

说明

POST

/v1/mandates

操作员创建剩余美分覆盖

POST

/v1/proposals

代理提议;通道 auto | approval | blocked

POST

/v1/countersign

人工第二密钥;代理被拒绝

POST

/v1/settle

{ "rail": "stripe" } 或 "x402"


3. 可审计的 CFO 代理网格

董事会声明在拥有代理、LOCKED CHP 状态和至少一个源文档哈希之前不算完成。引擎进行计量(ASC 842 租赁滚动、ASC 606 受限 POC、ASC 718 SBC)。它们不决定法律事实。代币支出作为源附加在同一个 HMAC 链式账本上。

无文档的未封存声明

已封存的证据包

ASC 842 融资租赁以 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

方法

路径

说明

POST

/v1/claims

打开声明

POST

/v1/claims/:id/documents

附加命名源;存储 SHA-256

POST

/v1/claims/:id/lock

人工锁定 → LOCKED

POST

/v1/engines/lease

ASC 842 分类 + 滚动

GET

/v1/evidence/:id

封存;如果没有文档或未锁定则返回 400

规范

OpenSpec 变更:openspec/changes/ship-three-sku-platform/。

许可证

MIT

Available Tools

3 tools
context.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

    A4.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness3/5

    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

    Related MCP Servers