Skip to main content

cMCP

cmcp logo

cmcp is a command-line utility that helps you interact with MCP servers. It's basically curl for MCP servers.

Installation

pip install cmcp

Usage

STDIO

Interact with the STDIO server:

cmcp COMMAND METHOD

Add required parameters:

cmcp COMMAND METHOD param1=value param2:='{"arg1": "value"}'

Add required environment variables:

cmcp COMMAND METHOD ENV_VAR1:value ENV_VAR2:value param1=value param2:='{"arg1": "value"}'

HTTP (or SSE)

Interact with the HTTP (or SSE) server:

cmcp URL METHOD

Add required parameters:

cmcp URL METHOD param1=value param2:='{"arg1": "value"}'

Add required HTTP headers:

cmcp URL METHOD Header1:value Header2:value param1=value param2:='{"arg1": "value"}'

Verbose mode

Enable verbose mode to show JSON-RPC request and response:

cmcp -v COMMAND_or_URL METHOD

Quick Start

Given the following MCP Server (see here):

# server.py
from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Demo")


# Add a prompt
@mcp.prompt()
def review_code(code: str) -> str:
    return f"Please review this code:\n\n{code}"


# Add a static config resource
@mcp.resource("config://app")
def get_config() -> str:
    """Static configuration data"""
    return "App configuration here"


# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"


# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

STDIO transport

List prompts:

cmcp 'mcp run server.py' prompts/list

Get a prompt:

cmcp 'mcp run server.py' prompts/get name=review_code arguments:='{"code": "def greet(): pass"}'

List resources:

cmcp 'mcp run server.py' resources/list

Read a resource:

cmcp 'mcp run server.py' resources/read uri=config://app

List resource templates:

cmcp 'mcp run server.py' resources/templates/list

List tools:

cmcp 'mcp run server.py' tools/list

Call a tool:

cmcp 'mcp run server.py' tools/call name=add arguments:='{"a": 1, "b": 2}'

HTTP transport

Run the above MCP server with HTTP transport:

mcp run server.py -t streamable-http

List prompts:

cmcp http://localhost:8000 prompts/list
# or `cmcp http://localhost:8000/mcp prompts/list`

Get a prompt:

cmcp http://localhost:8000 prompts/get name=review_code arguments:='{"code": "def greet(): pass"}'

List resources:

cmcp http://localhost:8000 resources/list

Read a resource:

cmcp http://localhost:8000 resources/read uri=config://app

List resource templates:

cmcp http://localhost:8000 resources/templates/list

List tools:

cmcp http://localhost:8000 tools/list

Call a tool:

cmcp http://localhost:8000 tools/call name=add arguments:='{"a": 1, "b": 2}'

SSE transport (Deprecated)

Run the above MCP server with SSE transport:

mcp run server.py -t sse

List prompts:

cmcp http://localhost:8000/sse prompts/list

Get a prompt:

cmcp http://localhost:8000/sse prompts/get name=review_code arguments:='{"code": "def greet(): pass"}'

List resources:

cmcp http://localhost:8000/sse resources/list

Read a resource:

cmcp http://localhost:8000/sse resources/read uri=config://app

List resource templates:

cmcp http://localhost:8000/sse resources/templates/list

List tools:

cmcp http://localhost:8000/sse tools/list

Call a tool:

cmcp http://localhost:8000/sse tools/call name=add arguments:='{"a": 1, "b": 2}'

Using mcp.json (Advanced)

For convenience, you can use a configuration file to manage your MCP servers instead of typing the full command or URL each time. By default, cmcp looks for .cmcp/mcp.json (in the current directory) or ~/.cmcp/mcp.json (in your home directory).

The configuration follows the standard MCP JSON format, which is also used by Cursor, Claude Code, FastMCP, and other MCP clients.

Example configuration file:

{
  "mcpServers": {
    "local-server": {
      "command": "python",
      "args": ["mcp-server.py"],
      "env": {
        "API_KEY": "value"
      }
    },
    "remote-server": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "API_KEY": "value"
      }
    }
  }
}

Use a configured server by prefixing its name with ::

# Use the local-server from config
cmcp :local-server tools/list

# Use the remote-server from config
cmcp :remote-server tools/call name=add arguments:='{"a": 1, "b": 2}'

# Use a custom config file
cmcp --config /path/to/config.json :local-server tools/list

Related Projects

cA2A: A command-line utility for interacting with A2A agents.

License

MIT

Metadata

Release files for cmcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmcp 0.4.0
File Size Uploaded
cmcp-0.4.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cmcp 0.4.0
File Interpreter ABI Platform
cmcp-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / cmcp-0.4.0.tar.gz

Download URL cmcp-0.4.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d4e0cb6a31df30ddd48dbdb1bd1923c054f8d8bbffa8156b5eec12af3be7edef
BLAKE2b-256 checksum
How to use checksums
6832d3112367e5ff83c8edacbb8bc171ce27f1872d3fac48064b271a2df9eed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Release files / cmcp-0.4.0-py3-none-any.whl

Download URL cmcp-0.4.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abb21d7148402e69c5563028679ac390a794ce69f52a15ada7b525db98a7bd9c
BLAKE2b-256 checksum
How to use checksums
b38dc78efc468bf6d4c1fb1289ff9e56d5e91f7bce59cb713a7e11838d1ec135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page