Repository navigation
Description
Extension Negotiation
Track: Standards
Author: Atul Tulshibagwale
Status: WIP
Changelog
- 2025-11-21:
- Using the existing extensions field in the capabilities section rather than defining a new field for requesting and choosing extensions.
- Clarified that only the latest minor version should be requested or chosen.
- Clarified how failures can handle the situation where the communication is incompatible with the choice of extensions.
- Added error response details
Abstract
Extensions specify how an optional behavior may be implemented by an MCP server and client. This SEP specifies how a client and server can agree on using a specific set of extensions during a session.
Motivation
As defined in the extensions SEP, the client and the server declare their support for specific extensions in the ClientCapabilities and ServerCapabilities objects and in the case of the MCP server, it is also specified in the server’s Server Card. However, the extensions SEP does not specify how a client and a server may negotiate the use of one or more specific extensions.
An MCP client may have independent sessions with an MCP server. Each such session might require the use of specific extensions. In the “greetings” example (from the Extension Versioning SEP), the same MCP Client and the same MCP Server may operate on behalf of users from different organizations. One organization may only require the client to do the basic greeting with all MCP servers, whereas another organization may require the same client to perform the basic greeting and the birthday greeting with all MCP servers. There may be situations where the client is capable of doing the birthday greeting, but the server is unable to understand the birthday greeting.
Therefore, on a per-session basis, the client and the server should be able to negotiate which extensions and which versions of the extensions they can use. The client and the server may be coded to support a superset of the extensions that they are able to support in a specific session.
Specification
Requesting Extensions
When an MCP client makes an initialization request to the MCP server, it MAY include the names of the extensions it would like to use in that session. To do this, it only includes the extensions in the capabilities field in the InitializeRequest that it intends to use with the server. If a client supports multiple versions of the same extension, it MUST only include the latest minor version of each major version that it supports. If the client is requesting the use of an extension that is under development (see the SEP for “Extension Versioning”), then it MUST NOT include any other version of the same extension.
For example, if a client supports the “io.modelcontextprotocol/greetings/1.0” and the ”io.modelcontextprotocol/greetings/1.1” extensions, it MUST only include the ”io.modelcontextprotocol/greetings/1.1” in the InitializeRequest, if it wants to use any 1.* version of the Greetings extension.
The following is an example of a well formed request, which requests multiple versions of the same extension:
{
"capabilities" {
//...
"extensions": {
"io.modelcontextprotocol/greetings/1.1": {},
"io.modelcontextprotocol/greetings/2.0": { "defaultLanguage": "MR-IN"}
}
}
}Choosing Extensions
In response to an InitializeRequest, the MCP server responds with an InitializeResult that MAY choose the extensions it will use with the client for that session. The MCP server chooses extensions by including the extensions it has chosen to use in the extensions field of the capabilities field of the InitializeResult.
The server MAY choose to omit the extensions field in the InitializeResult. This can happen if the server is unaware of extensions, or determines to not use any extensions with the client, but is still OK with establishing the session with the client.
A server MAY choose extensions that were not requested by the client. This is because the server may require the use of certain extensions, regardless of whether a client requests them.
It is possible that a server is unable to use all extensions requested by the client, even if the server is able to use all of them in that specific session. This can happen, for example, when a client requests the use of multiple major versions of the same extension.
Version Compatibility
Multiple Major Versions
When multiple major versions of the same extension are requested, the server MUST choose the highest mutually-supported version that it can use in the session.
Minor Version
For a specific major version of an extension, if the latest minor version that the server supports is lower than the minor version specified in the request, then the server MAY choose the latest minor version that it supports. If the latest minor version that the server supports is greater than the requested minor version, then:
- If the server can support the requested lower minor version, then it MAY choose the requested version.
- If the server cannot support the lower minor version, it MUST fail the initialization.
Development Versions
Development versions SHOULD only be chosen if explicitly requested. The server MUST choose the specific development version requested by the client. If the server is unable to choose that version, it MUST fail the initialization.
Successful Session Establishment
If the client and server can continue a session with the extensions specified in the extensions field in capabilities field of the InitializeResult, then the session establishment is successful, and the client and server MUST behave as specified in the chosen extensions.
Session Establishment Failure
A client or server MAY fail the initialization and terminate the session due to incompatibility in extension expectations.
Server Failure
A server MAY fail to initialize the session if:
- The server requires the use of an extension in the current session, but the prior communication that happened before the
InitializeRequestwas received, e.g., the way the client authenticated with the server, is incompatible with the required extension.
To fail the initialization, the server:
- MUST NOT respond with an
InitializeResultto the client - Sends an error notification to the client.
Client Failure
A client MAY terminate the session if:
- It requested the use of specific extensions in a session, and the
extensionsfield of thecapabilitiesfield in theInitializeResultdoes not contain an extension that it requires for the session to continue. - If the server has chosen a specific extension, but the prior communication of the session is incompatible with the choice of extensions.
To terminate a session as a result of extension failure, the client:
- MUST NOT send the
Initializednotification to the server - MUST terminate the underlying communication channel with the server.
Error Response
The client and server can send the following error responses to the each to indicate a failure in choosing extensions:
Incompatible Communication
The client or server can send this error to the other party if the required or chosen extension is incompatible with the prior communication of the session:
{
"message": "Unable to continue because it requires the use of an extension that is incompatible with prior communication of this session",
"data": {
"requested": "io.modelcontextprotocol/oauth-client-credentials"
}
}
Unsupported Extension
The client can send this error to the server, if the server chooses an extension that the client cannot support:
{
"message": "Client unable to support choice of extensions",
"data": {
"unsupported": { "io.modelcontextprotocol/oauth-client-credentials" }
}
}Example
Say a client would like to use the “greetings” extension with a server. It prefers using the “greetings/1.1” version, but it is OK to use the “greetings/1.0” extension. The InitializeRequest then includes the extensions field in the capabilities field that has the following content:
"extensions": { "io.modelcontextprotocol/greetings/1.1": {} }If the server can only use the “greetings/1.0” extension within this specific session, then it responds with an InitializeResult that has a capabilities field with the following extensions field:
"extensions": { "io.modelcontextprotocol/greetings/1.0": {} }If the server also requires the use of the “oauth-client-credentials” extension, then it responds with:
"extensions": { "io.modelcontextprotocol/oauth-client-credentials/1.0": {}, "io.modelcontextprotocol/greetings/1.0": {} }If the client cannot support this additional extension (which it did not request), then it terminates the session. However, if it does support the extension, then it can continue the session, but in that case, it MUST behave according to that extension specification.
Rationale
Why negotiation during initialization?
Extension selection must occur before any protocol operations to ensure consistent behavior throughout the session.
Why allow servers to add unrequested extensions?
Servers may require certain extensions for compliance, security, or operational reasons.
Why preference ordering?
Allows clients to express priorities when multiple compatible versions exist.
What happens if a chosen extension is incompatible with the way the communication has been set up?
The server can fail the initialization if it requires the use of a particular extension, and the way the prior communication of the session has taken place is incompatible with that extension. The client can terminate the session if the server chooses an extension that is incompatible with the way the prior communication of the session has taken place.
Backward Compatibility
This SEP is fully backward compatible:
- Clients that don't support extension negotiation can omit
extensionsin theInitializeRequest - Servers that don't support extension negotiation can omit
extensionsin theInitializeResult - The session can continue normally without extensions if both parties do not require them
- Existing MCP implementations continue to work unchanged
Security Considerations
- Servers MUST validate that requested extensions come from trusted sources
- Extension names MUST be validated against the pattern defined in the Extension Versioning SEP
- Clients MUST validate server-chosen extensions against their security policies
Activity
pja-ant commentedon Nov 21, 2025
This makes sense for some forms of extensions, but one of the reasons I somewhat punted on specifying negotiation approaches for extensions is that I'm not sure this really works in general for some of the kinds of extensions we're imagining.
For example:
For extensions that are introducing new post-init features then yes this should work, but what do we do about the other extensions? Does this negotiation not apply to them? When do we say that the negotiation applies and when it does not?
Assuming we do want to proceed with using something like this on a subset of extensions where it makes set, I think we'd want to specify version constraints using standard package manager constraints.
Using you example:
doing this would be very tedious if you supported all 1.x versions (which you should, that's the whole point of backwards compatibility on minor versions!). The original SEP only had major versions for this reason: they're the only ones you actually care about.
If we want to keep minor versions then probably you want something like https://gist.github.com/jonlabelle/706b28d50ba75bf81d40782aa3c84b3e - though not sure we need the whole complexity of that.
tulshi commentedon Nov 21, 2025
Hi @pja-ant, thanks for the feedback. I'll review your feedback in detail tomorrow, but just quickly, the server can fail the connection if the way the client has established the session is incompatible with a required extension.
tulshi commentedon Nov 22, 2025
Hey @pja-ant , I've taken a slightly different approach here, so that we don't replicate what is in the "capabilities" field again as a standalone "extensions" field. I've addressed both your comments above, and the negotiation related comment in the Versioning SEP.
pja-ant commentedon Nov 26, 2025
A problem with this is that it makes extension negotiation a multiple-round-trip process. In a stateless setup, the extensions the server sends back to the client has no value since they'll be forgotten by the next message. I know it isn't actually legal in the current spec to skip initialization... but many production servers do. There's a good chance we standardize this soon in some form (moving capabilities into every request).
The use case is valid though: the server may require something without the client requiring it.
I feel this comes down to a distinction between what extensions the client requests versus what the client supports. At the risk of overcomplicating things, it feels like there's a range of declarations here:
Then the same applies for servers: they may have extensions that they require/request/support.
It could get further complicated still: what if some extensions are only needed for certain tools? (Not that far-fetched: MCP Apps likely only apply to a subset of tools). This actually applies to capabilities as well, and it's something we haven't really solved: i.e. what happens if a tool call requires elicitations but the client doesn't support it? I guess you just fail the tool call, but it would have been nice to have disabled the tool entirely. This isn't captured in the protocol, but I guess servers are allowed to filter tools/list based on client capabilities (probably...).
I'm starting to lean back towards my initial position of just letting extensions define their own negotiation semantics, i.e. we provide this place in the protocol (
capabilities/extensions/...) for extensions to put any necessary negotiation metadata and then the extension itself defines what it means to do negotiation.A few examples of what this could look like on more realistic extensions:
oauth-client-credentials: this all happens outside of the MCP message flow, so the extension just defines how the auth flow works and any backwards compatibility requirements. There's no value in usingcapabilities/extensions/...at all.ext-apps: has negotiation language already and has more nuance about enabling different tools based on capabilities exposed in the extensions section.Looking at all this, I'm quite worried that the design of the negotiation isn't really fitting with what we're seeing from real upcoming extensions. Curious to hear your thoughts.
tulshi commentedon Dec 1, 2025
Hi @pja-ant ,
Here are a few thoughts:
ragsvasan commentedon Apr 21, 2026
localden commentedon Jun 24, 2026
@tulshi closing this as SEPs have since moved to pull requests. If this is still a relevant project to pursue, feel free to create a new SEP PR and build support in our contributor Discord.