A command-line utility for interacting with MCP servers.
Project description
cMCP
cmcp is a command-line utility that helps you interact with MCP servers. It's basically curl for MCP servers.
Installation
pip install cmcp
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}'
SSE transport
Run the above MCP server with SSE transport:
mcp run server.py -t sse
List prompts:
cmcp http://localhost:8000 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}'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmcp-0.2.0.tar.gz.
File metadata
- Download URL: cmcp-0.2.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910c88e5292c72f1e6c724f4faa6b64bbd555d7db1c4b9826edbf9858ac48e17
|
|
| MD5 |
9aa6be518eb227ae970f8ce6893f1129
|
|
| BLAKE2b-256 |
0d2cef69df14d2a62c8c4d6ea8ab7ecaed56d1ed219072b4efe0ae5091dfd952
|
Provenance
The following attestation bundles were made for cmcp-0.2.0.tar.gz:
Publisher:
ci.yml on RussellLuo/cmcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cmcp-0.2.0.tar.gz -
Subject digest:
910c88e5292c72f1e6c724f4faa6b64bbd555d7db1c4b9826edbf9858ac48e17 - Sigstore transparency entry: 210312701
- Sigstore integration time:
-
Permalink:
RussellLuo/cmcp@40eb5f02abc66fcfc88ce481987114311d5ab101 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/RussellLuo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@40eb5f02abc66fcfc88ce481987114311d5ab101 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cmcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cmcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d25bfb5c3376905feb52cb20ba328c5bc1e2cca46cf686fcb66d558ef653d1
|
|
| MD5 |
34d914f958cd5b424b807518b862ac53
|
|
| BLAKE2b-256 |
ee713f63de91c053ecec58b48b96dd2a5e84bdaf1a30b4f85b2e1471efd8fd60
|
Provenance
The following attestation bundles were made for cmcp-0.2.0-py3-none-any.whl:
Publisher:
ci.yml on RussellLuo/cmcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cmcp-0.2.0-py3-none-any.whl -
Subject digest:
a9d25bfb5c3376905feb52cb20ba328c5bc1e2cca46cf686fcb66d558ef653d1 - Sigstore transparency entry: 210312735
- Sigstore integration time:
-
Permalink:
RussellLuo/cmcp@40eb5f02abc66fcfc88ce481987114311d5ab101 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/RussellLuo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@40eb5f02abc66fcfc88ce481987114311d5ab101 -
Trigger Event:
push
-
Statement type: