Skip to content

bug: MCP server/tools not loading in Gemini #863

@koladev32

Description

@koladev32

Bug Report: Gemini CLI Issues with Gram MCP Servers and Tools

Environment

  • gram version: 0.13.2 (0ed2383)
  • gemini version: 0.13.0

I am experiencing two issues when using MCP servers and tools in Gemini CLI after using the gram install command:

  1. MCP tool calls fail with a JSON schema error
  2. MCP server authentication fails when environment variables are required

Issue 1: MCP Tool Calls Fail with Schema Error

  1. Deploy the default bootstrapped Gram function project (the greet tool):
   pnpm create @gram-ai/function@latest --template gram
   pnpm build
   pnpm push
  1. Install the toolset in Gemini CLI:
   gram install gemini-cli --toolset hello-world
  1. In Gemini CLI, attempt to call the tool:
   say hello to koladev

The greet tool should execute successfully and return a greeting message.

Actual Behavior

The tool call fails with the following error:

> say hello to koladev
╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ x  greet (Hello World MCP Server) {"name":"koladev"}                                                   │
│                                                                                                        │
│    no schema with key or ref "https://json-schema.org/draft/2020-12/schema"                            │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I encountered an error when trying to use the greet tool: "no schema with key or ref
  'https://json-schema.org/draft/2020-12/schema'". It seems there's an issue with the tool's definition.

MCP tool schema error in Gemini CLI

Issue 2: MCP Server Authentication Fails with Environment Variables

  1. Install an MCP server that requires environment variables (e.g., Taskmaster):
   gram install gemini-cli --toolset taskmaster
  1. Start Gemini CLI and attempt to use the server.

  2. Gemini CLI prompts to authenticate:

   /mcp auth taskmaster

The authentication command should successfully configure the MCP server with the required environment variables.

Actual Behavior

The authentication fails with the following error:

✕ Error during discovery for server 'taskmaster': OAuth configuration failed for 'taskmaster'. Please
  authenticate manually with /mcp auth taskmaster

> /mcp auth
ℹ No MCP servers configured with OAuth authentication.

> /mcp auth taskmaster
ℹ Starting OAuth authentication for MCP server 'taskmaster'...
✕ Failed to authenticate with MCP server 'taskmaster': Failed to discover OAuth configuration from MCP
  server
  • Gemini CLI appears to expect OAuth authentication when environment variables are required
  • The /mcp auth command doesn't recognize the server as having OAuth configuration
  • The server cannot connect by default without authentication, but the authentication command doesn't work

MCP server authentication error in Gemini CLI

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions