Title: Missing OPTIONS handler for Streamable HTTP · Issue #1079 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Missing OPTIONS handler for Streamable HTTP · Issue #1079 · modelcontextprotocol/python-sdk
X Title: Missing OPTIONS handler for Streamable HTTP · Issue #1079 · modelcontextprotocol/python-sdk
Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description For a streamable HTTP ...
Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/1079
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing OPTIONS handler for Streamable HTTP","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nFor a streamable HTTP connection, there's currently not a OPTIONS handler so it falls under `405 Method Not Allowed`. My use case was to use a frontend mcp client, so this breaks that scenario since we can't make any requests from the frontend because the missing preflight request causes CORS issues on the frontend.\n\nCould we directly add one to `StreamableHTTPServerTransport.handle_request` ?\n\nIt could be something like this:\n```py\nasync def _handle_options_request(self, request: Request, send: Send) -\u003e None:\n \"\"\"Handle OPTIONS requests for CORS preflight.\"\"\"\n\n headers = {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"GET, POST, DELETE, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type, Authorization\",\n }\n\n response = Response(\n content=None,\n status_code=HTTPStatus.NO_CONTENT,\n headers=headers,\n )\n await response(request.scope, request.receive, send)\n```\n\n\n\n### Example Code\n\n```Python\n\n```\n\n### Python \u0026 MCP Python SDK\n\n```Text\n1.10.1\n```","author":{"url":"https://github.com/fcmsilva","@type":"Person","name":"fcmsilva"},"datePublished":"2025-07-03T12:32:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1079/python-sdk/issues/1079"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8f6cbd5f-ce26-8fb7-75da-e5e3ef45081e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D26:C0EF7:5A8851:7B640C:6A61206F |
| html-safe-nonce | 675cd32b8ce2161377b58039ad7332d5e787875e739df26de542da2cd6197970 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDI2OkMwRUY3OjVBODg1MTo3QjY0MEM6NkE2MTIwNkYiLCJ2aXNpdG9yX2lkIjoiMzk0MDY3OTM4NDAyMjcyMDYyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f41c50fbb2976482d6fefa1912e497ed6dda1fa4cae2251bb6fda887c873899d |
| hovercard-subject-tag | issue:3199229056 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/1079/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e53553ca51f1f48ab0de6820b6ee92dec4a5b29dad5d9ade34c4a5365d7d5fee/modelcontextprotocol/python-sdk/issues/1079 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e53553ca51f1f48ab0de6820b6ee92dec4a5b29dad5d9ade34c4a5365d7d5fee/modelcontextprotocol/python-sdk/issues/1079 |
| og:image:alt | Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fcmsilva |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d9987c85f924dc5597480f737e023a6e985b0316e672f00513eb4ba440d87ba |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d38dc1dac7b5a5d0788e068e080820de6de90a28 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width