introduce custom mcp server timeout

This commit is contained in:
uinstinct 2025-05-01 13:30:09 +05:30
parent cdde37d3b7
commit ef0e7a490f
4 changed files with 5 additions and 1 deletions

View file

@ -72,6 +72,7 @@ function convertYamlMcpToContinueMcp(
args: server.args ?? [],
env: server.env,
},
timeout: server.timeout
};
}
@ -444,6 +445,7 @@ async function configYamlToContinueConfig(options: {
args: [],
...server,
},
timeout: server.timeout
})),
false,
);

View file

@ -14,7 +14,7 @@ import {
MCPTool,
} from "../..";
export const DEFAULT_MCP_TIMEOUT = 20_000; // 10 seconds
const DEFAULT_MCP_TIMEOUT = 20_000; // 20 seconds
class MCPConnection {
public client: Client;

1
core/index.d.ts vendored
View file

@ -1211,6 +1211,7 @@ export interface ExperimentalModelRoles {
export interface ExperimentalMCPOptions {
transport: TransportOptions;
faviconUrl?: string;
timeout?: number;
}
export type EditStatus =

View file

@ -15,6 +15,7 @@ const mcpServerSchema = z.object({
faviconUrl: z.string().optional(),
args: z.array(z.string()).optional(),
env: z.record(z.string()).optional(),
timeout: z.number().gt(0).optional()
});
export type MCPServer = z.infer<typeof mcpServerSchema>;