Skip to content

fix(mcp): expose streamable HTTP resumable transport options#2006

Open
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:fix/2003-streamable-http-resumable-streams
Open

fix(mcp): expose streamable HTTP resumable transport options#2006
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:fix/2003-streamable-http-resumable-streams

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

Background

Fixes #2003.

When connecting to a Streamable HTTP MCP server that disables SSE and only accepts POST requests, tool calls can hang because AgentScope-Java does not expose the underlying MCP SDK transport options needed to disable resumable SSE-style startup behavior.

What Changed

  • exposed resumableStreams(boolean) on McpClientBuilder for Streamable HTTP transport
  • exposed openConnectionOnStartup(boolean) on McpClientBuilder for Streamable HTTP transport
  • passed both options through to HttpClientStreamableHttpTransport.Builder
  • added resumableStreams and openConnectionOnStartup support to tools.json MCP server config
  • wired the new config fields through McpServerRegistrar

Example

Java API:

McpClientBuilder.create("test")
    .streamableHttpTransport(url)
    .resumableStreams(false)
    .openConnectionOnStartup(false)
    .buildSync();

Testing

mvn -pl "agentscope-core,agentscope-harness" spotless:apply
mvn -pl "agentscope-core,agentscope-harness" "-Dtest=McpClientBuilderTest,ToolsConfigLoaderTest" test

@guslegend0510 guslegend0510 requested a review from a team July 4, 2026 03:06
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...tscope/harness/agent/tools/McpServerRegistrar.java 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zouyx zouyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chickenlj

Copy link
Copy Markdown
Collaborator

Do you think it reasonable if we disable SSE by default when streamable is enabled? Currently, user has to set resumableStreams and openConnectionOnStartup when streamableHttpTransport is used, which is a bit complexed I think.

Also, have you checked the latest MCP sdk release? I mean will it bring any behaviour changes if we upgrade to the latest version?

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.

[Bug]:McpClientBuilder.streamableHttpTransport does not expose resumableStreams option — hangs on SSE-disabled MCP servers

4 participants