René's URL Explorer Experiment


Title: Streamable HTTP transport rejects Accept: text/event-stream without application/json · Issue #2349 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Streamable HTTP transport rejects Accept: text/event-stream without application/json · Issue #2349 · modelcontextprotocol/python-sdk

X Title: Streamable HTTP transport rejects Accept: text/event-stream without application/json · Issue #2349 · modelcontextprotocol/python-sdk

Description: Problem The StreamableHTTPTransport server validates the Accept header with a strict AND condition, requiring clients to send both application/json and text/event-stream: # mcp/server/streamable_http.py, _validate_accept_header() elif no...

Open Graph Description: Problem The StreamableHTTPTransport server validates the Accept header with a strict AND condition, requiring clients to send both application/json and text/event-stream: # mcp/server/streamable_ht...

X Description: Problem The StreamableHTTPTransport server validates the Accept header with a strict AND condition, requiring clients to send both application/json and text/event-stream: # mcp/server/streamable_ht...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/2349

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Streamable HTTP transport rejects Accept: text/event-stream without application/json","articleBody":"## Problem\n\nThe `StreamableHTTPTransport` server validates the `Accept` header with a strict AND condition, requiring clients to send **both** `application/json` and `text/event-stream`:\n\n```python\n# mcp/server/streamable_http.py, _validate_accept_header()\nelif not (has_json and has_sse):\n    response = self._create_error_response(\n        \"Not Acceptable: Client must accept both application/json and text/event-stream\",\n        HTTPStatus.NOT_ACCEPTABLE,\n    )\n```\n\nThis rejects clients that send only `Accept: text/event-stream`, returning a `406 Not Acceptable`.\n\n## Impact\n\nThis breaks compatibility with **Anthropic's MCP proxy** (used by Claude.ai for remote MCP integrations). The Anthropic proxy sends requests with `Accept: text/event-stream` to the `/mcp` endpoint and expects SSE responses. The strict AND validation rejects these requests.\n\nWhen `json_response=False` (the spec-compliant default for SSE-capable servers), the server should be able to handle clients that accept SSE responses even if they don't explicitly accept JSON.\n\n## Expected behavior\n\nThe server should accept requests with either `Accept: application/json` or `Accept: text/event-stream` (or both). The response format should match what the client accepts:\n- `Accept: text/event-stream` → respond with SSE\n- `Accept: application/json` → respond with JSON\n- `Accept: application/json, text/event-stream` → respond with SSE (current spec behavior)\n\n## Suggested fix\n\nChange the AND to OR in `_validate_accept_header()`:\n\n```python\n# Before\nelif not (has_json and has_sse):\n\n# After\nelif not (has_json or has_sse):\n```\n\nThis allows the server to accept clients that support at least one of the two content types, while still being able to negotiate the response format based on what the client accepts.\n\n## Reproduction\n\n```bash\n# Start any MCP server with StreamableHTTP transport (json_response=False)\n\n# This works (both Accept types):\ncurl -X POST http://localhost:8080/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}},\"id\":1}'\n# → 200 OK\n\n# This fails (SSE only):\ncurl -X POST http://localhost:8080/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: text/event-stream\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}},\"id\":1}'\n# → 406 Not Acceptable\n```\n\n## Environment\n\n- MCP SDK version: 1.25.0\n- Discovered while using mcp-proxy v0.11.0 with Claude.ai remote MCP integration","author":{"url":"https://github.com/juliendoclot","@type":"Person","name":"juliendoclot"},"datePublished":"2026-03-25T19:21:44Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/2349"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:452bb934-e7b5-d509-8864-7f4c39af4866
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA952:6B887:179589:1F233C:6B00BC81
html-safe-nonceadbdd549474c85e13b511dc70e481b4006009f696a30ce3e6ae513447ebecbea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTUyOjZCODg3OjE3OTU4OToxRjIzM0M6NkIwMEJDODEiLCJ2aXNpdG9yX2lkIjoiNTAwNDc0MzkwMzY4NTk1MDU5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbaac691cf2d619dbaa823a7277ea06fd5fe83855884b08c7cb86c417cbf9fcf2
hovercard-subject-tagissue:4137918277
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/2349/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8be139910e2b611ea451626de8f100acdc6fd02e8fe089768fad0c9adf179239/modelcontextprotocol/python-sdk/issues/2349
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8be139910e2b611ea451626de8f100acdc6fd02e8fe089768fad0c9adf179239/modelcontextprotocol/python-sdk/issues/2349
og:image:altProblem The StreamableHTTPTransport server validates the Accept header with a strict AND condition, requiring clients to send both application/json and text/event-stream: # mcp/server/streamable_ht...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejuliendoclot
hostnamegithub.com
expected-hostnamegithub.com
None1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5429cbfc6aca8c7b9a086a3c8f47400346f38cc9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/2349#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F2349
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F2349
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2349
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2349
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2349
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2349
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2349
Streamable HTTP transport rejects Accept: text/event-stream without application/jsonhttps://github.com/modelcontextprotocol/python-sdk/issues/2349#top
https://github.com/juliendoclot
juliendoclothttps://github.com/juliendoclot
on Mar 25, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2349#issue-4137918277
https://github.com/4444J99
4444J99https://github.com/4444J99
on Mar 27, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2349#issuecomment-4144422338
4444J99https://github.com/4444J99
on Mar 27, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2349#event-23981598125
fix: accept single supported content type in SSE mode Accept header v…https://github.com/4444J99/python-sdk/commit/546b25be88811e6c7c240345d18cb4ce5ce0eb13
https://docs.github.com/articles/closing-issues-via-commit-messages
546b25bhttps://github.com/4444J99/python-sdk/commit/546b25be88811e6c7c240345d18cb4ce5ce0eb13
https://github.com/maxisbey
maxisbeyhttps://github.com/maxisbey
on Aug 10, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2349#issuecomment-5243204238
AI Disclaimerhttps://gist.github.com/maxisbey/6123d132484e4c533eab519a2800693d
maxisbeyhttps://github.com/maxisbey
not plannedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Aug 10, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2349#event-29235207316
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2349
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2349
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.