Skip to content
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

Client hangs when ctx.info() logging with pure Python client #201

Open
sheffler opened this issue Feb 10, 2025 · 0 comments
Open

Client hangs when ctx.info() logging with pure Python client #201

sheffler opened this issue Feb 10, 2025 · 0 comments

Comments

@sheffler
Copy link
Contributor

Describe the bug
When a tool includes client-side logging with, the client seems to hang.
The following tool works ok with Claude Desktop and Inspector, but does not complete with a Python client.

@mcp.tool()
async def simple_tool_with_logging(x:float, y:float, ctx:Context) -> str:
    await ctx.info(f"Processing Simple Tool")
    logger.debug("IN SIMPLE_TOOL")
    await ctx.report_progress(1, 2)
    return x*y

To Reproduce
Will check in a PR with test and proposed fix.

Expected behavior
I would expect the tool to run to completion.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: OSX
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

sheffler added a commit to sheffler/mcp-python-sdk that referenced this issue Feb 10, 2025
.

File mcp_stdio_client.py is adapted from the example in simple-chatbot.
@sheffler sheffler mentioned this issue Feb 10, 2025
6 tasks
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