Skip to content

schlpbch/ext-content-negotiation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Status: Draft Version: v0.9.7 Type: Extensions Track Extension ID: io.modelcontextprotocol/content-negotiation RFC 2295 Inspired License: Apache 2.0 Reference Implementations: 8 MCP Framework: SEP-2133

Overview

Not all MCP clients are the same, agents differ in what they need from the server and how they can consume it.

The content needed by a human consunmer (e.g., an end-user interface) may prioritize readability and conciseness, while an agent (e.g., a downstream tool or another model) may require structured data, detailed reasoning traces, or specific formats. Additionally, clients have varying capabilities — some can present interactive dialogs, others can process complex JSON, and some may only handle plain text.

Clients also have different context window sizes and latency requirements, which may necessitate varying levels of detail or verbosity in responses. For example, a client with a small context window may prefer concise summaries, while one with a larger window can handle more verbose explanations.

Especially locally running agents have limited compute resources and thus prefer more compact responses that minimize unnecessary information. E.g., an agent running an mobile device may want to avoid large reasoning traces that consume bandwidth and processing power.

To address these client requirements, this proposal introduces a content negotiation mechanism for MCP following SEP-2133: Extensions, allowing servers to adapt response formats based on client-declared capabilities. Inspired by RFC 2295, adapted for MCP's session-scoped architecture.

Real-World Use Cases

Use Case Problem Solution
Journey Service Agent needs structured data; human needs itinerary One tool, negotiated format
Geospatial/Mapping Rich descriptions vs. coordinates/boundaries GeoJSON for agents, markdown for humans
Multi-Agent Orchestration Different specialist agents, different capabilities Server adapts per agent's init capabilities
Weather/Environment Same data, different consumers Negotiated format eliminates duplication

Solution

Clients declare the extension during initialize:

{
  "capabilities": {
    "extensions": {
      "io.modelcontextprotocol/content-negotiation": {
        "version": "1.0",
        "features": ["agent", "sampling", "format=json", "verbosity=compact"]
      }
    }
  }
}

Servers advertise support with an empty object in their capabilities, then respond with content optimized for the declared features.

Impact on MCP ecosystem

This extension is fully backward compatible — clients and servers that do not implement it will continue to function as before. It is an optional feature that enhances flexibility without.

This extension also helps to significantly reduce bandwidth and latency as well as significantly reduce commpute requirements. All data not sent by server is bandwidth and compute saved on both sides. These also reduces electrical power consumption and thus have positive environmental impact.

Key Features

  • RFC 2295-Inspired: HTTP transparent content negotiation adapted to MCP
  • Session-Scoped: Negotiation happens once at initialization, not per-request
  • Capability-Driven: Feature tags mirror client's actual MCP capabilities
  • Flexible Predicates: Supports presence, negation, and equality syntax
  • Fully Backward Compatible: Zero breaking changes, optional feature
  • Secure: Feature tags control content shape only, never auth/access

Main Document

Full specification in ext-content-negotiation.md covering:

Feature Tags (v1.0 Registry)

Tag Meaning Server Impact
agent / human Client type Content format preference
mcp-capable Understands MCP protocols Can reference tool/resource names
interactive / !interactive Can present UI Gate elicitation-style prompts
sampling / elicitation / roots / tasks Declared MCP capabilities Include reasoning hints, allow requests
verbosity=compact|standard|verbose Response length Omit/expand explanations
format=json|text|markdown Output format Use structuredContent vs prose
x-* Vendor-specific Custom implementations

Quick Start

Server Side

const features =
  client.capabilities.extensions?.[
    'io.modelcontextprotocol/content-negotiation'
  ]?.features ?? [];

if (features.includes('agent') && features.includes('format=json')) {
  return { structuredContent: { temperature_c: 8, humidity_percent: 72 } };
} else {
  return { content: [{ type: 'text', text: "It's 8°C with 72% humidity." }] };
}

// Advertise support
const serverCapabilities = {
  extensions: { 'io.modelcontextprotocol/content-negotiation': {} },
};

Client Side

const capabilities = {
  sampling: {},
  extensions: {
    'io.modelcontextprotocol/content-negotiation': {
      version: '1.0',
      features: [
        'agent',
        'sampling',
        'mcp-capable',
        'format=json',
        'verbosity=compact',
      ],
    },
  },
};

Security

Feature tags optimize what the server sends, not whether it should send it.

Not for Use instead
Authentication Credentials
Authorization Access control lists
Trust decisions Signatures/verification
Rate limiting Auth tokens

How to Review

  1. Abstract (2 min) - Problem and solution
  2. Motivation (10 min) - Validate use cases
  3. Specification (15 min) - Ensure implementability
  4. Rationale (5 min) - Design decisions
  5. Security (5 min) - Risk mitigations
  6. Reference Implementation (10 min) - Validate feasibility

Contributing

  1. Review ext-content-negotiation.md
  2. Feedback via Issues or MCP Community Discussions
  3. Test reference implementations: TypeScript · Python/FastMCP · Java/Spring AI · Rust/rmcp · Go · C#/.NET · Kotlin · Swift
  4. Suggest improvements to feature tags, semantics, or design

Links

Status

Field Value
Extension ID io.modelcontextprotocol/content-negotiation
Status Draft
Type Extensions Track
Created February 22, 2026
Phase Community feedback and design refinement

Reference implementations: TYPESCRIPT_REFERENCE.md · FASTMCP_REFERENCE.md · SPRING_AI_REFERENCE.md · RUST_REFERENCE.md · GO_REFERENCE.md · CSHARP_REFERENCE.md · KOTLIN_REFERENCE.md · SWIFT_REFERENCE.md

Supporting analysis: RFC2295_ANALYSIS.md · MCP_ANALYSIS.md · MCP_PROPOSAL_GUIDE.md · SEP2053_COMPARISON.md

This proposal follows MCP's licensing model. For questions, open an issue or discussion.

About

Content Negotiation Extension for MCP.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors