Skip to content

[BUG] session.initialize() hangs indefinitely with stdio_client setup #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Elijas opened this issue Apr 20, 2025 · 0 comments
Closed

Comments

@Elijas
Copy link

Elijas commented Apr 20, 2025

Describe the bug
await session.initialize() runs forever (stopped it after >10 minutes)

For some reason all the other clients also run forever

To Reproduce

import asyncio
from mcp import ClientSession, StdioServerParameters, types
from mcp.client.stdio import stdio_client

# Create server parameters for stdio connection
server_params = StdioServerParameters(
    command="uvx",
    args=["mcp-timeserver"],
    env=None,
)


async def run():
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            # Initialize the connection
            await session.initialize()
            tools = await session.list_tools()
            print(tools)



if __name__ == "__main__":
    asyncio.run(run())

Expected behavior
Not get stuck

Additional context
Running from jupyter notebook opened in VSCode ipykernel==6.29.5 mcp==1.6.0 python=3.13 apple silicon

Other people have it too

@Elijas Elijas closed this as completed Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant