MCP Proxy

by sparfenyuk

2.7k 5.7M downloads Not rated yet

About

A proxy server for MCP requests, supporting SSE and stdio transports.

Explore

- Aggregates multiple MCP servers into one HTTP endpoint.
- Supports SSE and streamable HTTP server transports.
- Supports stdio, SSE, and streamable-http client types.
- Configurable via a JSON configuration file.
- Docker image includes npx and uvx support.
- Online Claude config converter available.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Proxy
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

1.1 Configuration

This mode requires providing the URL of the MCP Server's SSE endpoint as the program’s first argument. If the server uses Streamable HTTP transport, make sure to enforce it on the mcp-proxy side by passing --transport=streamablehttp.

Arguments

| Name | Required | Description | Example |
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| command_or_url | Yes | The MCP server SSE endpoint to connect to | http://example.io/sse |
| --headers | No | Headers to use for the MCP server SSE connection | Authorization 'Bearer my-secret-access-token' |
| --transport | No | Decides which transport protocol to use when connecting to an MCP server. Can be either 'sse' or 'streamablehttp' | streamablehttp |
| --client-id | No | OAuth2 client ID for authentication | your_client_id |
| --client-secret| No | OAuth2 client secret for authentication | your_client_secret |
| --token-url | No | OAuth2 token endpoint URL for authentication | https://auth.example.com/oauth/token |

Environment Variables

| Name | Required | Description | Example |
| ------------------ | -------- | ---------------------------------------------------------------------------- | ---------- |
| API_ACCESS_TOKEN | No | Can be used instead of --headers Authorization 'Bearer <API_ACCESS_TOKEN>' | YOUR_TOKEN |

1.2 Example usage

mcp-proxy is supposed to be started by the MCP Client, so the configuration must be done accordingly.

For Claude Desktop, the configuration entry can look like this:

{
  "mcpServers": {
    "mcp-proxy": {
      "command": "mcp-proxy",
      "args": [
        "http://example.io/sse"
      ],
      "env": {
        "API_ACCESS_TOKEN": "access-token"
      }
    }
  }
}

2.1 Configuration

This mode requires the --sse-port argument to be set. The --sse-host argument can be set to specify the host IP
address that the SSE server will listen on. Additional environment variables can be passed to the local stdio server
using the --env argument. The command line arguments for the local stdio server must be passed after the --
separator.

Arguments

| Name | Required | Description | Example |
| ------------------------------------ | -------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------- |
| command_or_url | Yes | The command to spawn the MCP stdio server | uvx mcp-server-fetch |
| --port | No, random available | The MCP server port to listen on | 8080 |
| --host | No, 127.0.0.1 by default | The host IP address that the MCP server will listen on | 0.0.0.0 |
| --env | No | Additional environment variables to pass to the MCP stdio server. Can be used multiple times. | FOO BAR |
| --cwd | No | The working directory to pass to the MCP stdio server process. | /tmp |
| --pass-environment | No | Pass through all environment variables when spawning the server | --no-pass-environment |
| --allow-origin | No | Allowed origins for the SSE server. Can be used multiple times. Default is no CORS allowed. | --allow-origin "\*" |
| --expose-header | No | Headers added to Access-Control-Expose-Headers. Can be used multiple times. Defaults to mcp-session-id. | --expose-header Custom-Header |
| --stateless | No | Enable stateless mode for streamable http transports. Default is False | --no-stateless |
| --named-server NAME COMMAND_STRING | No | Defines a named stdio server. | --named-server fetch 'uvx mcp-server-fetch' |
| --named-server-config FILE_PATH | No | Path to a JSON file defining named stdio servers. | --named-server-config /path/to/servers.json |
| --sse-port (deprecated) | No, random available | The SSE server port to listen on | 8080 |
| --sse-host (deprecated) | No, 127.0.0.1 by default | The host IP address that the SSE server will listen on | 0.0.0.0 |

2.2 Example usage

To start the mcp-proxy server that listens on port 8080 and connects to the local MCP server:

