-
Notifications
You must be signed in to change notification settings - Fork 9k
Description
What happened?
When using an MCP server that only provides prompts and no tools (like https://github.com/vasayxtx/mcp-prompt-engine), gemini-cli logs an error during discovery:
Error discovering tools from <mcp_server_name>: MCP error -32601: tools not supported
This error appears in the debug console even though the MCP server is functioning correctly and its prompts are being discovered successfully.
Root Cause
The issue is in packages/core/src/tools/mcp-client.ts in the discoverTools() function. It calls mcpToTool() without first checking if the server supports tools via getServerCapabilities()?.tools. When a prompt-only server doesn't implement the tools/list method, it returns error code -32601 (Method not found).
Reproduction
- Configure an MCP server that only provides prompts
- Run gemini-cli
- Observe the error message in the Debug Console (ctrl+o)
Related
- Similar issue for prompts was fixed in PR check for the prompt capability before listing prompts from MCP servers #5616
- Original issue reported: Doesn't work with Gemini CLI vasayxtx/mcp-prompt-engine#31
What did you expect to happen?
Similar to how discoverPrompts() checks for prompt support:
if (mcpClient.getServerCapabilities()?.prompts == null) return [];
The discoverTools() function should check for tool support before attempting to call mcpToTool(), and silently return an empty array if tools are not supported.
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
╭──────────────────────────────────────────────────────────────────────────────────╮
│ │
│ About Gemini CLI │
│ │
│ CLI Version 0.6.1 │
│ Git Commit f3078136 │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS darwin │
│ Auth Method OAuth │
│ │
╰──────────────────────────────────────────────────────────────────────────────────╯Login information
No response
Anything else we need to know?
No response