Skip to content

SEP-2290: Content Negotiation Extension#2317

Open
schlpbch wants to merge 6 commits intomodelcontextprotocol:mainfrom
schlpbch:sep-2290-content-negotiation
Open

SEP-2290: Content Negotiation Extension#2317
schlpbch wants to merge 6 commits intomodelcontextprotocol:mainfrom
schlpbch:sep-2290-content-negotiation

Conversation

@schlpbch
Copy link
Copy Markdown

@schlpbch schlpbch commented Feb 27, 2026

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

Summary

This PR adds the SEP entry for SEP-2290: Content Negotiation Extension, an Extensions Track proposal that introduces transparent content negotiation for MCP.

Abstract

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

Clients also have different context window sizes or 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.

The content needed by a human consumer (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.

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 (e.g. on Gemini Nano) may want to avoid large reasoning traces that consume bandwidth and processing power.

Real-World Use Cases

Some examples:

  • Journey Service: Structured data for agents, readable narratives for humans
  • Geospatial/Mapping Service: GeoJSON coordinates for agents, readable descriptions for humans
  • Multi-Agent Orchestration: Different specialists have different capabilities

Key Design Principles

  1. Session-scoped: Negotiation happens once at initialization, not per-request
  2. Capability-driven: Feature tags mirror client's actual MCP capabilities
  3. RFC 2295-inspired: Borrows transparent negotiation concepts from HTTP
  4. Fully backward compatible: Zero breaking changes, optional feature
  5. Secure: Features are for content shape only, never for auth

Impact on MCP ecosystem

This extension also helps to significantly reduce bandwidth and latency as well as significantly reduce compute 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.

Full Specification

The complete specification is maintained at:
https://github.com/schlpbch/ext-content-negotiation (v0.9.4)

Includes: feature tag registry, protocol examples, RFC 2295 mapping, security analysis, TypeScript reference implementation, and comparison with SEP-2053 Server Variants.

Reference Implementation

A FastMCP (Python) reference implementation is available at:
https://github.com/schlpbch/ext-content-negotiation/blob/master/FASTMCP_REFERENCE.md

Demonstrates ContentNegotiationMiddleware, a Features dataclass with typed convenience properties, and a get_features(ctx) helper for tool handlers — all built on FastMCP v3's middleware and session-state APIs.

Current Status

Draft specification complete with:

  • Detailed specification (14 standard feature tags, predicate syntax)
  • 3 initialize scenarios (agent, human, legacy)
  • 8+ tool response examples
  • RFC 2295 mapping table
  • Security analysis (5 risks + mitigations)
  • Full backward compatibility analysis
  • Implementation guidelines: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, Go / go-sdk, C# / .NET, Kotlin / kotlin-sdk, Swift / swift-sdk

Checklist

  • SEP file added at seps/2290-content-negotiation-extension.md
  • Status: Draft
  • Full specification linked
  • Authors identified
  • Reference implementation available (FastMCP/Python)

Adds the SEP entry for the Content Negotiation Extension
(io.modelcontextprotocol/content-negotiation), linking to the full
specification at https://github.com/schlpbch/ext-content-negotiation.

Closes modelcontextprotocol#2290
schlpbch added a commit to schlpbch/ext-content-negotiation that referenced this pull request Feb 27, 2026
Link to modelcontextprotocol/modelcontextprotocol#2317

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
schlpbch added a commit to schlpbch/ext-content-negotiation that referenced this pull request Feb 27, 2026
- Add PR link to spec header (modelcontextprotocol/modelcontextprotocol#2317)
- Bump version to v0.9.4 in spec and README badge
- Add v0.9.4 release notes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Run Prettier on SEP source file
- Run generate:seps to produce .mdx and update docs.json
@schlpbch schlpbch requested a review from a team as a code owner February 27, 2026 14:58
Email addresses in <addr> format are parsed as JSX tags in MDX.
Use parentheses instead.
@schlpbch
Copy link
Copy Markdown
Author

v0.9.5 — Java / Spring AI 2.0 Reference Implementation

A new reference implementation has been added for the Java ecosystem:

  • SPRING_AI_REFERENCE.md — Spring AI 2.0, using McpSyncServerExchange injection, a Features record, and a ContentNegotiation.getFeatures() static helper

The repo now has worked examples for three ecosystems: TypeScript / MCP SDK, Python / FastMCP, and Java / Spring AI 2.0.

Release: https://github.com/schlpbch/ext-content-negotiation/releases/tag/v0.9.5

@schlpbch
Copy link
Copy Markdown
Author

v0.9.6 — Go Reference Implementation

A new reference implementation has been added for the Go ecosystem:

  • GO_REFERENCE.md — official MCP Go SDK (go-sdk), using GetFeatures(*mcp.CallToolRequest), a Features struct with value receivers, and a complete weather tool example

The repo now has worked examples for five ecosystems: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, and Go / go-sdk.

Release: https://github.com/schlpbch/ext-content-negotiation/releases/tag/v0.9.6

@schlpbch
Copy link
Copy Markdown
Author

v0.9.6 — Go and C# / .NET Reference Implementations

Two new reference implementations have been added:

  • GO_REFERENCE.md — official MCP Go SDK (go-sdk), using GetFeatures(*mcp.CallToolRequest) and a Features struct with value receivers
  • CSHARP_REFERENCE.md — official MCP .NET SDK (ModelContextProtocol v1.0), using a Features record, ContentNegotiation.ParseFeatures(), and a ContentNegotiationState singleton for DI-based session capability access

The repo now has worked examples for six ecosystems: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, Go / go-sdk, and C# / .NET.

Release: https://github.com/schlpbch/ext-content-negotiation/releases/tag/v0.9.6

@schlpbch
Copy link
Copy Markdown
Author

v0.9.6 (updated) — Kotlin Reference Implementation added

KOTLIN_REFERENCE.md has been added to v0.9.6 — official MCP Kotlin SDK (kotlin-sdk), using a Features data class, getFeatures(ClientCapabilities?) with kotlinx.serialization JsonObject traversal, and a full weather tool example using the addTool DSL.

The repo now has worked examples for seven ecosystems: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, Go / go-sdk, C# / .NET, and Kotlin / kotlin-sdk.

Release: https://github.com/schlpbch/ext-content-negotiation/releases/tag/v0.9.6

@schlpbch
Copy link
Copy Markdown
Author

v0.9.6 (updated) — Swift Reference Implementation added

SWIFT_REFERENCE.md has been added to v0.9.6 — official MCP Swift SDK (swift-sdk), using a Features struct, parseFeatures(from:) with Value enum pattern matching, and a ContentNegotiationState actor populated via initializeHook for safe concurrent capability access.

The repo now has worked examples for eight ecosystems: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, Go / go-sdk, C# / .NET, Kotlin / kotlin-sdk, and Swift / swift-sdk.

Release: https://github.com/schlpbch/ext-content-negotiation/releases/tag/v0.9.6

@schlpbch
Copy link
Copy Markdown
Author

PR description updated

The PR description has been updated to reflect the current state of the proposal:

  • Version: v0.9.6
  • Reference implementations table now lists all eight ecosystems: TypeScript / MCP SDK, Python / FastMCP, Java / Spring AI 2.0, Rust / rmcp, Go / go-sdk, C# / .NET, Kotlin / kotlin-sdk, Swift / swift-sdk
  • Checklist updated accordingly

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

Labels

extension proposal SEP proposal without a sponsor. SEP

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants