modelcontextprotocol / modelcontextprotocol/python-sdk
Middleware Support in MCP
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.3k
- Forks
- 4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 31
Description
Description
We need a proper middleware mechanic in the server code. This must support adding custom Starlette middlware and have a pre-defined order of middleware when auth is enabled. See FastMCP 2.0 for inspiration.
References
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names only the server code and custom Starlette middleware; start by locating the existing middleware and authentication setup, then compare the intended approach with FastMCP 2.0. Done means custom middleware can be added and its order is predefined when authentication is enabled, but the issue names no files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100