Govern an MCP Server in 5 Minutes
Cordum fronts MCP tools/list, tools/call, and resources/read over Gateway HTTP/SSE (/mcp/message, /mcp/sse) and standalone stdio (cordum-mcp), applying Policy-Before-Execution, caller-scoped filtering, and hash-bound -32099 approval holds on mutating calls.
:::info Policy gate is ON by default in cordumctl up --dev
Although legacy bare binaries default mcp.policy_gate_enabled to false unless configured, the starter Compose dev overlay (docker-compose.dev.yml), config/system.yaml, and cordumctl up --dev all enable both mcp.enabled: true and mcp.policy_gate_enabled: true out of the box so mutating calls immediately route through the -32099 Edge approval hold pipeline.
:::
1. Start the Local Stack
cordumctl up --dev
This generates .env, local TLS certificates (./certs/), and ./cordum.yaml, starts Gateway (https://localhost:8081) and Dashboard (http://localhost:8082), and enables the Gateway MCP server with policy_gate_enabled: true.
Confirm MCP status with curl:
set -a; source .env; set +a
curl -sS --cacert ./certs/ca/ca.crt \
-H "X-API-Key: ${CORDUM_API_KEY}" \
-H "X-Tenant-ID: default" \
https://localhost:8081/mcp/status | jq
Verify "enabled": true and "policy_gate_enabled": true in the response.
2. Inspect Available Tools (tools/list)
Use cordumctl mcp tools list to verify what your caller can discover:
cordumctl mcp tools list --json
Note on caller identity & scoping on Gateway HTTP: Gateway
/mcp/messageenforces fail-closed agent scope filtering (SetScopeEnforcement(true)). If an HTTP caller targets a guarded tool without anAgentIdentity(passed viaX-Agent-Idor worker-linkedPrincipalID), Cordum denies the call (-32098/"no_identity"). Creating managedAgentIdentityrecords viaPOST /api/v1/agentsrequires an Enterprise license entitlement (agent_identity); standalonecordum-mcpstdio (--agent-idomitted) andcordumctl mcpadmin commands work directly with API key authentication on Community tier. See Scoped Discovery & Multi-Tenant for details.
3. Trigger a Policy-Gated -32099 Approval Hold
Call any mutating MCP tool (for example cordum_create_workflow or cordum_install_pack) via JSON-RPC /mcp/message:
curl -sS --cacert ./certs/ca/ca.crt \
-X POST https://localhost:8081/mcp/message \
-H "Content-Type: application/json" \
-H "X-API-Key: ${CORDUM_API_KEY}" \
-H "X-Tenant-ID: default" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "cordum_create_workflow",
"arguments": {
"name": "mcp-demo-wf",
"steps": {
"approve": { "type": "approval", "name": "Human sign-off" }
}
}
}
}' | jq
Because mcp.policy_gate_enabled is true, Cordum holds execution and returns JSON-RPC -32099:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32099,
"message": "human approval required",
"data": {
"approval_ref": "edge_appr_01...",
"approval_id": "mcp_appr_...",
"retry_hint": "retry_with_approval_ref",
"tool": "cordum_create_workflow",
"risk": "medium"
}
}
}
4. Approve as a Distinct Reviewer & Retry with _approval_ref
Cordum enforces self-approval separation: approving an edge_appr_* hold using the exact same API key credential that triggered the request is rejected (403 Forbidden).
Approve using the Dashboard user session created by cordumctl up --dev (CORDUM_ADMIN_USERNAME / CORDUM_ADMIN_PASSWORD in .env) — either in the browser at http://localhost:8082 (Edge Approvals) or by logging in to obtain a distinct operator JWT:
TOKEN=$(curl -sS --cacert ./certs/ca/ca.crt \
-X POST https://localhost:8081/api/v1/auth/login \
-H "Content-Type: application/json" \
-d "{\"username\":\"${CORDUM_ADMIN_USERNAME}\",\"password\":\"${CORDUM_ADMIN_PASSWORD}\"}" | jq -r '.token')
APPROVAL_REF="edge_appr_01..." # copy from -32099 response
curl -sS --cacert ./certs/ca/ca.crt \
-X POST "https://localhost:8081/api/v1/edge/approvals/${APPROVAL_REF}/approve" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tenant-ID: default" \
-H "Content-Type: application/json" \
-d '{"note":"verified in 5-min quickstart"}' | jq
Now resend the identical tools/call arguments with "_approval_ref": "${APPROVAL_REF}" added:
curl -sS --cacert ./certs/ca/ca.crt \
-X POST https://localhost:8081/mcp/message \
-H "Content-Type: application/json" \
-H "X-API-Key: ${CORDUM_API_KEY}" \
-H "X-Tenant-ID: default" \
-d "{
\"jsonrpc\": \"2.0\",
\"id\": 2,
\"method\": \"tools/call\",
\"params\": {
\"name\": \"cordum_create_workflow\",
\"arguments\": {
\"name\": \"mcp-demo-wf\",
\"steps\": { \"approve\": { \"type\": \"approval\", \"name\": \"Human sign-off\" } },
\"_approval_ref\": \"${APPROVAL_REF}\"
}
}
}" | jq
If any argument changes between the initial hold and the retry, the action hash mismatches and Cordum refuses execution (-32099 / denied).
core/controlplane/gateway/handlers_mcp.go— Gateway MCP route registration,loadMCPConfig, andSetScopeEnforcement(true)core/mcp/tools_mutating.go— Mutating tool contract and-32099retry behaviorcore/mcp/approval_hold.go&core/controlplane/gateway/mcp_gate.go— Hash-bound hold minting and consumption