diff --git a/packages/core/src/tools/mcp-client.ts b/packages/core/src/tools/mcp-client.ts index dc49f9386b..1b5e5edd6f 100644 --- a/packages/core/src/tools/mcp-client.ts +++ b/packages/core/src/tools/mcp-client.ts @@ -132,9 +132,7 @@ export class McpClient { * Discovers tools and prompts from the MCP server. */ async discover(cliConfig: Config): Promise { - if (this.status !== MCPServerStatus.CONNECTED) { - throw new Error('Client is not connected.'); - } + this.assertConnected(); const prompts = await this.discoverPrompts(); const tools = await this.discoverTools(cliConfig);