cmcp
A command-line utility for interacting with MCP servers.
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:
-
Create and (optionally) activate a virtual environment: python -m venv venv source venv/bin/activate # on macOS/Linux .\venv\Scripts\activate # on Windows
-
Install the cmcp package from PyPI: pip install cmcp
-
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
code-mode
🔌 Plug-and-play library to enable agents to call MCP and UTCP tools via code execution.
mysql_mcp_server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
mcp-reddit
A Model Context Protocol (MCP) server that provides tools for fetching and analyzing Reddit content.
Gitingest
mcp server for gitingest
skill-to
Convert AI Skills (Claude Skills format) to MCP server resources - Part of BioContextAI
Convert-Markdown-PDF
Markdown To PDF Conversion MCP