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 +1 -0
- package/dist/bin/mcp-proxy.mjs +8 -3
- package/dist/bin/mcp-proxy.mjs.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/bin/mcp-proxy.ts +9 -3
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/bin/mcp-proxy.ts
CHANGED
|
@@ -47,6 +47,12 @@ const argv = await yargs(hideBin(process.argv))
|
|
|
47
47
|
describe: "API key for authenticating requests (uses X-API-Key header)",
|
|
48
48
|
type: "string",
|
|
49
49
|
},
|
|
50
|
+
connectionTimeout: {
|
|
51
|
+
default: 60000,
|
|
52
|
+
describe:
|
|
53
|
+
"The timeout (in milliseconds) for initial connection to the MCP server (default: 60 seconds)",
|
|
54
|
+
type: "number",
|
|
55
|
+
},
|
|
50
56
|
debug: {
|
|
51
57
|
default: false,
|
|
52
58
|
describe: "Enable debug logging",
|
|
@@ -144,7 +150,7 @@ if (dashDashArgs && dashDashArgs.length > 0) {
|
|
|
144
150
|
process.exit(1);
|
|
145
151
|
}
|
|
146
152
|
|
|
147
|
-
const connect = async (client: Client) => {
|
|
153
|
+
const connect = async (client: Client, connectionTimeout: number) => {
|
|
148
154
|
const transport = new StdioClientTransport({
|
|
149
155
|
args: finalArgs,
|
|
150
156
|
command: finalCommand,
|
|
@@ -159,7 +165,7 @@ const connect = async (client: Client) => {
|
|
|
159
165
|
stderr: "inherit",
|
|
160
166
|
});
|
|
161
167
|
|
|
162
|
-
await client.connect(transport);
|
|
168
|
+
await client.connect(transport, { timeout: connectionTimeout });
|
|
163
169
|
};
|
|
164
170
|
|
|
165
171
|
const proxy = async () => {
|
|
@@ -173,7 +179,7 @@ const proxy = async () => {
|
|
|
173
179
|
},
|
|
174
180
|
);
|
|
175
181
|
|
|
176
|
-
await connect(client);
|
|
182
|
+
await connect(client, argv.connectionTimeout);
|
|
177
183
|
|
|
178
184
|
const serverVersion = client.getServerVersion() as {
|
|
179
185
|
name: string;
|