Get the FREE Ultimate OpenClaw Setup Guide →

cmcp

A command-line utility for interacting with MCP servers.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio russellluo-cmcp python -m cmcp

How to use

cmcp is a command-line utility for interacting with MCP servers, effectively acting as a specialized curl for MCP endpoints. It supports multiple transport modes (STDIO, HTTP, and SSE in deprecated form), and provides a straightforward syntax to list prompts, resources, and tools, read resources, and call tools on a target MCP server. You can run a local server process or connect to a remote MCP endpoint; the CLI guides you through providing parameters and headers as needed, and can also operate in verbose mode to display the underlying JSON-RPC requests and responses. The tool is designed to simplify crafting and sending the appropriate MCP requests and inspecting the structured responses in a familiar command-line workflow.

How to install

Prerequisites:

  • Python 3.7+ installed on your system
  • Internet access to install Python packages

Installation steps:

  1. Create and (optionally) activate a virtual environment: python -m venv venv source venv/bin/activate # on macOS/Linux .\venv\Scripts\activate # on Windows

  2. Install the cmcp package from PyPI: pip install cmcp

  3. Verify installation: cmcp --version

If you prefer not to install system-wide, you can use a virtual environment or a tool like pipx to isolate the CLI: pipx install cmcp cmcp --version

Additional notes

Tips and notes:

  • The STDIO and HTTP/SSE workflows allow you to interact with MCP servers by issuing commands against prompts, resources, and tools. Use prompts/list, resources/list, resources/read, tools/list, and tools/call to exercise capabilities.
  • Verbose mode (-v) prints the JSON-RPC request and response payloads to help with debugging.
  • When configuring connections, you can use a local server definition or a remote endpoint via a URL like http://host:port/mcp. If you store server configurations in .cmcp/mcp.json, cmcp can read and reuse them with :server-name syntax.
  • For environments requiring specific headers (e.g., API keys), you can pass them using cmcp URL METHOD header:value pairs where applicable.
  • If you plan to host an MCP server yourself, refer to the MCP server framework documentation for how to expose prompts, resources, and tools as MCP endpoints.

Related MCP Servers

Sponsor this space

Reach thousands of developers