Documentation Index
Fetch the complete documentation index at: https://modelcontextprotocol.io/llms.txt
Use this file to discover all available pages before exploring further.
Multi Round-Trip Requests (MRTR) was introduced in this version of the MCP
specification. This replaces the previous approach of sending server-initiated
requests. Servers MUST send server-to-client requests (such as
roots/list, sampling/createMessage, or elicitation/create) using the
MRTR pattern. The previous pattern of server-initiated requests is no longer
supported. This is a breaking change.Multi Round-Trip Requests
The Model Context Protocol (MCP) defines several ways for servers to request additional information from users during the processing of client requests (such asroots/list, sampling/createMessage, or elicitation/create). The multi round-trip requests pattern
provides a standardized way to handle these server-requests without requiring a shared storage layer across
server instances or requiring stateful load balancing.
The high level flow functions as follows:
- Client sends an initial request to the server with the parameters needed to perform the operation.
- Server determines that additional information is required to fulfill the request and responds requesting more information.
- Client gathers the requested information from the user or other sources, then retries the original request including the additional requested information.
- Server determines it has sufficient information to complete the operation, and responds with the final result.
Core Types
This flow is implemented in MCP using the following Types.InputRequests
AnInputRequests object is a map of server-client requests.
Keys are server-assigned string identifiers;
values are request objects (e.g., ElicitRequest, CreateMessageRequest, or ListRootsRequest).
InputResponses
AnInputResponses object is a map of client responses to the server requests.
Keys correspond to the keys in the InputRequests map; values are the client’s result for each request (e.g., ElicitResult, CreateMessageResult, or ListRootsResult).
InputRequiredResult
AnInputRequiredResult is a type of Result,
indicating that additional input is needed before the request can be completed.
inputRequests(optional): AnInputRequestsmap of server-initiated requests that the client must fulfill.requestState(optional): An opaque string meaningful only to the server. Clients MUST NOT inspect, parse, modify, or make any assumptions about its contents.
Supported Requests
Servers MAY sendInputRequiredResult responses on the following client requests:
| Client Request | Supports InputRequiredResult |
|---|---|
prompts/get | Yes |
resources/read | Yes |
tools/call | Yes |
tasks/result | Yes |
InputRequiredResult responses on any other client requests.
Basic Workflow
The basic workflow describes how a server can request additional input from the client as part of a client-server request. In this example we usetools/call as the client request, but the same pattern applies to any of the supported requests listed above.
Notably, it allows servers to request additional information without maintaining any server-side state.
The server encodes any needed context into the requestState field, which the client echoes back on retry.
Note that the requests in each step are completely independent: the server processing the retry does not need any information beyond
what is directly present in the retry request.
Server Requirements (Basic Workflow)
-
Servers MAY respond to any supported client request with an
InputRequiredResult. -
The
InputRequiredResultMAY include aninputRequestsfield.inputRequestskeys are server assigned identifiers and MUST be unique within the scope of the request.inputRequestsvalues are request objects that MUST be one ofElicitRequest,CreateMessageRequest, orListRootsRequest
-
The
InputRequiredResultMAY include arequestStatefield. If specified, this field is an opaque string meaningful only to the server. Servers are free to encode the state in any format (e.g. base64-encoded JSON, encrypted JWT, serialized binary). -
If a client request contains a
requestStatefield, servers MUST treatrequestStateas an attacker-controlld input. IfrequestStateinfluences authorization, resource acces, or business logic, servers MUST protect its integrigty (e.g. HMAC or AEAD) and MUST reject state that fails verification. Integrity protection MAY be omitted only wen tampering can cause nothing worse than request failure. -
To prevent replay, servers SHOULD include the following inside the integrity-protected
requestStatepayload and verify each on recepit:- the authenticated principal, rejecting state presented by a different principal.
- a short expiry (TTL), rejecting state presented after it lapses;
- an identifier for the originating request, e.g. the method name and a digest of its salient parameters,rejecting state presented on a request that does not match.
-
Servers MUST include at least one of
inputRequestsorrequestStatein everyInputRequiredResultresponse. -
Servers MUST NOT send an
inputRequeststhat the client has not declared support for in its capabilities. For example, if a client does not declare support forelicitation, the server MUST NOT include anyelicitation/createrequests in theinputRequestsfield. -
Servers MUST NOT assume that clients will fulfill the
inputRequestsor retry the original request. Servers MAY choose to return anInputRequiredResulton multiple attempts at the same request if they want to repeatedly prompt the user for information until they have what they need to complete the request.
Client Requirements (Basic Workflow)
- If a client receives an
InputRequiredResultthat contains theinputRequestsfield, the client MUST construct the requested inputs before retrying the original request. If theInputRequiredResultdoes not contain theinputRequestsfield, the client MAY retry the original request immediately. - If an
InputRequiredResultcontains therequestStatefield, the client MUST echo back the exact value of that field when retrying the original request. Clients MUST NOT inspect, parse, modify, or make any assumptions about therequestStatecontents. If theInputRequiredResultdoes not contain arequestStatefield, the client MUST NOT include one in the retry. - The JSON-RPC
idMUST be different between the initial request and the retry, as they are independent requests. - Both the
inputRequestsandrequestStatefields affect only the client’s retry of the original request. They MUST NOT be used for any other request that the client may be sending in parallel.
Tasks Workflow
For long-running operations that require server-side state, the persistent workflow leverages Tasks. Theinput_required task status indicates that additional information is needed.
Server Requirements (Tasks)
-
Servers MAY respond to
tasks/getby indicating that the task is in statusinput_required. -
Servers MUST include an
inputRequestsfield in thetasks/resultresponse when the task is in statusinput_required. -
inputRequestskeys are server assigned identifiers and MUST be unique within the scope of aTask. -
Servers MAY include a
requestStatefield in thetasks/resultresponse when the task is in statusinput_required.
Client Requirements (Tasks)
- When
tasks/getshows statusinput_required, clients MUST calltasks/resultto get theinputRequestsand optionalrequestState. - Clients SHOULD construct the results of those requests and call
tasks/input_responsewith theinputResponses&requestState(if present). - Clients MAY choose not to fulfill the input requests, in which case they MAY cancel the task.
Error Handling
Servers SHOULD validate that the data provided by the client is a validInputResponses object and that the information inside can be correctly parsed.
Protocol errors (malformed JSON, invalid schema, internal server errors) SHOULD return a JSON-RPC error response with an appropriate error code and message.
If additional, unexpected parameters are provided in the InputResponses object, the server SHOULD ignore any information it does not recognize or need.
If the client fails to send all the information requested in a previous InputRequests, and the missing information is necessary for the server to process the request,
the server SHOULD respond with a new InputRequiredResult requesting the missing information again, rather than returning an error.
Security Considerations
BecauserequestState passes through the client, malicious or compromised clients could attempt to modify it to alter server behavior,
bypass authorization checks, or corrupt server logic. Servers MUST validate request state as described in the server requirements above.