Skip to main content

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:

  1. Tenant Isolation: Gateway auth extracts X-Tenant-ID from the API key or bearer token and binds every MCP operation and audit entry to that tenant.
  2. Caller Identity Resolution:
    • Explicit header: X-Agent-Id resolves an AgentIdentity belonging to the caller's tenant.
    • Worker-bound identity: a bearer principal linked to a worker identity resolves that worker's AgentIdentity.
  3. Fail-Closed Without Identity: When scope enforcement is enabled and no AgentIdentity resolves for a guarded call, Cordum denies the request rather than granting ambient access.
  4. Standalone STDIO Bridge (cordum-mcp): Standalone cordum-mcp (cmd/cordum-mcp/main.go) runs without strict scope enforcement by default unless --agent-id is supplied, making local CLI prototyping straightforward while preserving strict scoping when an agent ID is attached.

Tier note: Creating and managing AgentIdentity records via POST /api/v1/agents checks the agent_identity feature 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:

DimensionFieldEnforcement Behavior
Toolsallowed_toolsFilters tools/list results and rejects unlisted tool names at tools/call.
Serversallowed_serversGlob match (mcp/*, upstream server name). Empty denies server-guarded MCP actions (fail-closed).
Resourcesallowed_resourcesURI glob filter (e.g. cordum://jobs/*) enforced on resources/read.
Risk Tierrisk_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.

Verify in source →
  • core/mcp/filter.go & core/mcp/registry.go — Identity scope filtering across tools/list and tools/call
  • core/controlplane/gateway/handlers_mcp.go — X-Agent-Id resolution and SetScopeEnforcement(true)
  • core/controlplane/gateway/handlers_agents.go — AgentIdentity CRUD & entitlement checks
  • cmd/cordumctl/mcp_attach.go — Client adapter config writers