diff options
| author | Olcan <[email protected]> | 2025-05-16 16:29:03 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-16 16:29:03 -0700 |
| commit | d9bd2b0e144560c8a82806bfb021a028c7cd43c9 (patch) | |
| tree | 3573b27b520d6a83b56a16da41ecab700ddf2a26 /packages/server/src/config/config.ts | |
| parent | e158a0d59f46df4a8b76a7118c7cc10226fdb1c5 (diff) | |
improved mcp support, including standard "mcpServers" setting with multiple named servers with command/args/env/cwd (#392)
Diffstat (limited to 'packages/server/src/config/config.ts')
| -rw-r--r-- | packages/server/src/config/config.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/server/src/config/config.ts b/packages/server/src/config/config.ts index e104eaaa..4221b71e 100644 --- a/packages/server/src/config/config.ts +++ b/packages/server/src/config/config.ts @@ -20,6 +20,7 @@ import { WriteFileTool } from '../tools/write-file.js'; import { WebFetchTool } from '../tools/web-fetch.js'; import { ReadManyFilesTool } from '../tools/read-many-files.js'; import { BaseTool, ToolResult } from '../tools/tools.js'; +import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js'; export class Config { private toolRegistry: ToolRegistry; @@ -35,6 +36,9 @@ export class Config { private readonly toolDiscoveryCommand: string | undefined, private readonly toolCallCommand: string | undefined, private readonly mcpServerCommand: string | undefined, + private readonly mcpServers: + | Record<string, StdioServerParameters> + | undefined, private readonly userAgent: string, private userMemory: string = '', // Made mutable for refresh private geminiMdFileCount: number = 0, @@ -86,6 +90,10 @@ export class Config { return this.mcpServerCommand; } + getMcpServers(): Record<string, StdioServerParameters> | undefined { + return this.mcpServers; + } + getUserAgent(): string { return this.userAgent; } @@ -146,6 +154,7 @@ export function createServerConfig( toolDiscoveryCommand?: string, toolCallCommand?: string, mcpServerCommand?: string, + mcpServers?: Record<string, StdioServerParameters>, userAgent?: string, userMemory?: string, geminiMdFileCount?: number, @@ -161,6 +170,7 @@ export function createServerConfig( toolDiscoveryCommand, toolCallCommand, mcpServerCommand, + mcpServers, userAgent ?? 'GeminiCLI/unknown', // Default user agent userMemory ?? '', geminiMdFileCount ?? 0, |
