[PR #180] [CLOSED] fix(server_type): SSE server does not reconnect if session lost #188

Closed
opened 2026-02-15 21:15:15 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/mcpo/pull/180
Author: @edelauna
Created: 6/19/2025
Status: Closed

Base: devHead: main


📝 Commits (1)

  • 9cdeeb9 fix(server_type): SSE server does not reconnect if session lost

📊 Changes

3 files changed (+85 additions, -11 deletions)

View changed files

📝 src/mcpo/main.py (+16 -11)
src/mcpo/tests/test_sse.py (+34 -0)
src/mcpo/utils/sse.py (+35 -0)

📄 Description

Changelog Entry

[0.0.16] - 2025-06-19

Fixed

  • 🔄 SSE Server Reconnection: Fixed an issue where the SSE server would not reconnect if the session was lost. This improves the stability and reliability of SSE-based MCP connections.

Description

  • Currently if you start an SSE server and the SSE sessions is lost, mcpo does not try to re-establish the connection, resulting in any subsequent calls to fail due to asnycio.ClosedResourceError.
  • The reader from sse_client is never called so any errors after the client has connected never get handled.
  • This PR calls sse_client in a loop as a background task allowing it to attempt to reconnect as long as the mcpo server is active

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/mcpo/pull/180 **Author:** [@edelauna](https://github.com/edelauna) **Created:** 6/19/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (1) - [`9cdeeb9`](https://github.com/open-webui/mcpo/commit/9cdeeb91e79c5037503c8024dfea01fa189eab19) fix(server_type): SSE server does not reconnect if session lost ### 📊 Changes **3 files changed** (+85 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/mcpo/main.py` (+16 -11) ➕ `src/mcpo/tests/test_sse.py` (+34 -0) ➕ `src/mcpo/utils/sse.py` (+35 -0) </details> ### 📄 Description # Changelog Entry ## [0.0.16] - 2025-06-19 ### Fixed - 🔄 **SSE Server Reconnection**: Fixed an issue where the SSE server would not reconnect if the session was lost. This improves the stability and reliability of SSE-based MCP connections. ### Description - Currently if you start an SSE server and the SSE sessions is lost, `mcpo` does not try to re-establish the connection, resulting in any subsequent calls to fail due to `asnycio.ClosedResourceError`. - The `reader` from `sse_client` is never called so any errors after the client has connected never get handled. - This PR calls `sse_client` in a loop as a background task allowing it to attempt to reconnect as long as the `mcpo` server is active --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:15:15 -05:00
yindo closed this issue 2026-02-15 21:15:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/mcpo#188