Scoped Discovery & Multi-Tenant Filtering
Unrestricted MCP servers hand an agent the entire tool catalog regardless of who is calling or what risk tier the agent operates at. Cordum filters both discovery (tools/list) and execution (tools/call, resources/read) against the caller's identity and policy configuration.
How Gateway Enforcement Works
On Gateway HTTP (/mcp/message and /mcp/sse), toolRegistry.SetScopeEnforcement(true) is active at startup:
- Tenant Isolation: Gateway auth extracts
X-Tenant-IDfrom the API key or bearer token and binds every MCP operation and audit entry to that tenant. - Caller Identity Resolution:
- Explicit header:
X-Agent-Idresolves anAgentIdentitybelonging to the caller's tenant. - Worker-bound identity: a bearer principal linked to a worker identity resolves that worker's
AgentIdentity.
- Explicit header:
- Fail-Closed Without Identity: When scope enforcement is enabled and no
AgentIdentityresolves for a guarded call, Cordum denies the request rather than granting ambient access. - Standalone STDIO Bridge (
cordum-mcp): Standalonecordum-mcp(cmd/cordum-mcp/main.go) runs without strict scope enforcement by default unless--agent-idis supplied, making local CLI prototyping straightforward while preserving strict scoping when an agent ID is attached.
Tier note: Creating and managing
AgentIdentityrecords viaPOST /api/v1/agentschecks theagent_identityfeature entitlement (Enterprise tier).
Four Dimensions of Agent Scope
An AgentIdentity restricts MCP access across four dimensions configured on cordum_register_agent / cordum_set_agent_scope or POST /api/v1/agents:
| Dimension | Field | Enforcement Behavior |
|---|---|---|
| Tools | allowed_tools | Filters tools/list results and rejects unlisted tool names at tools/call. |
| Servers | allowed_servers | Glob match (mcp/*, upstream server name). Empty denies server-guarded MCP actions (fail-closed). |
| Resources | allowed_resources | URI glob filter (e.g. cordum://jobs/*) enforced on resources/read. |
| Risk Tier | risk_tier (low, medium, high, critical) | Hides and denies tools whose declared RiskTier exceeds the agent's ceiling. |
Mutating Tool Pre-Approval vs. Holds
Mutating tools (cordum_create_workflow, cordum_install_pack, cordum_register_agent, etc.) still trigger a -32099 approval hold even when listed in allowed_tools — unless the tool is also explicitly listed in preapproved_mutating_tools on the calling AgentIdentity (intended for trusted non-interactive automation after review).
Connecting IDE & Coding Clients via MCP
cordumctl mcp attach can generate or merge MCP server stanzas for local developer clients:
cordumctl mcp attach claude-code --yes
cordumctl mcp attach cursor --yes
cordumctl mcp attach vscode --yes
Inspect supported attach adapters with cordumctl mcp attach --help.
core/mcp/filter.go&core/mcp/registry.go— Identity scope filtering acrosstools/listandtools/callcore/controlplane/gateway/handlers_mcp.go—X-Agent-Idresolution andSetScopeEnforcement(true)core/controlplane/gateway/handlers_agents.go—AgentIdentityCRUD & entitlement checkscmd/cordumctl/mcp_attach.go— Client adapter config writers