Title: ClientSession.initialize gets stuck if the MCP server process exits · Issue #428 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: ClientSession.initialize gets stuck if the MCP server process exits · Issue #428 · modelcontextprotocol/python-sdk
X Title: ClientSession.initialize gets stuck if the MCP server process exits · Issue #428 · modelcontextprotocol/python-sdk
Description: Describe the bug I'm using the brave_search MCP server which exits(1) if BRAVE_API_KEY is not set. https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search/index.ts#L85 This causes ClientSession.initialize to get stuck ...
Open Graph Description: Describe the bug I'm using the brave_search MCP server which exits(1) if BRAVE_API_KEY is not set. https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search/index.ts#L85 This cause...
X Description: Describe the bug I'm using the brave_search MCP server which exits(1) if BRAVE_API_KEY is not set. https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search/index.ts#L85 This c...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/428
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ClientSession.initialize gets stuck if the MCP server process exits","articleBody":"**Describe the bug**\n\nI'm using the [brave_search](https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search) MCP server which exits(1) if BRAVE_API_KEY is not set. https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search/index.ts#L85\n\nThis causes ClientSession.initialize to get stuck forever.\n\n**To Reproduce**\n\nSteps to reproduce the behavior:\n\nUse brave_search without setting BRAVE_API_KEY.\n\n**Expected behavior**\n\nWhen the process of an stdio_client exits an exception should be raised. \n\n**Screenshots**\n\nFrom this client implementation https://github.com/evilsocket/nerve/blob/main/nerve/tools/mcp/client.py\n\n\n","author":{"url":"https://github.com/evilsocket","@type":"Person","name":"evilsocket"},"datePublished":"2025-04-04T13:01:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/428/python-sdk/issues/428"}
| 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:6c2b616a-cffe-adfc-f383-5af41a111ca2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA66:1FAD2A:74D933:990840:6A5C0CF0 |
| html-safe-nonce | 2f9a0474fd160f90e3eb9f8b7478cdda2cc4721d95f7aaf6a112d012500a90a8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTY2OjFGQUQyQTo3NEQ5MzM6OTkwODQwOjZBNUMwQ0YwIiwidmlzaXRvcl9pZCI6IjcwMzI2NTM1ODc2ODUzMTM3NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5042ba6e6bd3b158085864be72a5fdb4e0dd596e837f46b34db4265d99828a1b |
| hovercard-subject-tag | issue:2972323177 |
| 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/428/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15e7e4d93c8e8f63461ebce695bf3edff77909ed2b7f6dc74f63d88efeb173ff/modelcontextprotocol/python-sdk/issues/428 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15e7e4d93c8e8f63461ebce695bf3edff77909ed2b7f6dc74f63d88efeb173ff/modelcontextprotocol/python-sdk/issues/428 |
| og:image:alt | Describe the bug I'm using the brave_search MCP server which exits(1) if BRAVE_API_KEY is not set. https://github.com/modelcontextprotocol/servers/blob/main/src/brave-search/index.ts#L85 This cause... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | evilsocket |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width