@@ -51,10 +51,10 @@ This mode requires passing the URL to the MCP Server SSE endpoint as the first a
51
51
52
52
Arguments
53
53
54
- | Name | Required | Description | Example |
55
- | -------------------- | -------- | --------------------------------------------------------------------- | ---------------------------------------------- |
56
- | ` command_or_url ` | Yes | The MCP server SSE endpoint to connect to | http://example.io/sse |
57
- | ` --headers ` | No | Headers to use for the MCP server SSE connection | Authorization 'Bearer my-secret-access-token' |
54
+ | Name | Required | Description | Example |
55
+ | ---------------- | -------- | ------------------------------------------------ | --------------------------------------------- |
56
+ | ` command_or_url ` | Yes | The MCP server SSE endpoint to connect to | http://example.io/sse |
57
+ | ` --headers ` | No | Headers to use for the MCP server SSE connection | Authorization 'Bearer my-secret-access-token' |
58
58
59
59
Environment Variables
60
60
@@ -104,13 +104,14 @@ This mode requires the `--sse-port` argument to be set. The `--sse-host` argumen
104
104
105
105
Arguments
106
106
107
- | Name | Required | Description | Example |
108
- | -------------------- | -------------------------- | ---------------------------------------------------------------- | -------------------- |
109
- | ` command_or_url ` | Yes | The command to spawn the MCP stdio server | uvx mcp-server-fetch |
110
- | ` --sse-port ` | No, random available | The SSE server port to listen on | 8080 |
111
- | ` --sse-host ` | No, ` 127.0.0.1 ` by default | The host IP address that the SSE server will listen on | 0.0.0.0 |
112
- | ` --env ` | No | Additional environment variables to pass to the MCP stdio server | FOO=BAR |
113
- | ` --pass-environment ` | No | Pass through all environment variables when spawning the server | --no-pass-environment |
107
+ | Name | Required | Description | Example |
108
+ | -------------------- | -------------------------- | ---------------------------------------------------------------- | --------------------- |
109
+ | ` command_or_url ` | Yes | The command to spawn the MCP stdio server | uvx mcp-server-fetch |
110
+ | ` --sse-port ` | No, random available | The SSE server port to listen on | 8080 |
111
+ | ` --sse-host ` | No, ` 127.0.0.1 ` by default | The host IP address that the SSE server will listen on | 0.0.0.0 |
112
+ | ` --env ` | No | Additional environment variables to pass to the MCP stdio server | FOO=BAR |
113
+ | ` --pass-environment ` | No | Pass through all environment variables when spawning the server | --no-pass-environment |
114
+ | ` --allow-origin ` | No | Pass through all environment variables when spawning the server | --allow-cors "\* " |
114
115
115
116
### 2.2 Example usage
116
117
@@ -182,7 +183,9 @@ docker run -t ghcr.io/sparfenyuk/mcp-proxy:v0.3.2-alpine --help
182
183
## Command line arguments
183
184
184
185
``` bash
185
- usage: mcp-proxy [-h] [-H KEY VALUE] [-e KEY VALUE] [--sse-port SSE_PORT] [--sse-host SSE_HOST] [--pass-environment] [command_or_url] [args ...]
186
+ usage: mcp-proxy [-h] [-H KEY VALUE] [-e KEY VALUE] [--pass-environment | --no-pass-environment] [--sse-port SSE_PORT] [--sse-host SSE_HOST]
187
+ [--allow-origin ALLOW_ORIGIN [ALLOW_ORIGIN ...]]
188
+ [command_or_url] [args ...]
186
189
187
190
Start the MCP proxy in one of two possible modes: as an SSE or stdio client.
188
191
@@ -206,12 +209,15 @@ stdio client options:
206
209
SSE server options:
207
210
--sse-port SSE_PORT Port to expose an SSE server on. Default is a random port
208
211
--sse-host SSE_HOST Host to expose an SSE server on. Default is 127.0.0.1
212
+ --allow-origin ALLOW_ORIGIN [ALLOW_ORIGIN ...]
213
+ Allowed origins for the SSE server. Can be used multiple times. Default is no CORS allowed.
209
214
210
215
Examples:
211
216
mcp-proxy http://localhost:8080/sse
212
217
mcp-proxy --headers Authorization ' Bearer YOUR_TOKEN' http://localhost:8080/sse
213
218
mcp-proxy --sse-port 8080 -- your-command --arg1 value1 --arg2 value2
214
219
mcp-proxy your-command --sse-port 8080 -e KEY VALUE -e ANOTHER_KEY ANOTHER_VALUE
220
+ mcp-proxy your-command --sse-port 8080 --allow-origin= ' *'
215
221
` ` `
216
222
217
223
# # Testing
0 commit comments