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?

@oss-maintainer

Copy link
Copy Markdown
Collaborator

⚠️ Merge conflict detected

This PR has conflicts with the main branch and cannot be merged. Please rebase or merge main into your branch and resolve the conflicts:

git fetch origin
git checkout fix/2003-streamable-http-resumable-streams
git rebase origin/main
# resolve conflicts, then:
git push --force-with-lease

This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.


Automated notification by github-manager-bot

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/core/tool Tool, skill, RAG abstractions labels Jul 11, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 AI Review

Exposes streamable HTTP resumable transport options for MCP clients. Adds configuration surface for MCP streamable HTTP transport including resumability settings.

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

Labels

area/core/tool Tool, skill, RAG abstractions enhancement New feature or request

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

6 participants