Open
Conversation
This commit adds support for Server-Sent Events (SSE) transport for MCP servers. - Updates `HttpServerConfig` to include an optional `transport` field, defaulting to 'http'. - Updates `connectToServer` to use `SSEClientTransport` when `transport` is set to 'sse'. - Uses `@modelcontextprotocol/sdk/client/sse.js` for SSE transport. - Adds test coverage for the new configuration option. Co-authored-by: Zman771 <605281+Zman771@users.noreply.github.com>
This commit introduces support for the SSE (Server-Sent Events) transport protocol in mcp-cli. - **Config**: Added `SseServerConfig` interface. SSE servers must be explicitly configured with `"type": "sse"`. - **Client**: Added `createSseTransport` which automatically appends `/sse` to the URL if not present, adhering to common conventions for SSE endpoints. - **Client**: Updated `connectToServer` to route connections to the appropriate transport (SSE, HTTP, or Stdio) based on the configuration. - **Tests**: Added unit tests for the new configuration type and type guards. This aligns the implementation with the provided design document, ensuring backward compatibility for existing HTTP server configurations. Co-authored-by: Zman771 <605281+Zman771@users.noreply.github.com>
- Updated `README.md` to include a new "SSE Transport (Legacy)" section. - Added configuration examples for enabling SSE transport with `"type": "sse"`. - Included a deprecation note advising users to prefer Streamable HTTP transport for new servers. Co-authored-by: Zman771 <605281+Zman771@users.noreply.github.com>
…04843101 Add SSE transport support
- Update version in package.json and src/version.ts - Update CHANGELOG.md with SSE Transport Support details Co-authored-by: Zman771 <605281+Zman771@users.noreply.github.com>
- Update version in package.json and src/version.ts - Update CHANGELOG.md with SSE Transport Support details Co-authored-by: Zman771 <605281+Zman771@users.noreply.github.com>
…1264656097342 Release 0.3.1: SSE Support
Owner
|
Shouldn't this work with streamable http? |
Author
|
The mcp server I'm using doesn't support streamable http unfortunately. The only way I got it to work was to use SSE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSE Transport Support - Support for Server-Sent Events transport protocol
type: "sse"in server config