- Added new external networks: public, badge-net, and mcp_net.
- Changed service network assignments to use the new networks.
- Updated restart policy condition for services to 'any'.
- Adjusted healthcheck commands and service commands for consistency.
- Commented out the firecrawl-mcp service for future reference.
Fixes https://github.com/sparfenyuk/mcp-proxy/issues/95
This adds the option `--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}`
to define the log level. If both `--debug` and `--log-level` are
provided, the former takes precedence.
Starlette's default behavior adds a trailing slash to every routes
without it (https://github.com/encode/starlette/discussions/2548), e.g.
when client initiates a request to `/mcp`, it returns a `307 Temporary
Redirect` response to `/mcp/`. This is causing some annoying issues,
especially in our internal environment where server instances sit behind
a load balancer and do not have access to their actual domain name,
Starlette returns the instance's internal ip which the client cannot
recognize and access. This PR disables this behavior.
Signed-off-by: Jianxin Qiu <jianxin.qiu@outlook.com>
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>
This PR adds the ability to pass through all environment variables to
the server, using the flag `--pass-environment` (default off).
This change allows a compose spec like this to access all environment
variables from an env_file (as well as PATH):
```yaml
server-brave-search:
image: mcp-proxy:latest
env_file: .brave.env
# ENTRYPOINT from custom SSE-only image, for context
entrypoint: ["mcp-proxy", "--sse-host=0.0.0.0", "--sse-port=8080", "--pass-environment", "--"]
command: ["npx", "--yes", "@modelcontextprotocol/server-brave-search"]
```
The motivation behind this is I am developing in Docker Compose, with a
custom client and multiple servers. I made a debian-based mcp-proxy
image, with an entrypoint that set some SSE settings. When it came to
adding brave search, I spent a bit of time struggling against var
interpolation and an overridden entrypoint (cause: you can't access env
vars in entrypoints, I think). I figured passing through all environment
variables would be easier (and safe in a container).
I started adding tests for this, but found myself refactoring
\_\_main\_\_.py quite a bit to make it more testable. I've left that for
now in the aim of an easy-to-review PR, but am happy to continue that
effort if you'd like? Essentially breaking out the argument parser and
the SSE client/server parts into functions and validating their config.
Thanks again for this tool - it's made adding support for stdio servers
in our client much easier!
---------
Co-authored-by: Sergey Parfenyuk <myseverality@gmail.com>
I have replaced the `--api-access-token` argument with the more generic
`--headers` argument for SSE. This will allow for other auth mechanisms
such as api keys as well. Intended usage:
```sh
# API key
mcp-proxy http://example.io/sse --headers x-api-key my-super-secret-api-key
# Bearer token
mcp-proxy http://example.io/sse --headers Authorization 'Bearer my-super-secret-bearer-token'
# Multiple headers
mcp-proxy http://example.io/sse --headers Authorization 'Bearer my-super-secret-bearer-token' --headers x-api-key my-super-secret-api-key
```
This pull request introduces the following updates:
- **Dockerfile**: Introduces a Dockerfile to package the MCP for
deployment across various environments.
- **Smithery Configuration**: Adds a Smithery YAML file, which specifies
how to start the MCP and the configuration options it supports. It
allows you to [deploy](https://smithery.ai/docs/deployments) your MCP to
[Smithery](https://smithery.ai?utm_campaign=pr), serving it over SSE so
end-users do not need to install additional dependencies. To deploy,
merge this PR, then visit your [server
page](https://smithery.ai/server/mcp-proxy?utm_campaign=pr&modal=claim)
and click "Deploy" under the deployments page.
Please review these updates to verify their accuracy for your server and
feel free to customize it to your needs. Let me know if you have any
questions. 🙂
---------
Co-authored-by: Sergey Parfenyuk <myseverality@gmail.com>