Skip to content

Add MCP classic SSE auto-fallback for Bailian and --url - #153

Merged
XXPermanentXX merged 8 commits into
mainfrom
feat/mcp-support-sse
Aug 14, 2026
Merged

Add MCP classic SSE auto-fallback for Bailian and --url#153
XXPermanentXX merged 8 commits into
mainfrom
feat/mcp-support-sse

Conversation

@hopelynd

Copy link
Copy Markdown
Collaborator

Summary

  • Fall back from Streamable HTTP to classic SSE when Bailian MCP returns HTTP 405 (except WebSearch, which keeps the re-activate hint)
  • For --url, try Streamable first then classic SSE on the same URL for non-Bailian servers
  • Harden SSE session lifecycle, JSON-RPC id matching, and Streamable HTTP event-stream response parsing

- Add McpSseClient implementation for classic HTTP+SSE MCP protocol
- Implement connectBailianMcpWithFallback with Streamable HTTP to SSE fallback
- Add isStreamableHttpUnsupported helper to detect 405 streamableHttp errors
- Update activate-hint logic to handle WebSearch 405 streamableHttp cases
- Replace direct MCP client usage with connection manager in call/tools commands
- Add proper client cleanup with close() calls in finally blocks
- Export new MCP connection utilities and types from core client module
- Add comprehensive tests for SSE client and fallback behavior
@XXPermanentXX
XXPermanentXX merged commit f1b6cac into main Aug 14, 2026
2 checks passed
@XXPermanentXX
XXPermanentXX deleted the feat/mcp-support-sse branch August 14, 2026 08:10
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.

2 participants