Skip to content

ClientSession.initialize gets stuck if the MCP server process exits #428

Closed as duplicate of#332
@evilsocket

Description

@evilsocket

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 forever.

To Reproduce

Steps to reproduce the behavior:

Use brave_search without setting BRAVE_API_KEY.

Expected behavior

When the process of an stdio_client exits an exception should be raised.

Screenshots

From this client implementation https://github.com/evilsocket/nerve/blob/main/nerve/tools/mcp/client.py

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions