Skip to content

Why does MCP sse client do not have heartbeat detection #2795

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
Ltyro opened this issue Apr 18, 2025 · 3 comments
Open

Why does MCP sse client do not have heartbeat detection #2795

Ltyro opened this issue Apr 18, 2025 · 3 comments

Comments

@Ltyro
Copy link

Ltyro commented Apr 18, 2025

Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.

Expected Behavior

After the MCP SSE server restarts, the client can automatically connect without restarting

Current Behavior

After the MCP SSE server restarts, the client will not automatically connect

Context

In MCP SSE mode, the client must rely on the MCP server to start, otherwise it cannot start. I don't think it's reasonable. The server has been restarted, so all clients need to be restarted? Why not use heartbeat detection. The MCP native SDK may not have a heartbeat mechanism, but I think Spring AI can have it.

@1435646097
Copy link

Yes, I think so too

@andresssantos
Copy link

I'm facing the same situation, where I have to restart my client every time something changes in the mcp server. I wonder if there's something to avoid that.

@Ltyro
Copy link
Author

Ltyro commented Apr 20, 2025

I tried to rewrite the client auto configuration the day before tomorrow, but I haven't finished writing it yet. The idea is to connect by heartbeat monitoring. If client.ping() goes through, then execute initialization method. If the server is disconnected, create a loop to ping, and create a client until the ping is connected. However, I haven't continued to write because I've been on vacation recently. If you are interested, you can try it.

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

3 participants