You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP Server won't work with wildcard in "Accept" header and therefore is non‑compliant with HTTP spec #1641
My client sends a request to MCP Server with Accept header */* (Same for application/*, text/event-stream). Server rejects this request because it expected strictly application/json or application/json and text/event-stream if json_response=False.
Expected
According to the HTTP/1.1 spec (RFC 7231, section 5.3.2), the Accept header allows wildcard so values */* and application/* should be valid, therefore server should accept them
from mcp.server.fastmcp import FastMCP
from starlette.applications import Starlette
...
mcp_server: FastMCP = FastMCP(streamable_http_path="/", stateless_http=True, json_response=True)
...
app: Starlette = mcp_server.streamable_http_app()
Activity
int0x03 commentedon Dec 3, 2025
here is the code for the client
Acceptheader: https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py#L385-L391fix: Add middleware to handle missing Accept header from Claude Code
Fix 406 Not Acceptable error for ChatGPT MCP client
fix: accept wildcard media types in Accept header per RFC 7231
fix: accept wildcard media types in Accept header per RFC 7231
fix: accept wildcard media types in Accept header per RFC 7231
shivama205 commentedon Mar 8, 2026
Submitted a fix for this in #2152 — adds wildcard media type support per RFC 7231. CI is green and review feedback has been addressed.
Fix 406 Not Acceptable error for ChatGPT MCP client