Skip to content

Fix SSE server transport to support relative and absolute endpoints #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ltwlf
Copy link

@ltwlf ltwlf commented May 5, 2025

Summary

Enable absolute endpoint URLs in the SSE server transport (previously only relative URLs worked), matching the behavior of the TypeScript SDK.

What changed

  • Removed URL-quoting logic that broke absolute URLs
  • Added unit tests for both relative and absolute endpoints

Why it matters

Clients such as Copilot Studio require absolute URLs; this update restores compatibility.

Testing

All new and existing tests pass locally, including the new absolute-URL cases. Verified end-to-end in a sample app.

Breaking changes

None.


  • I have read the MCP documentation
  • Code follows project style guidelines
  • Tests pass locally
  • Added/updated error handling and documentation

ltwlf added 2 commits May 5, 2025 13:56
This change fixes the endpoint URL handling in the SSE server transport to support both relative and absolute URLs.
Some clients like Copilot Studio require absolute URLs. This change aligns with the TypeScript SDK's support
for absolute endpoint URLs as in https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/server/sse.ts

The PR:
1. Removes unnecessary URL quoting which would break absolute URLs
2. Adds comprehensive tests for both relative and absolute URL endpoints
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.

1 participant