mcp-proxy 5.6.1 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bin/mcp-proxy.js +7 -1
- package/dist/bin/mcp-proxy.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/{stdio-D0Lv8ytu.js → stdio-so1-I7Pn.js} +43 -16
- package/dist/stdio-so1-I7Pn.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/bin/mcp-proxy.ts +6 -0
- package/src/fixtures/slow-stdio-server.ts +91 -0
- package/src/proxyServer.test.ts +148 -0
- package/src/proxyServer.ts +43 -10
- package/src/startHTTPServer.test.ts +480 -0
- package/src/startHTTPServer.ts +42 -2
- package/dist/stdio-D0Lv8ytu.js.map +0 -1
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ options:
|
|
|
35
35
|
- `--streamEndpoint`: Set the streamable HTTP endpoint path (default: `/mcp`). Overrides `--endpoint` if `server` is set to `stream`.
|
|
36
36
|
- `--stateless`: Enable stateless mode for HTTP streamable transport (no session management). In this mode, each request creates a new server instance instead of maintaining persistent sessions.
|
|
37
37
|
- `--port`: Specify the port to listen on (default: 8080)
|
|
38
|
+
- `--requestTimeout`: Timeout in milliseconds for requests to the MCP server (default: 300000, which is 5 minutes)
|
|
38
39
|
- `--debug`: Enable debug logging
|
|
39
40
|
- `--shell`: Spawn the server via the user's shell
|
|
40
41
|
- `--apiKey`: API key for authenticating requests (uses X-API-Key header)
|
package/dist/bin/mcp-proxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Client, InMemoryEventStore, ReadBuffer, Server, __commonJS, __toESM, proxyServer, serializeMessage, startHTTPServer } from "../stdio-
|
|
2
|
+
import { Client, InMemoryEventStore, ReadBuffer, Server, __commonJS, __toESM, proxyServer, serializeMessage, startHTTPServer } from "../stdio-so1-I7Pn.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { basename, dirname, extname, join, normalize, relative, resolve } from "path";
|
|
5
5
|
import { format, inspect } from "util";
|
|
@@ -5044,6 +5044,11 @@ const argv = await yargs_default(hideBin(process.argv)).scriptName("mcp-proxy").
|
|
|
5044
5044
|
describe: "The port to listen on",
|
|
5045
5045
|
type: "number"
|
|
5046
5046
|
},
|
|
5047
|
+
requestTimeout: {
|
|
5048
|
+
default: 3e5,
|
|
5049
|
+
describe: "The timeout (in milliseconds) for requests to the MCP server (default: 5 minutes)",
|
|
5050
|
+
type: "number"
|
|
5051
|
+
},
|
|
5047
5052
|
server: {
|
|
5048
5053
|
choices: ["sse", "stream"],
|
|
5049
5054
|
describe: "The server type to use (sse or stream). By default, both are enabled",
|
|
@@ -5099,6 +5104,7 @@ const proxy = async () => {
|
|
|
5099
5104
|
const server$1 = new Server(serverVersion, { capabilities: serverCapabilities });
|
|
5100
5105
|
proxyServer({
|
|
5101
5106
|
client,
|
|
5107
|
+
requestTimeout: argv.requestTimeout,
|
|
5102
5108
|
server: server$1,
|
|
5103
5109
|
serverCapabilities
|
|
5104
5110
|
});
|