-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add CORS middleware to Starlette app for frontend support #1201
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
base: main
Are you sure you want to change the base?
Conversation
Introduces CORS middleware to the Starlette app instances in FastMCP to allow requests from local web frontends. This enables compatibility with web clients running on localhost and related origins, supporting credentials and common HTTP methods and headers.
dsp-ant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to add this by default. If we do want to allow for certain types of starlette middlewares. We likely want to mimic what FastMCP 2.0 does here. We want support for a proper middleware stack and a default set for auth, with a pre-defined order.
Is this wrong? |
That's looking at the Typescript implementation of FastMCP - if you look at FastMCP 2.0 @dsp-ant was referring to here: #1245 That shows the middleware support in the Python SDK. Tentatively going to mark this as a |
|
Converting this to a draft for now to remove it from the review queue - keeping this around for future work on v2 |
Introduces CORS middleware to the Starlette app instances in FastMCP to allow requests from local web frontends. This enables compatibility with web clients running on localhost and related origins, supporting credentials and common HTTP methods and headers.
Motivation and Context
Fixes #187 (comment)
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context