Skip to content

MCP Servers Not Detected on Initial Runs of main.py; Tools Recognized Only After Multiple Restarts #1679

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

Open
mrzz222 opened this issue May 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mrzz222
Copy link

mrzz222 commented May 6, 2025

Describe the bug
When running main.py, the MCP client frequently fails to detect and connect to available MCP servers on the first few attempts. The tool discovery and response handling only begin working correctly after restarting the script 3–4 times. This seems to indicate a race condition or delay in server registration or discovery.

To Reproduce
Steps to reproduce the behavior:

Start the MCP servers.

Immediately run main.py.

Observe that no tools are identified or invoked.

Stop main.py and restart it.

Repeat 3–4 times until it begins identifying tools and responding as expected.

Expected behavior
The MCP client should detect available MCP servers and tools correctly on the first run of main.py, assuming the servers are already running.

IM GETTING RESPONSE FROM LLM IT CANT IDENTIFY TOOLS THAT ARE UN SERVER JSON FILE BUT AFTER SOME RETRIES LIKE JUST RUNNING AND EXITING MAIN.PY RANDOMLY THE SERVERS ARE IDENTIFIED AND IT WORKS PROPERLY

@mrzz222 mrzz222 added the bug Something isn't working label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant