Skip to content

MCP servers with only prompts (no tools) cause "tools not supported" error #10365

@vasayxtx

Description

@vasayxtx

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

  1. Configure an MCP server that only provides prompts
  2. Run gemini-cli
  3. Observe the error message in the Debug Console (ctrl+o)

Related

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions