diff options
| author | christine betts <[email protected]> | 2025-07-15 22:13:03 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-15 22:13:03 +0000 |
| commit | b61016f2a513fb721125dec9b4bfe128f92890cb (patch) | |
| tree | 2cef074a3f4e800fc934786835081ccad76fa918 /packages/cli/src/config/config.ts | |
| parent | bf51de1a4d2111af4ece5a6d5567ed69f8f087df (diff) | |
Set port dynamically in VSCode extension and read from it in gemini-cli and send initial notification (#4255)
Diffstat (limited to 'packages/cli/src/config/config.ts')
| -rw-r--r-- | packages/cli/src/config/config.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index bf76fa4c..69708a61 100644 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -306,13 +306,20 @@ export async function loadCliConfig( } if (ideMode) { + const companionPort = process.env.GEMINI_CLI_IDE_SERVER_PORT; + if (!companionPort) { + throw new Error( + "Could not run in ide mode, make sure you're running in vs code integrated terminal. Try running in a fresh terminal.", + ); + } + const httpUrl = `http://localhost:${companionPort}/mcp`; mcpServers[IDE_SERVER_NAME] = new MCPServerConfig( undefined, // command undefined, // args undefined, // env undefined, // cwd undefined, // url - 'http://localhost:3000/mcp', // httpUrl + httpUrl, // httpUrl undefined, // headers undefined, // tcp undefined, // timeout |
