Skip to content

fix(ping): use transport-level health check for SSE servers#242

Open
kimjune01 wants to merge 1 commit into
IBM:mainfrom
kimjune01:fix-203-sse-ping
Open

fix(ping): use transport-level health check for SSE servers#242
kimjune01 wants to merge 1 commit into
IBM:mainfrom
kimjune01:fix-203-sse-ping

Conversation

@kimjune01
Copy link
Copy Markdown
Contributor

Fixes #203

Why

mcp-cli ping checked server.connected, a static property that reflects
initial connection state. For SSE transports this was always stale — the
ping command reported "Connected" even when the server was unreachable,
or failed silently.

Changes

  • Replace server.connected with tool_manager.check_server_health(),
    which calls send_ping() on the actual transport. Works for stdio, SSE,
    and HTTP.
  • Report online/total count at the end.
  • Use enumerate instead of list.index() for server filtering.

Tests

  • Updated existing ping test mocks.
  • Added SSE transport ping, mixed transport, and online count tests.

4443 passed, 12 skipped, 0 failures.

Replace server.connected (static property) with
tool_manager.check_server_health() which performs a real
transport-level send_ping() across all transport types.

Fixes IBM#203
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

Successfully merging this pull request may close these issues.

ping does not work with SSE servers

1 participant