Repository navigation
Description
Feature Request: Model Family Adaptations for MCP
Is your feature request related to a problem? Please describe.
The Model Context Protocol (MCP) currently lacks a mechanism to adapt prompts, tool descriptions, and parameters based on the specific model family being used. As noted in issue #86, there's an opportunity to implement internationalization (i18n) support, but this could be extended to include model-specific adaptations as well. This creates inefficiencies when different models require different prompt formats or have varying capabilities, forcing developers to maintain separate implementations or complex conditional logic outside the protocol.
Describe the solution you'd like
Extend the Model Context Protocol to include a model family adaptation mechanism that works similarly to the proposed i18n support in PR #115. This would allow:
- Specification of preferred model families in client requests (similar to Accept-Language headers)
- Server-side adaptation of prompts, tool descriptions, and parameters based on the requested model family
- String substitution patterns that can be extracted and updated systematically (similar to i18n localization files)
- The ability to provide "model hints" that suggest optimal formats for specific model architectures
The implementation would build upon the proposed locale support in issue #86, extending it to include model family preferences that can be specified via the Accept header in JSON-RPC requests. For example, a client could specify Accept: application/json; model=anthropic-claude-3 to indicate their preferred model family.
Describe alternatives you've considered
- Client-side adaptations: Requiring clients to handle all model-specific adaptations before sending requests, which increases client complexity and reduces portability.
- Server-side model detection: Automatically detecting model capabilities and adapting on the server side without explicit hints, which would be less precise and harder to customize.
- Static model configuration files: Using separate configuration files for each model family, which would be less flexible than a dynamic approach integrated into the protocol.
Additional context
This feature would build upon the internationalization work proposed in issue #86 and PR #115, but extend it to cover model-specific adaptations. Just as i18n allows for language localization, this feature would allow for "model localization" where prompts and tools can be optimized for specific model families.
The system could support:
- Model family preferences with fallbacks (e.g.,
anthropic-claude-3,openai-gpt-4;q=0.9) - Template variations based on model family (similar to how i18n templates work)
- Automatic adaptation of tool schemas, prompt formats, and parameter descriptions
This would significantly improve interoperability between different models and simplify the development of applications that need to work with multiple model providers or adapt as models evolve.
Activity
olaservo commentedon May 6, 2025
Linking to a similar discussion post that was mainly focused on adapting prompts for specific models: https://github.com/orgs/modelcontextprotocol/discussions/180
OR13 commentedon May 6, 2025
Now that streamable http exists, perhaps consider:
https://www.rfc-editor.org/rfc/rfc9110#section-12.5.4
Please do not add media type parameters that are not registered with the base media type.
application/jsonhas no media type parameters: https://www.iana.org/assignments/media-types/application/jsonIf you want to register media types for JSON based MCP request / response, I'm not sure that model information should be a parameter for such media types... but you can certainly define media type parameters in your registration request.
In general, you should avoid media type parameters, whenever possible.
connor4312 commentedon May 7, 2025
I would like this feature, it's something that I've heard some requests for in the past. Tailoring content to language models is a massive pain but I support giving MCP's the option to do that if they want :)
One thing I'm unsure about is the longevity of the model context. For VS Code, we support changing the language model mid-session, and are actually exploring a few cases where we would change the LM automatically between agentic turns for various reasons. I think the request header is not necessarily sufficient for this if an MCP wants to tailor tools or tool descriptions for the model, we'd ideally need some way to announce the LM change and let the MCP announce the tools changed, as appropriate.
One option I see is including the header in a 'ping' request, but this is very subtle and not ideal: we would need wait an indeterminate amount of time for an (ultimately rare) tool list change event.
lirc571 commentedon May 8, 2025
I would like to have this feature as well!
If I understand correctly, HTTP headers are not used for stdio transport?
Perhaps we could merge this with i18n by having a general
optionsfield for capabilities such asprompts,resources,tools,completion,logging,sampling, where we declare the supported options and values in the capability declaration messages, and add anoptionsfield to the capabilities' request messages where the requester specifies the selected values of these options, and the response will be adapted based on the provided options.E.g. for tools we can have:
Server capabilities:
{ "capabilities": { "tools": { "listChanged": true, "options": { "locale": { "values": ["en", "fr"], "default": "en" }, "model": { "values": ["claude-3-7-sonnet", "gpt-4o-mini"], "default": "claude-3-7-sonnet" } } } } }Or alternatively:
{ "capabilities": { "tools": { "listChanged": true, "options": { "list": { "locale": { "values": ["en", "fr"], "default": "en" }, "model": { "values": ["claude-3-7-sonnet", "gpt-4o-mini"], "default": "claude-3-7-sonnet" } }, "call": { "locale": { "values": ["en", "fr"], "default": "en" }, "model": { "values": ["claude-3-7-sonnet", "gpt-4o-mini"], "default": "claude-3-7-sonnet" } } } } } }Listing Tools
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list", "options": { "locale": "fr", "model": "gpt-4o-mini" }, "params": { "cursor": "optional-cursor-value" } }Calling Tools
Request:
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "options": { "locale": "fr", "model": "gpt-4o-mini" }, "params": { "name": "get_weather", "arguments": { "location": "New York" } } }This way we can also more easily add new options other than
localeandmodel/model-family.dhodun commentedon May 9, 2025
There is some semblance of this (and need for) in sampling: https://modelcontextprotocol.io/docs/concepts/sampling#model-preferences
cliffhall commentedon Jun 27, 2025
We have model hints in the sampling section of the spec. Expanding that approach to other corners of the spec where it would be useful seems right. But I don't think they should go into the
Acceptheader. Or that it should piggyback on the completely unrelated i8n work. Feels wrong.Acceptheader, you're specifying acceptable response formats, which you can parse and return an error if the wrong format was received.Accept-Languageheader, you're specifying what languages are acceptable in the response, and you can similarly detect invalid response languages with a library and return an error if the response contains an unacceptable language.sambhav commentedon Jan 6, 2026
Finally got the time to open a SEP regarding this which also includes some newer patterns - #2053
dend commentedon Mar 4, 2026
Closing this item as there is now an associated SEP PR. Thank you @sambhav!