← Back to directory
M

MCP CLI

Community
A lightweight CLI to interact with MCP servers.
GitHub source repository ↗
★ 1.3k Stars Category · Dev Tools Very popular Source revision d77672a1ce80
64FMRS · C
Reliability
10/20
Security and permissions
12/20
Maintenance
14/20
Documentation
15/20
Setup experience
13/20

mcp-cli is a feature-rich CLI tool, especially suited for AI agents and terminal users, providing script-friendly access to MCP servers.

Read the FMRS scoring method →

mcp-cli is a lightweight, Bun-based CLI for interacting with Model Context Protocol (MCP) servers. It supports servers over stdio and HTTP transports, offering tool discovery, schema viewing, invocation, and is optimized for AI coding agents.

Tools

info
Show server information, tools, and schemas.
grep
Search tools by glob pattern.
call
Call a tool on a server, with inline JSON or from stdin.

Setup

  1. Install via curl -fsSL https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh | bash or bun install -g https://github.com/philschmid/mcp-cli. 2. Create config file mcp_servers.json (see above). 3. Use mcp-cli commands.
claude_desktop_config.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "."
      ]
    },
    "deepwiki": {
      "url": "https://mcp.deepwiki.com/mcp"
    }
  }
}

Fit and risk

Best for

  • AI coding agents that need lightweight MCP server integration.
  • Developers who prefer terminal-based interactions.
  • Users needing efficient, scriptable access to MCP tools.

Not for

  • Users requiring a graphical interface.
  • Scenarios not involving the MCP protocol.
  • Applications needing persistent connections or heavy session management (CLI is designed for one-off requests).

Required permissions

  • Read and write MCP server configuration as specified in config file.
  • Spawn subprocesses via stdio (e.g., npx).
  • Establish network connections to remote MCP servers if configured.
  • Create temporary Unix sockets for connection pooling (daemon mode enabled by default).

Risks and side effects

  • Sensitive information (e.g., API keys) in config may be stored in plaintext.
  • MCP servers launched may execute arbitrary commands, especially from untrusted sources.
  • Connection keep-alive may hold resources if not idle-timeout.
  • Supply chain risks when using npm/npx packages as server commands.

Troubleshooting

  1. Check config file path (`mcp_servers.json` or `~/.config/mcp/`).
  2. Set `MCP_DEBUG=1` for debug output.
  3. Set `MCP_NO_DAEMON=1` to disable connection caching to resolve issues.
  4. Ensure server command is available (e.g., npx installed).
  5. Verify environment variable substitution (`${VAR}`) meets `MCP_STRICT_ENV`.
  6. Refer to error messages for recovery suggestions.

Use cases

Quickly list and call MCP tools from the command line.
Provide command-line access to MCP servers for AI coding agents (e.g., Gemini CLI, Claude Code).
Chain MCP tools with shell utilities like jq in scripts.

Supported clients

Claude DesktopPartial support
Gemini CLIPartial support
OpenCodePartial support
Claude CodePartial support