mcp-proxy 6.1.10 → 6.2.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 CHANGED
@@ -52,6 +52,7 @@ options:
52
52
  - `--streamEndpoint`: Set the streamable HTTP endpoint path (default: `/mcp`). Overrides `--endpoint` if `server` is set to `stream`.
53
53
  - `--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.
54
54
  - `--port`: Specify the port to listen on (default: 8080)
55
+ - `--connectionTimeout`: Timeout in milliseconds for the initial connection to the MCP server (default: 60000, which is 60 seconds)
55
56
  - `--requestTimeout`: Timeout in milliseconds for requests to the MCP server (default: 300000, which is 5 minutes)
56
57
  - `--debug`: Enable debug logging
57
58
  - `--shell`: Spawn the server via the user's shell
@@ -5025,6 +5025,11 @@ const argv = await yargs_default(hideBin(process.argv)).scriptName("mcp-proxy").
5025
5025
  describe: "API key for authenticating requests (uses X-API-Key header)",
5026
5026
  type: "string"
5027
5027
  },
5028
+ connectionTimeout: {
5029
+ default: 6e4,
5030
+ describe: "The timeout (in milliseconds) for initial connection to the MCP server (default: 60 seconds)",
5031
+ type: "number"
5032
+ },
5028
5033
  debug: {
5029
5034
  default: false,
5030
5035
  describe: "Enable debug logging",
@@ -5109,7 +5114,7 @@ else if (argv.command) {
5109
5114
  console.error(" mcp-proxy node server.js");
5110
5115
  process.exit(1);
5111
5116
  }
5112
- const connect = async (client) => {
5117
+ const connect = async (client, connectionTimeout) => {
5113
5118
  const transport = new StdioClientTransport({
5114
5119
  args: finalArgs,
5115
5120
  command: finalCommand,
@@ -5120,14 +5125,14 @@ const connect = async (client) => {
5120
5125
  shell: argv.shell,
5121
5126
  stderr: "inherit"
5122
5127
  });
5123
- await client.connect(transport);
5128
+ await client.connect(transport, { timeout: connectionTimeout });
5124
5129
  };
5125
5130
  const proxy = async () => {
5126
5131
  const client = new Client({
5127
5132
  name: "mcp-proxy",
5128
5133
  version: "1.0.0"
5129
5134
  }, { capabilities: {} });
5130
- await connect(client);
5135
+ await connect(client, argv.connectionTimeout);
5131
5136
  const serverVersion = client.getServerVersion();
5132
5137
  const serverCapabilities = client.getServerCapabilities();
5133
5138
  console.info("starting server on port %d", argv.port);