MCP Architecture
VaultCrux v1.2 introduces a dedicated MCP service at VaultCrux/apps/mcp.
Service boundary
- Process:
@vaultcrux/mcp - Port:
8091(host bind14334) - Health contracts:
GET /healthzGET /readyzGET /metrics
- Tool contracts:
GET /capabilitiesPOST /rpc(JSON-RPC 2.0)POST /stream(streamable HTTP, NDJSON JSON-RPC responses)GET /sse(SSE capability + keepalive stream)stdiobridge (pnpm --filter @vaultcrux/mcp stdio)
stdio transport
- Environment:
MCP_STDIO_API_KEY(required)MCP_STDIO_TENANT_ID(optional, defaults todefault)
- Input/output contract:
- One JSON-RPC payload per line on stdin.
- One JSON-RPC response per line on stdout.
- Invalid JSON lines return JSON-RPC parse error (
-32700).
Authentication and rate limiting
x-tenant-idandx-api-keyare required for/rpcand/capabilities.- Mutating methods additionally require idempotency (
x-idempotency-keyor tool param). - Approved mutation execution can include
x-shield-approval-token. - MCP reuses API-key validation and DB-backed minute windows for deterministic 429 +
retry-after.
Shield decision pipeline
- MCP evaluates tool calls through Shield before API passthrough.
- Decision outcomes:
allow: normal tool executionapproval_required: JSON-RPC error withapprovalRequestId+decisionIddeny: JSON-RPC error with structured denial type anddecisionId
- Decisions are persisted to
vaultcrux.shield_decisionsand emitted asshield.decisionoutbox events.
Tool map
query_vault→POST /v1/retrieveget_credit_balance→GET /v1/credits/:agentIdget_credit_escrow→GET /v1/credits/:agentId/escrowget_economy_dashboard→GET /v1/economy/dashboard/:agentIdconvert_credits_to_discount→POST /v1/economy/convertget_subscription_discount_preview→POST /v1/economy/convert/previewtip_platform→POST /v1/economy/tip-platformbrowse_bundles→GET /v1/bundlespurchase_bundle→POST /v1/bundles/purchase

