From 4de4822219bd6eb249d258e3b1a5613ec1c97243 Mon Sep 17 00:00:00 2001 From: Olcan Date: Sat, 17 May 2025 16:53:22 -0700 Subject: added timeout setting to mcp server config, also switched to custom config type without "stderr" field that does not make sense in settings (#410) --- packages/server/src/config/config.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'packages/server/src/config') diff --git a/packages/server/src/config/config.ts b/packages/server/src/config/config.ts index fdd7973e..6093b7ab 100644 --- a/packages/server/src/config/config.ts +++ b/packages/server/src/config/config.ts @@ -21,7 +21,16 @@ import { WebFetchTool } from '../tools/web-fetch.js'; import { ReadManyFilesTool } from '../tools/read-many-files.js'; import { BaseTool, ToolResult } from '../tools/tools.js'; import { MemoryTool } from '../tools/memoryTool.js'; -import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js'; + +export class MCPServerConfig { + constructor( + readonly command: string, + readonly args?: string[], + readonly env?: Record, + readonly cwd?: string, + readonly timeout?: number, + ) {} +} export class Config { private toolRegistry: ToolRegistry; @@ -37,9 +46,7 @@ export class Config { private readonly toolDiscoveryCommand: string | undefined, private readonly toolCallCommand: string | undefined, private readonly mcpServerCommand: string | undefined, - private readonly mcpServers: - | Record - | undefined, + private readonly mcpServers: Record | undefined, private readonly userAgent: string, private userMemory: string = '', // Made mutable for refresh private geminiMdFileCount: number = 0, @@ -92,7 +99,7 @@ export class Config { return this.mcpServerCommand; } - getMcpServers(): Record | undefined { + getMcpServers(): Record | undefined { return this.mcpServers; } @@ -164,7 +171,7 @@ export function createServerConfig( toolDiscoveryCommand?: string, toolCallCommand?: string, mcpServerCommand?: string, - mcpServers?: Record, + mcpServers?: Record, userAgent?: string, userMemory?: string, geminiMdFileCount?: number, -- cgit v1.2.3