Skip to content

Feature Request: Model-Aware Content Adaptation for MCP #469

Closed

Description

@sambhav

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:

  1. Specification of preferred model families in client requests (similar to Accept-Language headers)
  2. Server-side adaptation of prompts, tool descriptions, and parameters based on the requested model family
  3. String substitution patterns that can be extracted and updated systematically (similar to i18n localization files)
  4. 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

  1. Client-side adaptations: Requiring clients to handle all model-specific adaptations before sending requests, which increases client complexity and reduces portability.
  2. 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.
  3. 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

  1. olaservo commented on May 6, 2025

    @olaservo
    Member

    Linking to a similar discussion post that was mainly focused on adapting prompts for specific models: https://github.com/orgs/modelcontextprotocol/discussions/180

  2. OR13 commented on May 6, 2025

    @OR13

    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/json has no media type parameters: https://www.iana.org/assignments/media-types/application/json

    If 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.

    application/mcp-response+json; your params could go here.
    

    In general, you should avoid media type parameters, whenever possible.

  3. connor4312 commented on May 7, 2025

    @connor4312
    Contributor

    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.

  4. lirc571 commented on May 8, 2025

    @lirc571

    I would like to have this feature as well!

    can be specified via the Accept header in JSON-RPC requests

    If I understand correctly, HTTP headers are not used for stdio transport?


    Perhaps we could merge this with i18n by having a general options field for capabilities such as prompts, resources, tools, completion, logging, sampling, where we declare the supported options and values in the capability declaration messages, and add an options field 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 locale and model/model-family.

  5. cliffhall commented on Jun 27, 2025

    @cliffhall
    Member

    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 Accept header. Or that it should piggyback on the completely unrelated i8n work. Feels wrong.

    • With the Accept header, you're specifying acceptable response formats, which you can parse and return an error if the wrong format was received.
    • With the Accept-Language header, 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.
    • Model hints are only a suggestion, and you have no way of determining if the response was generated by your desired model.
  6. sambhav commented on Jan 6, 2026

    @sambhav
    MemberAuthor

    Finally got the time to open a SEP regarding this which also includes some newer patterns - #2053

  7. dend commented on Mar 4, 2026

    @dend
    Contributor

    Closing this item as there is now an associated SEP PR. Thank you @sambhav!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions