diff options
| author | Shreya Keshive <[email protected]> | 2025-07-15 10:19:59 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-15 14:19:59 +0000 |
| commit | b09bc6656080d4d12e1d06734aae2ec33af5c1ed (patch) | |
| tree | 5140eabe1f10fb6084d9ded3d4d59282cfbc0bc7 /packages/core/src/tools/mcp-client.ts | |
| parent | 97cc1e641805beefe3abe3bd7bd57b630b22ecd2 (diff) | |
Adds the user's active file in the IDE to the footer (#4154)
Diffstat (limited to 'packages/core/src/tools/mcp-client.ts')
| -rw-r--r-- | packages/core/src/tools/mcp-client.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/core/src/tools/mcp-client.ts b/packages/core/src/tools/mcp-client.ts index eb82190b..beb70549 100644 --- a/packages/core/src/tools/mcp-client.ts +++ b/packages/core/src/tools/mcp-client.ts @@ -20,6 +20,11 @@ import { MCPServerConfig } from '../config/config.js'; import { DiscoveredMCPTool } from './mcp-tool.js'; import { FunctionDeclaration, Type, mcpToTool } from '@google/genai'; import { sanitizeParameters, ToolRegistry } from './tool-registry.js'; +import { + ActiveFileNotificationSchema, + IDE_SERVER_NAME, + ideContext, +} from '../services/ideContext.js'; export const MCP_DEFAULT_TIMEOUT_MSEC = 10 * 60 * 1000; // default to 10 minutes @@ -211,6 +216,15 @@ export async function connectAndDiscover( updateMCPServerStatus(mcpServerName, MCPServerStatus.DISCONNECTED); }; + if (mcpServerName === IDE_SERVER_NAME) { + mcpClient.setNotificationHandler( + ActiveFileNotificationSchema, + (notification) => { + ideContext.setActiveFileContext(notification.params); + }, + ); + } + const tools = await discoverTools( mcpServerName, mcpServerConfig, |
