diff options
Diffstat (limited to 'packages/cli/src/config/config.ts')
| -rw-r--r-- | packages/cli/src/config/config.ts | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index 650f3aa2..27e3ec09 100644 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -19,8 +19,7 @@ import { FileDiscoveryService, TelemetryTarget, FileFilteringOptions, - MCPServerConfig, - IDE_SERVER_NAME, + IdeClient, } from '@google/gemini-cli-core'; import { Settings } from './settings.js'; @@ -264,6 +263,11 @@ export async function loadCliConfig( process.env.TERM_PROGRAM === 'vscode' && !process.env.SANDBOX; + let ideClient: IdeClient | undefined; + if (ideMode) { + ideClient = new IdeClient(); + } + const allExtensions = annotateActiveExtensions( extensions, argv.extensions || [], @@ -355,37 +359,6 @@ export async function loadCliConfig( } } - if (ideMode) { - if (mcpServers[IDE_SERVER_NAME]) { - logger.warn( - `Ignoring user-defined MCP server config for "${IDE_SERVER_NAME}" as it is a reserved name.`, - ); - } - const companionPort = process.env.GEMINI_CLI_IDE_SERVER_PORT; - if (companionPort) { - const httpUrl = `http://localhost:${companionPort}/mcp`; - mcpServers[IDE_SERVER_NAME] = new MCPServerConfig( - undefined, // command - undefined, // args - undefined, // env - undefined, // cwd - undefined, // url - httpUrl, // httpUrl - undefined, // headers - undefined, // tcp - undefined, // timeout - false, // trust - 'IDE connection', // description - undefined, // includeTools - undefined, // excludeTools - ); - } else { - logger.warn( - 'Could not connect to IDE. Make sure you have the companion VS Code extension installed from the marketplace or via /ide install.', - ); - } - } - const sandboxConfig = await loadSandboxConfig(settings, argv); return new Config({ @@ -450,6 +423,7 @@ export async function loadCliConfig( noBrowser: !!process.env.NO_BROWSER, summarizeToolOutput: settings.summarizeToolOutput, ideMode, + ideClient, }); } |
