Title: SSE does not work on nested routes · Issue #733 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: SSE does not work on nested routes · Issue #733 · modelcontextprotocol/python-sdk
X Title: SSE does not work on nested routes · Issue #733 · modelcontextprotocol/python-sdk
Description: Describe the bug URL parts are being omitted on SSE client session connect. INFO:mcp.client.sse:Connecting to SSE endpoint: https://url-part1.url-part2.com/route1/route2/sse INFO:httpx:HTTP Request: GET https://url-part1.url-part2.com/ro...
Open Graph Description: Describe the bug URL parts are being omitted on SSE client session connect. INFO:mcp.client.sse:Connecting to SSE endpoint: https://url-part1.url-part2.com/route1/route2/sse INFO:httpx:HTTP Request...
X Description: Describe the bug URL parts are being omitted on SSE client session connect. INFO:mcp.client.sse:Connecting to SSE endpoint: https://url-part1.url-part2.com/route1/route2/sse INFO:httpx:HTTP Request...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/733
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSE does not work on nested routes","articleBody":"**Describe the bug**\nURL parts are being omitted on SSE client session connect.\n\nINFO:mcp.client.sse:Connecting to SSE endpoint: https://url-part1.url-part2.com/route1/route2/sse\nINFO:httpx:HTTP Request: GET https://url-part1.url-part2.com/route1/route2/sse \"HTTP/1.1 200 OK\"\nINFO:mcp.client.sse:Received endpoint URL: https://url-part1.url-part2.com/route2/messages/?session_id=a2bd62740b69466c8b27043ccda2513f\nINFO:mcp.client.sse:Starting post writer with endpoint URL: https://url-part1.url-part2.com/route2/messages/?session_id=a2bd62740b69466c8b27043ccda2513f\n\n**To Reproduce**\n```\nimport asyncio\nimport logging\nfrom fastmcp import Client\nfrom fastmcp.client.transports import (\n SSETransport\n)\n\n\nsse_url = \"https://url-part1.url-part2.com/route1/route2/sse\"\nasync def main():\n # Connect to a server over SSE (common for web-based MCP servers)\n async with Client(SSETransport(url=sse_url)) as client:\n # Send a message to the server\n result = await client.list_tools()\n print(result)\n\n\nif __name__ == \"__main__\":\n logging.basicConfig(level=logging.INFO)\n asyncio.run(main())\n```\n**Expected behavior**\nroute1 is not omitted\n\n**Desktop (please complete the following information):**\n - OS: Ubuntu\n - Version 1.9.0\n\n**Additional context**\nissue stems from:\n.venv/lib/python3.12/site-packages/mcp/client/sse.py line 66\n","author":{"url":"https://github.com/kocsszi","@type":"Person","name":"kocsszi"},"datePublished":"2025-05-16T10:42:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/733/python-sdk/issues/733"}
| 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:9b7e9b23-3c2e-fffe-9493-90adad2447bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD00:187E80:156A69:1CE222:6A62C4F9 |
| html-safe-nonce | d0329ac1606888c92579f279e8efd5104c21b47d8fa44798e1cfdf4894006e1e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDAwOjE4N0U4MDoxNTZBNjk6MUNFMjIyOjZBNjJDNEY5IiwidmlzaXRvcl9pZCI6Ijc0OTE3OTI4ODg3Nzc1OTAwMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f4d5a73687782d8f8089f03f49a3a2818a9f4738f24fd19f32d8677b2181217 |
| hovercard-subject-tag | issue:3068644221 |
| 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/733/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04a8c026cb813ad6fb8f4d3a031ed4c68c3c2ba83a5d8666f525f0d373ef117e/modelcontextprotocol/python-sdk/issues/733 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04a8c026cb813ad6fb8f4d3a031ed4c68c3c2ba83a5d8666f525f0d373ef117e/modelcontextprotocol/python-sdk/issues/733 |
| og:image:alt | Describe the bug URL parts are being omitted on SSE client session connect. INFO:mcp.client.sse:Connecting to SSE endpoint: https://url-part1.url-part2.com/route1/route2/sse INFO:httpx:HTTP Request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kocsszi |
| hostname | github.com |
| expected-hostname | github.com |
| None | df33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd |
| 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 | d41cd1bdb290013455c0ac430fa755621733f5eb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width