part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
MRTR is the pattern by which a stateless server obtains information from the client (user, LLM or file system) without sending requests of its own. It replaces, in a breaking way, the server-initiated requests of the legacy era. For a gateway it is also the point where the most consent policy is concentrated.
resultType: "input_required".sequenceDiagram
participant U as User
participant C as Client
participant S as Server
C->>S: tools/call (id: 1)
S-->>C: InputRequiredResult (inputRequests, requestState)
C->>U: Presents the elicitation
U-->>C: Responds
C->>S: tools/call (id: 2, same params + inputResponses + requestState)
S-->>C: CallToolResult (complete)
Each step is an independent request: the server processing the retry needs nothing that is not contained in it. That is why MRTR requires neither shared storage between instances nor affinity-based load balancing.
InputRequestsA map from identifiers (chosen by the server) to request objects: ElicitRequest (elicitation/create), CreateMessageRequest (sampling/createMessage) or ListRootsRequest (roots/list).
InputResponsesA map with the same keys and, as values, the client's results: ElicitResult, CreateMessageResult, ListRootsResult.
InputRequiredResultinputRequests (optional).requestState (optional): an opaque string meaningful only to the server.{ "jsonrpc": "2.0", "id": 1, "result": {
"resultType": "input_required",
"inputRequests": {
"github_login": { "method": "elicitation/create", "params": { "mode": "form", "message": "Please provide your GitHub username",
"requestedSchema": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] } } } },
"requestState": "AEAD-protected blob" } }
Retry:
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {
"name": "get_weather", "arguments": { "location": "New York" },
"inputResponses": { "github_login": { "action": "accept", "content": { "name": "octocat" } } },
"requestState": "AEAD-protected blob", "_meta": { "…": "…" } } }
| Request | Accepts input_required |
|---|---|
tools/call |
Yes |
resources/read |
Yes |
prompts/get |
Yes |
| Any other | No (MUST NOT) |
input_required to any of the three requests.inputRequests keys unique within the request; values only of the three types.requestState in any format (base64 JSON, encrypted JWT, serialised binary).requestState, the server MUST treat it as attacker-controlled input. If it influences authorisation, resource access or business logic, it MUST protect its integrity (HMAC or AEAD) and MUST reject any that fails verification. Protection may only be omitted when tampering can cause nothing worse than the request failing.inputRequests or requestState.input_required repeatedly.inputRequests, it MUST build the responses before retrying; if there are none, it MAY retry immediately.requestState exactly as received; MUST NOT inspect, parse or modify it; if it was not present, MUST NOT send it.id MUST be different.inputRequests and requestState only affect the retry of that request; they MUST NOT be used in other parallel requests.Malformed data in inputResponses → an appropriate JSON-RPC error. Extra parameters → ignore. If required responses are missing → the server SHOULD return a new input_required asking for them, not an error. If the user declines or cancels, the client does not need to retry (the server is not waiting).
input_required passes through the gateway before reaching the host. You can block types (e.g. never sampling), inspect elicitations (message, schema, URL) and log every round.requestState as is; it is opaque to you as well. If you need to correlate rounds, use your own identifiers in your _meta.MRTR_MAX_ROUNDS) to cut loops short.elicitation/create request over the stream; when translating to a legacy host, convert it into a server→client request. Both translations force you to keep temporary state: bound it and expire it.1. What must the client do with requestState?
It is opaque: an exact echo, without parsing or modifying it, and only in the retry of that request.
2. In which of these requests can input_required NOT appear?
Only tools/call, resources/read and prompts/get accept it.
3. What protection does the spec require for requestState when it influences authorisation?
It must be treated as attacker input and its integrity protected.
4. If the client omits a required response in the retry, the server SHOULD…
The spec prefers asking for the information again over failing.