MCP Client for Humans
Project description
mcpie ๐ฅง MCP Client for Humans
Command-line tool and REPL for MCP (Model Context Protocol) servers.
Like httpie for HTTP, but for MCP servers! ๐ฅง
Features
- Interactive REPL with tab completion and command history
- Multiple output formats: JSON, pretty JSON, table, YAML, raw
- Pipe-friendly: Clean stdout/stderr separation, stdin input, file output
- Script-ready: Proper exit codes, quiet mode, output redirection
- Short aliases:
ls,r list,t call add 5 3,p get name - Rich tables and syntax-highlighted JSON output
- Multiple transport support: STDIO, Streamable HTTP, and SSE (deprecated)
- Smart argument parsing (JSON, key=value, or interactive prompting)
Installation
Install uv then:
uv sync
uv tool install .
From pypi:
uv tool install mcpie-cli
uvx mcpie-cli
Quick Start
Interactive Mode
# Start interactive client
mcpie "python server.py" # STDIO transport
mcpie "http://localhost:8000" # Streamable HTTP transport (with SSE fallback)
# Inside the REPL
mcp> discover # See everything available
mcp> ls # List resources
mcp> t call add 5 3 # Call tool with smart parsing
mcp> r read config://app # Read resource
mcp> help # Show all commands
Script-Friendly Usage
# Different output formats
mcpie "python server.py" t call add 5 3 --output json # {"content": [{"type": "text", "text": "8"}]}
mcpie "python server.py" t call add 5 3 --output raw # 8
mcpie "python server.py" t call add 5 3 --output pretty # Indented JSON
mcpie "python server.py" t call add 5 3 --output table # Tabular format
mcpie "python server.py" t call add 5 3 --output yaml # YAML format
# Save output to file
mcpie "python server.py" t call add 5 3 -o result.json --output json
# Pipe-friendly (quiet mode)
mcpie "python server.py" t call add 5 3 --output raw --quiet | wc -l
# Read from stdin
echo '{"a": 5, "b": 3}' | mcpie "python server.py" t call add --stdin
echo "5 3" | mcpie "python server.py" t call add --stdin
CLI Options
Output Control
--output FORMAT,-f FORMAT- Output format:json,pretty,table,yaml,raw--output-file FILE,-o FILE- Save output to file instead of stdout--quiet,-q- Suppress non-essential output (stderr messages)
Input Control
--stdin- Read command arguments from stdin (JSON or space-separated)
Transport Options
-H "Key:Value"- Add HTTP headers (for HTTP transport)-e "KEY:value"- Set environment variables--force-sse- Force SSE transport (if server doesn't support Streamable HTTP)
Output Formats
JSON (--output json)
Compact JSON output suitable for parsing:
{"content": [{"type": "text", "text": "8"}], "structuredContent": {"result": 8}}
Pretty JSON (--output pretty)
Indented JSON for human reading:
{
"content": [
{
"type": "text",
"text": "8"
}
],
"structuredContent": {
"result": 8
}
}
Table (--output table)
Tabular format for lists and structured data:
โโโโโโโโโโโฌโโโโโโโโโโโโ
โ Field โ Value โ
โโโโโโโโโโโผโโโโโโโโโโโโค
โ result โ 8 โ
โโโโโโโโโโโดโโโโโโโโโโโโ
YAML (--output yaml)
YAML format for configuration-like output:
content:
- type: text
text: '8'
structuredContent:
result: 8
Raw (--output raw)
Extract just the essential result value:
8
Exit Codes
mcpie uses proper exit codes for scripting:
0- Success1- CLI error (invalid arguments, missing files, etc.)2- Server error (connection failed, server returned error)3- Invalid input (malformed JSON, invalid parameters)
Commands
Discovery:
discover- Show all capabilitiesls- List resources (alias forr list)
Resources: r list, r read <uri>, r templates
Tools: t list, t call <name> [args], t inspect <name>
Prompts: p list, p get <name> [args], p inspect <name>
Server: s info, s ping, s capabilities
Examples
Interactive Usage
# Different argument formats
t call add 5 3 # Auto-mapped to parameters
t call add '{"a": 5, "b": 3}' # JSON format
t call add # Interactive prompting
# With headers/env vars for HTTP transport
mcpie -H "Authorization:token" http://localhost:8000
mcpie -e "API_KEY:secret" "python server.py"
# Force SSE transport (if server doesn't support Streamable HTTP)
mcpie --force-sse http://localhost:8000
Scripting Examples
# Get raw result for use in scripts
RESULT=$(mcpie "python server.py" t call add 5 3 --output raw --quiet)
echo "The sum is: $RESULT"
# Save structured data to file
mcpie "python server.py" r read config://app --output yaml -o config.yaml
# Process multiple inputs
echo '{"a": 1, "b": 2}' | mcpie "python server.py" t call add --stdin --output raw
echo '{"a": 3, "b": 4}' | mcpie "python server.py" t call add --stdin --output raw
# Chain operations
mcpie "python server.py" t call add 5 3 --output raw | \
xargs -I {} mcpie "python server.py" t call add {} 2 --output raw
# Error handling in scripts
if ! mcpie "python server.py" t call add 5 3 --quiet; then
echo "Command failed with exit code: $?"
fi
Pipe-Friendly Features
# Clean output suitable for piping
mcpie "python server.py" t call process_text "hello world" --output raw --quiet
# Read from stdin, output to file
echo '{"text": "hello", "operation": "uppercase"}' | \
mcpie "python server.py" t call process_text --stdin --output json -o result.json
# Combine with other tools
mcpie "python server.py" r list --output json --quiet | jq '.[] | .name'
That's it! Type help in the REPL for more details.
Project details
Release history Release notifications | RSS feed
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 mcpie_cli-0.2.0.tar.gz.
File metadata
- Download URL: mcpie_cli-0.2.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d4cc487a3fc6251aa29fc36f9425af543373f5e13ee3af871c2351d4879b0f9
|
|
| MD5 |
bf43915cb1c9b7bcb7156d2a85d6e4a5
|
|
| BLAKE2b-256 |
5586f3c4be196b4567de2faf4caa2df08ebd69d018fa2ad649d762be1b640f6c
|
Provenance
The following attestation bundles were made for mcpie_cli-0.2.0.tar.gz:
Publisher:
publish.yaml on h0rv/mcpie
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpie_cli-0.2.0.tar.gz -
Subject digest:
9d4cc487a3fc6251aa29fc36f9425af543373f5e13ee3af871c2351d4879b0f9 - Sigstore transparency entry: 281980557
- Sigstore integration time:
-
Permalink:
h0rv/mcpie@f9b9e25b9c6fc1f13d89850858673cb451e88abc -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/h0rv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f9b9e25b9c6fc1f13d89850858673cb451e88abc -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcpie_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcpie_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.8 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 |
a45a0c1e46e0695c0c669779dd1b0d64f7337ced99baf5f8b8405f15a5810574
|
|
| MD5 |
e685b3b30dc6bd966405040d1b2894f0
|
|
| BLAKE2b-256 |
d70e38d9c003ed595353c7a08b355a9a2ad538afef5f3a71e4b00f5d52d1fe09
|
Provenance
The following attestation bundles were made for mcpie_cli-0.2.0-py3-none-any.whl:
Publisher:
publish.yaml on h0rv/mcpie
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpie_cli-0.2.0-py3-none-any.whl -
Subject digest:
a45a0c1e46e0695c0c669779dd1b0d64f7337ced99baf5f8b8405f15a5810574 - Sigstore transparency entry: 281980582
- Sigstore integration time:
-
Permalink:
h0rv/mcpie@f9b9e25b9c6fc1f13d89850858673cb451e88abc -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/h0rv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f9b9e25b9c6fc1f13d89850858673cb451e88abc -
Trigger Event:
release
-
Statement type: