GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SDK rejects valid SSE comments, causing initialization timeout with Tavily MCP remote server · Issue #685 · modelcontextprotocol/java-sdk

SDK rejects valid SSE comments, causing initialization timeout with Tavily MCP remote server #685

New issue
Copy link
New issue
Copy link
Open
Bug
Open
SDK rejects valid SSE comments, causing initialization timeout with Tavily MCP remote server#685
Bug
Copy link
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't working

Description

@udayogra
udayogra
opened on Nov 20, 2025
Issue body actions

The Java MCP SDK throws an McpError: Invalid SSE response when receiving SSE comment lines (lines starting with :), which are valid per the SSE specification. This causes initialization failures with MCP servers that send keep-alive or ping comments.

Environment
SDK Version: Java SDK (latest)
Protocol Version: 2025-03-26
Java Version: 17+
Affected Server: Tavily MCP Server (https://mcp.tavily.com/mcp/)

Steps to Reproduce:

String url = "https://mcp.tavily.com/mcp/";

McpClientTransport transport = HttpClientStreamableHttpTransport.builder(url).build();

SyncSpec clientBuilder = McpClient.sync(transport);
McpSyncClient client = clientBuilder.build();

// This will fail during initialization
client.initialize();

Symptoms
Initial Symptom (with default/short timeout)
The initialization hangs and eventually times out:

_INFO io.modelcontextprotocol.client.LifecycleInitializer -- Server response with Protocol: 2025-03-26, Capabilities: ServerCapabilities[...], Info: Implementation[name=tavily-mcp, title=null, version=1.17.0] and Instructions null

WARN io.modelcontextprotocol.client.LifecycleInitializer -- Failed to initialize

java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 3000ms in 'map' (and no fallback has been configured)_

This timeout occurs because the SSE parsing is failing silently in the background, preventing the initialization from completing.
Root Cause Revealed (with increased timeout ~300 seconds)
When the timeout is increased significantly, the actual error becomes visible:

WARN io.modelcontextprotocol.client.LifecycleInitializer -- Handling exception

io.modelcontextprotocol.spec.McpError: Invalid SSE response. Status code: 200 Line: : ping - 2025-11-20 17:27:30.586492+00:00
at io.modelcontextprotocol.client.transport.ResponseSubscribers$SseLineSubscriber.hookOnNext(ResponseSubscribers.java:173)

Reacted by Harsh Bhardwaj, krystian-witek-zen and AntoineCourcelle

Activity

  1. chemicL
    added
    bugSomething isn't workingSomething isn't working
    P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable feature
    on Feb 20, 2026
  2. chemicL
    added the
    Bug
    issue type on Feb 20, 2026
  3. rameshreddy-adutla commented on Mar 4, 2026

    @rameshreddy-adutla
    rameshreddy-adutla
    on Mar 4, 2026
    Contributor
    More actions

    This issue appears to have been resolved by PR #467 (feat: handle SSE comment messages), which was merged in v0.14.0. The fix added handling for SSE comment lines (starting with :) in ResponseSubscribers.SseLineSubscriber, which is shared by both the SSE and Streamable HTTP client transports.

    Both HttpClientSseClientTransport and HttpClientStreamableHttpTransport use ResponseSubscribers.sseToBodySubscriber(), so the fix applies to both transport types. SSE comment/ping lines like : ping - 2025-11-20 17:27:30.586492+00:00 are now correctly ignored with a debug log message.

    Could this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't working

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.