[BUG] No CLI flag to specify MCP" error when using Claude CLI with MCP server

Resolved 💬 2 comments Opened Apr 21, 2025 by bgyeth Closed Apr 21, 2025

No CLI flag to specify MCP" error when using Claude CLI with MCP server

Environment

  • Claude CLI version: 0.2.74
  • OS: macOS Darwin 24.3.0 (ARM64)
  • Node.js version: v23.11.0

Description

When attempting to use the --mcp flag to specify a custom MCP server, Claude CLI reports an error "No CLI flag to specify MCP", despite the MCP server being correctly
configured and working when run directly.

Steps to Reproduce

  1. Created an MCP server for Google's Gemini 2.5 Pro model
  2. Added server with claude mcp add gemini "node /path/to/mcp-server/dist/index.js"
  3. Verified server is registered with claude mcp list (shows correctly)
  4. Verified server works when run directly with npm start in the server directory
  5. Attempted to use with Claude CLI: claude --mcp=gemini or claude --mcp gemini
  6. Error received: "No CLI flag to specify MCP"

Expected Behavior

Claude CLI should recognize the --mcp flag and connect to the specified MCP server.

Actual Behavior

Claude CLI reports "No CLI flag to specify MCP" even though the documentation indicates this flag exists and the server is properly configured.

Additional Information

  • The MCP server connects successfully to the Gemini API and can communicate with the model
  • Running the server directly shows it's working correctly
  • Have tried both syntax forms: --mcp=gemini and --mcp gemini
  • The issue appears specific to how Claude CLI parses or interprets the MCP flag

---

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