Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP Method Reference

📋 Reference lens: this page lists what each MCP method does at the gateway today, from the client’s point of view. For how identifiers are preserved, aliased, or namespaced, see MCP Routing Semantics.

Gateway methods fall into three groups: initialize creates backend sessions, routed methods use them, and ping remains local to the gateway process.

Initialize

AspectBehavior
Required contextRMCP DownstreamSessionId, UserConfig, VirtualHostId, and ContextForgeClaims. The Mcp-session-id header is not required yet.
FanoutOne StreamableHttpClientTransport per configured backend in the selected virtual host, opened concurrently with futures::future::join_all.
Backend failureNot fatal. A backend that fails to initialize is stored with no running service; list calls skip it and routed calls to it fail.
Stored stateThe local user session mapping, plus one BackendTransports entry per backend keyed by principal, backend name, and downstream session id.
ResultInitializeResult with the gateway’s current fixed capability set: completions, prompts, resources, and tools enabled. Backend capabilities are stored with transport state but are not merged into the response yet.

Routed List Methods

list_tools, list_resources, list_prompts, and list_resource_templates share one fanout path:

AspectBehavior
FanoutConcurrent call to every connected backend in the session.
IdentifiersA single backend preserves upstream identifiers; multiple backends use the backend map-key prefix. Explicit control-plane tool aliases are returned exactly as configured. Resource templates apply the same single-versus-multi rule to both names and URI templates.
OrderingMerged output is sorted by name.
FailuresFailed or unavailable backends are logged and omitted from the merged result.
PaginationOne backend call per request and no downstream cursor; see Known Gaps.

Routed Targeted Methods

Targeted calls resolve exactly one backend using an explicit tool alias, a single-backend pass-through, or a multi-backend prefix:

MethodBehavior
call_toolResolves an exact control-plane alias first, then falls back to the single-versus-multi rule. It runs the optional plugin hooks, tracks progress, forwards the backend-local tool name, and propagates downstream cancellation.
read_resourcePreserves a single-backend URI or strips a multi-backend prefix, then returns the selected backend’s result.
subscribe, unsubscribeApply the same resource-URI routing, track the downstream subscription, and forward or stop forwarding matching resource-update notifications.
get_promptPreserves a single-backend prompt name or strips a multi-backend prefix, then returns the selected backend’s result.
completeApplies the same routing to the prompt name or resource URI in ref and returns the selected backend’s completion result.

Routed failures are JSON-RPC errors: an identifier that cannot select a backend or an unavailable backend returns an internal error, and duplicate backend matches invalidate the session; see Failure Modes.

Local Methods

This method passes through the same HTTP middleware but does not touch backends:

MethodCurrent behavior
pingReturns success.

Session Delete

A downstream DELETE with Mcp-session-id is handled by RMCP first. On a successful response, session_id_layer removes the local user session mapping and the BackendTransports entries for that principal and session id. See Session Ownership for the cleanup rules.