```bash

create_or_update_file

Create or update a single file in a GitHub repository

search_repositories

Search for GitHub repositories

create_repository

Create a new GitHub repository in your account

get_file_contents

Get the contents of a file or directory from a GitHub repository

push_files

Push multiple files to a GitHub repository in a single commit

create_issue

Create a new issue in a GitHub repository

create_pull_request

Create a new pull request in a GitHub repository

fork_repository

Fork a GitHub repository to your account or specified organization

create_branch

Create a new branch in a GitHub repository

list_commits

Get list of commits of a branch in a GitHub repository

list_issues

List issues in a GitHub repository with filtering options

update_issue

Update an existing issue in a GitHub repository

add_issue_comment

Add a comment to an existing issue

search_code

Search for code across GitHub repositories

search_issues

Search for issues and pull requests across GitHub repositories

search_users

Search for users on GitHub

get_issue

Get details of a specific issue in a GitHub repository.

get_pull_request

Get details of a specific pull request

list_pull_requests

List and filter repository pull requests

create_pull_request_review

Create a review on a pull request

merge_pull_request

Merge a pull request

get_pull_request_files

Get the list of files changed in a pull request

get_pull_request_status

Get the combined status of all status checks for a pull request

update_pull_request_branch

Update a pull request branch with the latest changes from the base branch

get_pull_request_comments

Get the review comments on a pull request

get_pull_request_reviews

Get the reviews on a pull request

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp proxy": {
            "mcp-proxy": {
                "command": "uv",
                "args": [
                    "tool",
                    "install",
                    "mcp-proxy"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-proxy": {
        "command": "uv",
        "args": [
            "tool",
            "install",
            "mcp-proxy"
        ]
    }
}

GitHub License
PyPI - Python Version
PyPI - Downloads
codecov

- mcp-proxy
- About
- 1. stdio to SSE/StreamableHTTP
- 1.1 Configuration
- 1.2 Example usage
- 2. SSE to stdio
- 2.1 Configuration
- 2.2 Example usage
- Named Servers
- Installation
- Installing via PyPI
- Installing via Github repository (latest)
- Installing as container
- Troubleshooting
- Extending the container image
- Docker Compose Setup
- Command line arguments
- Example config file
- Testing

About

The mcp-proxy is a tool that lets you switch between server transports. There are two supported modes:

1. stdio to SSE/StreamableHTTP
2. SSE to stdio

1. stdio to SSE/StreamableHTTP

Run a proxy server from stdio that connects to a remote SSE server.

This mode allows clients like Claude Desktop to communicate to a remote server over SSE even though it is not supported
natively.

graph LR
    A["Claude Desktop"] <--> |stdio| B["mcp-proxy"]
    B <--> |SSE| C["External MCP Server"]

style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
style B fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px

1.1 Configuration

This mode requires providing the URL of the MCP Server's SSE endpoint as the program’s first argument. If the server uses Streamable HTTP transport, make sure to enforce it on the mcp-proxy side by passing --transport=streamablehttp.

Arguments

| Name | Required | Description | Example |
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| command_or_url | Yes | The MCP server SSE endpoint to connect to | http://example.io/sse |
| --headers | No | Headers to use for the MCP server SSE connection | Authorization 'Bearer my-secret-access-token' |
| --transport | No | Decides which transport protocol to use when connecting to an MCP server. Can be either 'sse' or 'streamablehttp' | streamablehttp |
| --client-id | No | OAuth2 client ID for authentication | your_client_id |
| --client-secret| No | OAuth2 client secret for authentication | your_client_secret |
| --token-url | No | OAuth2 token endpoint URL for authentication | https://auth.example.com/oauth/token |

Environment Variables

| Name | Required | Description | Example |
| ------------------ | -------- | ---------------------------------------------------------------------------- | ---------- |
| API_ACCESS_TOKEN | No | Can be used instead of --headers Authorization 'Bearer <API_ACCESS_TOKEN>' | YOUR_TOKEN |

1.2 Example usage

mcp-proxy is supposed to be started by the MCP Client, so the configuration must be done accordingly.

For Claude Desktop, the configuration entry can look like this:

{
  "mcpServers": {
    "mcp-proxy": {
      "command": "mcp-proxy",
      "args": [
        "http://example.io/sse"
      ],
      "env": {
        "API_ACCESS_TOKEN": "access-token"
      }
    }
  }
}

2. SSE to stdio

Run a proxy server exposing a SSE server that connects to a local stdio server.

This allows remote connections to the local stdio server. The mcp-proxy opens a port to listen for SSE requests,
spawns a local stdio server that handles MCP requests.

graph LR
    A["LLM Client"] <-->|SSE| B["mcp-proxy"]
    B <-->|stdio| C["Local MCP Server"]

style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
style B fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px

2.1 Configuration

This mode requires the --sse-port argument to be set. The --sse-host argument can be set to specify the host IP
address that the SSE server will listen on. Additional environment variables can be passed to the local stdio server
using the --env argument. The command line arguments for the local stdio server must be passed after the --
separator.

Arguments

| Name | Required | Description | Example |
| ------------------------------------ | -------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------- |
| command_or_url | Yes | The command to spawn the MCP stdio server | uvx mcp-server-fetch |
| --port | No, random available | The MCP server port to listen on | 8080 |
| --host | No, 127.0.0.1 by default | The host IP address that the MCP server will listen on | 0.0.0.0 |
| --env | No | Additional environment variables to pass to the MCP stdio server. Can be used multiple times. | FOO BAR |
| --cwd | No | The working directory to pass to the MCP stdio server process. | /tmp |
| --pass-environment | No | Pass through all environment variables when spawning the server | --no-pass-environment |
| --allow-origin | No | Allowed origins for the SSE server. Can be used multiple times. Default is no CORS allowed. | --allow-origin "\*" |
| --expose-header | No | Headers added to Access-Control-Expose-Headers. Can be used multiple times. Defaults to mcp-session-id. | --expose-header Custom-Header |
| --stateless | No | Enable stateless mode for streamable http transports. Default is False | --no-stateless |
| --named-server NAME COMMAND_STRING | No | Defines a named stdio server. | --named-server fetch 'uvx mcp-server-fetch' |
| --named-server-config FILE_PATH | No | Path to a JSON file defining named stdio servers. | --named-server-config /path/to/servers.json |
| --sse-port (deprecated) | No, random available | The SSE server port to listen on | 8080 |
| --sse-host (deprecated) | No, 127.0.0.1 by default | The host IP address that the SSE server will listen on | 0.0.0.0 |

2.2 Example usage

To start the mcp-proxy server that listens on port 8080 and connects to the local MCP server:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about MCP Proxy

Relevant YouTube tutorials, setups, and demos