Add CORS middleware to Starlette app for frontend support#1201
Add CORS middleware to Starlette app for frontend support#1201SmartManoj wants to merge 2 commits intomodelcontextprotocol:mainfrom
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.
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