Skip to content
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

Better CORS defaults for SSE transport #143

Open
jspahrsummers opened this issue Feb 3, 2025 · 5 comments
Open

Better CORS defaults for SSE transport #143

jspahrsummers opened this issue Feb 3, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@jspahrsummers
Copy link
Member

jspahrsummers commented Feb 3, 2025

It's likely that most MCP servers accessible over SSE should be contactable by frontend web applications, which means the right CORS headers need to be set. The SDK should likely opt-in to this by default, with an opt-out available.

See also modelcontextprotocol/python-sdk#187.

@Vikrant-Khedkar
Copy link

Hey, I am interested in fixing this. would love to discuss more

@punkpeye
Copy link

For what it is worth, https://github.com/punkpeye/fastmcp defaults to allowing CORS by default.

@mantrakp04
Copy link

mantrakp04 commented Mar 9, 2025

+1

Edit: its a bug not an enhancement

@panz2018
Copy link

I have developed web servers that integrate MCP SSE functionality:

These servers can be extended with custom routes while retaining full MCP SSE capabilities. Thus, it is possible to add CORS support using the functions from FastAPI or Starlette.

@punkpeye
Copy link

I am not confident that cors considerations should be even part of MCP SDK. This feels very much like something that should be implemented at a framework/server level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants