Skip to main content

mcphee

CI PyPI version Python 3.11+

mcphee is an interactive CLI client for Model Context Protocol (MCP) servers. Connect to any MCP server — local (stdio) or remote (SSE / Streamable HTTP) — and explore its tools, resources, and prompts in a rich interactive REPL.


Features

  • Universal transport support — stdio, SSE, and Streamable HTTP
  • Interactive REPL — Vi mode (default) or Emacs mode with full line editing
  • Tab completion — fuzzy-match tool names, resource URIs, prompt names, and their parameters
  • Auto-suggestions — fish-shell style history suggestions as you type
  • Persistent history — across sessions, XDG-compliant location
  • Named profiles — save connection configs in ~/.config/mcphee/profiles.toml
  • Rich output — syntax-highlighted JSON, tables, and panels; toggle to raw JSON with #json
  • Meta-commands — #refresh, #export, #timeout, #debug, and more

Installation

# From PyPI
uv tool install mcphee

# From GitHub (latest main)
uv tool install git+https://github.com/dgwartney/mcphee

# Specific tag or commit
uv tool install "git+https://github.com/dgwartney/mcphee@v0.1.0"

# From a local clone
uv tool install .

After installation the mcphee command is available globally without activating a virtual environment. Upgrade with:

uv tool upgrade mcphee

pip

pip install mcphee

Quick Start

# Connect to a local stdio MCP server
mcphee connect --stdio 'npx -y @modelcontextprotocol/server-filesystem /tmp'

# Connect via SSE with an API key header
mcphee connect --sse http://localhost:8080/sse --header x-api-key=secret

# Connect via Streamable HTTP
mcphee connect --http http://localhost:8080/mcp

# Connect using a saved profile
mcphee connect --profile myserver

Once connected you'll enter the interactive REPL:

╭─ mcphee ──────────────────────────────────────────────────────╮
│ Connected via http                                            │
│ http://localhost:8080/mcp                                     │
│ Type help for commands or exit to quit.                       │
╰───────────────────────────────────────────────────────────────╯
> list tools
> call read_file path=/tmp/notes.txt
> list resources
> read file:///tmp/notes.txt
> list prompts
> prompt summarize text="hello world"
> exit

REPL Command Reference

Command Syntax Description
list tools list tools List all available tools
list resources list resources List all available resources
list prompts list prompts List all available prompts
call call <tool> [key=value ...] Invoke a tool with arguments
read read <uri> Read a resource by URI
prompt prompt <name> [key=value ...] Get a prompt with arguments
help help Show command reference
exit / quit exit Disconnect and exit

Argument syntax

Tool and prompt arguments are passed as key=value pairs:

> call read_file path=/tmp/foo.txt
> call search query="hello world" limit=10
> prompt summarize text="Some long text here" language=en

Values are automatically typed: true/false to bool, integers to int, JSON arrays/objects to parsed.


Meta-Command Reference

Meta-commands begin with # and control the REPL session:

Command Syntax Description
#clear #clear Clear the terminal screen
#refresh #refresh Re-fetch tools/resources/prompts, rebuild completions
#json #json Toggle JSON vs Rich pretty output
#history #history [N] Show last N commands (default 20)
#export #export [path] Export last result to a JSON file
#timeout #timeout <seconds> Set request timeout
#debug #debug Toggle verbose debug output
#help #help Show meta-command reference

Profile Management

Save connection configs so you don't have to retype them:

# Add a profile interactively
mcphee profile add myserver

# List all profiles
mcphee profile list

# Remove a profile
mcphee profile remove myserver

Profile TOML schema (~/.config/mcphee/profiles.toml):

[profiles.lumen]
mode = "http"
url = "http://localhost:8080/mcp"
[profiles.lumen.headers]
x-api-key = "secret"

[profiles.filesystem]
mode = "stdio"
command = "npx -y @modelcontextprotocol/server-filesystem /tmp"

[profiles.weather]
mode = "sse"
url = "http://weather-api.internal/sse"

Configuration Paths (XDG)

mcphee follows the XDG Base Directory Specification:

Data Path
Profiles $XDG_CONFIG_HOME/mcphee/profiles.toml (default: ~/.config/mcphee/profiles.toml)
History $XDG_DATA_HOME/mcphee/history (default: ~/.local/share/mcphee/history)

Key Bindings

The REPL uses Vi mode by default. Use --emacs to switch to Emacs mode.

Mode Keys Action
Vi normal h l w b 0 $ Move cursor
Vi normal x dd u Delete / undo
Vi normal / Search forward
Both Up / Down arrows History recall
Both Ctrl+R Reverse history search
Vi insert Esc Switch to normal mode

Publishing to PyPI

Releases are published by the Publish GitHub Actions workflow (.github/workflows/publish.yml) using PyPI Trusted Publishing (OIDC), so no API tokens are stored anywhere.

One-time setup on https://pypi.org (and https://test.pypi.org for dry runs), under Account → Publishing → Add a pending publisher:

Field Value
PyPI Project Name mcphee
Owner dgwartney
Repository name mcphee
Workflow name publish.yml
Environment name pypi (use testpypi on TestPyPI)

To release:

  1. Bump version in pyproject.toml (PyPI never accepts the same version twice).
  2. Dry run: Actions → Publish → Run workflow → target testpypi, then install from TestPyPI: uv tool install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ mcphee
  3. Publish: create a GitHub Release tagged vX.Y.Z — the workflow uploads to PyPI.

To build locally without publishing: uv build (writes dist/mcphee-*.whl and .tar.gz).


License

MIT

Metadata

Release files for mcphee 0.1.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 mcphee 0.1.0
File Size Uploaded Provenance
mcphee-0.1.0.tar.gz 19.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 40.4 kB

Release files / mcphee-0.1.0.tar.gz

Download URL mcphee-0.1.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c244644ed2b6f97abcebf303814daaff6875f0ba8bff4dc2bb3ef67c5c7c8404
BLAKE2b-256 checksum
How to use checksums
ae3bcc00b8409e63e3a3954edcaa2ad469e2e88c7d42b81b758c54bdfd4d5eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 23, 2026.

Transparency log

Release files / mcphee-0.1.0-py3-none-any.whl

Download URL mcphee-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f90cdec287b965e5b5e18d211b9a652e38d4b976c3fa48c4f4dc9a7640cc91ea
BLAKE2b-256 checksum
How to use checksums
2c00cdf5a950dc4b39fd78bd3c62dbefc37e4d1937c48e946f38c7e9895c83af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 23, 2026.

Transparency log

Security for mcphee 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcphee-0.1.0.tar.gz

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 Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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