Skip to main content

Native CLI for any MCP server.

Project description

mcpcaller

A stateless CLI that turns any MCP server into a native shell experience. Every tool becomes a command with typed flags, auto-discovered help, OAuth handled automatically, and zero JSON-by-hand.

Install

uv tool install mcpcaller
# or
pipx install mcpcaller

Quick start

Add a stdio server (the official filesystem server is a good first target):

mcpcaller add fs -- npx -y @modelcontextprotocol/server-filesystem ~

Add a remote HTTP server. If it requires OAuth, your browser opens once and the token is saved in your OS keychain:

mcpcaller add prod https://mcp.example.com

For headless/CI environments, pass an API token as a static header instead:

mcpcaller add prod https://mcp.example.com --header "Authorization=Bearer $API_TOKEN"

Or use the device-code grant when there's no browser available:

mcpcaller add prod https://mcp.example.com --device-code

List what's available, then call a tool:

mcpcaller tools                          # all tools on the current server
mcpcaller describe read_file             # full schema for one tool
mcpcaller read_file --path ~/notes.md

Resources and prompts are first-class:

mcpcaller resources
mcpcaller read file:///etc/hosts

mcpcaller prompts
mcpcaller prompt summarise --doc file:///etc/hosts

Calling tools

Each tool's inputSchema becomes typed flags automatically. Examples (against a hypothetical issue tracker):

mcpcaller search_issues --query "bug" --status open --limit 20
mcpcaller search_issues --tags backend --tags urgent          # repeated arrays
mcpcaller search_issues --tags backend,urgent                  # comma-split arrays
mcpcaller create_issue --title "x" --filter__env prod          # nested objects via __
mcpcaller create_issue --filter '{"env":"prod","sev":"high"}'  # JSON escape hatch

# Read the value from a file (@-) or stdin (@-)
mcpcaller ingest --body @payload.json
echo '{"a":1}' | mcpcaller ingest --body @-

Run any tool with --help to see its schema-derived flag list:

mcpcaller search_issues --help

Selecting a server

In order of precedence:

  1. Explicit positional: mcpcaller prod search_issues ...
  2. --server flag: mcpcaller search_issues --server prod ...
  3. MCPCALLER_SERVER env var (handy in CI)
  4. The current server (mcpcaller use <name> to switch)

Run mcpcaller help selection for the long version, including how the positional-vs-tool collision rule works.

Output

  • Default: human-readable, status messages on stderr, data on stdout (so pipes work).
  • --json emits the raw tools/call / resources/read / prompts/get result.
  • --raw emits only the first text content block, no framing.
  • --quiet / -q suppresses spinners and status lines.
  • --verbose / -v shows wire-level JSON-RPC for debugging.
  • --no-color disables ANSI colour output (also honours NO_COLOR).

Exit codes

Code Meaning
0 success
1 tool returned isError: true
2 usage error (bad flag, missing required)
3 auth error (token invalid, refresh failed)
4 transport error (server unreachable, schema lock contention)
5 schema mismatch after refresh
≥64 server-defined error mapped from JSON-RPC code

Auth

OAuth 2.1 with discovery, Dynamic Client Registration, and PKCE. mcpcaller add runs the whole flow if it sees a 401 on the first probe; if you skip it with --no-login, the next call that returns 401 triggers it lazily. Tokens live in the OS keychain (macOS Keychain / libsecret on Linux / Windows Credential Manager) with a chmod-600 file fallback for headless setups.

mcpcaller login <name>           # re-run OAuth (e.g. for a scope change)
mcpcaller logout <name>          # wipe tokens
mcpcaller refresh-token <name>   # force a refresh (debugging)

In CI, set MCPCALLER_TOKEN_<NAME>=<token> to bypass the keychain entirely. (The suffix is the server name uppercased with - replaced by _.)

mcpcaller help auth covers the full set of auth modes; mcpcaller help transports covers stdio vs HTTP vs SSE.

Inspecting servers

mcpcaller servers                    # what's configured
mcpcaller current                    # which one is the default
mcpcaller use <name>                 # switch the default
mcpcaller status                     # auth + schema state per server
mcpcaller refresh                    # re-fetch schema cache for the current server
mcpcaller refresh --all              # re-fetch everything
mcpcaller search <pattern>           # grep across tool/resource/prompt names + descriptions

Scripting

# Pipe JSON results through jq:
mcpcaller search_issues --query "bug" --json | jq '.content[0].text'

# Use --raw when you want only the text payload:
mcpcaller get_token --raw | pbcopy

# Pin a server in CI:
MCPCALLER_SERVER=prod mcpcaller list_jobs --json

Develop

uv sync
uv run pytest
uv run ruff check src/ tests/
uv run ruff format src/ tests/

Shell completion:

mcpcaller completion bash    # or zsh / fish / powershell

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

mcpcaller-1.0.0.tar.gz (130.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpcaller-1.0.0-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file mcpcaller-1.0.0.tar.gz.

File metadata

  • Download URL: mcpcaller-1.0.0.tar.gz
  • Upload date:
  • Size: 130.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcpcaller-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e530acaf3a2f9d345d40bbe47a9c262321e9ef4e74a5e889c26ede03b73205ad
MD5 97b4735e417db00ebfcd896ab0c67e48
BLAKE2b-256 b48f03f8a2bc6bcf22948b73b8293f4acaffece0d3ee554c2fe674c201b8b8f2

See more details on using hashes here.

File details

Details for the file mcpcaller-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mcpcaller-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcpcaller-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74579e347f5af4a40eac29b80f6548a4dc2193d186046fd0563d52df3f4879a1
MD5 efc6c75a5999fe6464cfb940c6ab5ee4
BLAKE2b-256 490f00c5f204a4009b74b7f6ad7d5ab27fc5c5e42664385b84db5eb6c0592d8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page