This PR adds support for running multiple MCP (STDIO) servers and
serving them up via a single mcp-proxy instance, each with a named path
in the URL.
Example usage:
```
mcp-proxy --port 8080 --named-server fetch 'uvx mcp-server-fetch' --named-server github 'npx -y @modelcontextprotocol/server-github'
```
Would serve:
- `http://localhost:8080/servers/fetch`
- `http://localhost:8080/servers/github`
I've also added the ability to provide a standard mcp client config file
with accompanying tests.
Please feel free to make any changes as you see fit, or reject the PR if
it does not align with your goals.
Thank you,
---------
Co-authored-by: Magnus Tidemann <magnustidemann@gmail.com>
Co-authored-by: Sergey Parfenyuk <sergey.parfenyuk@gmail.com>
1. Add support for --stateless parameter configuration
2. Add support for --cwd parameter passing working directory to mcp
stdio server
3. Use StreamableHTTPSessionManager from the latest python-mcp-sdk
release to manage sessions, simplifying code
4. Optimize test cases
Allow specifying CORS configuration so that a client can call the proxy from a different host/port.
Co-authored-by: Fedir Zadniprovskyi <github.g1k56@simplelogin.com>
Co-authored-by: Sergey Parfenyuk <myseverality@gmail.com>
* Add library for serving an sse server proxying a stdio server
* Change context manager for running server in the background thread
* Fix lint errors in new test fixture
* Update starlette response routing
* Fix ruff format errors
* Fix ruff format errors
* Fix typos in SseServerSettigs
* Rename host to bind host and update to localhost
* Update for new import location
* Update imports based on ruff rules
* Update src/mcp_proxy/sse_server.py
Co-authored-by: Guillaume Raille <guillaume.raille@gmail.com>