mcp2cli

Getting Started

Get from zero to running MCP commands in under a minute.


Prerequisites

  • Rust toolchain (for building from source) or a pre-built binary
  • An MCP server to connect to (or use the built-in demo mode)

Install

Three ways to get mcp2cli on your PATH — pick whichever fits your flow.

Works on any POSIX shell. The script detects cargo, warns if ~/.cargo/bin isn’t on your PATH, and installs from the main branch.

Terminal window
curl -fsSL https://mcp2cli.dev/install.sh | sh

Or with wget:

Terminal window
wget -qO- https://mcp2cli.dev/install.sh | sh

2. With an AI agent

Paste this prompt into Claude, Cursor, or any coding agent — it will fetch the SKILL.md instructions and set up a config for your MCP server:

Read https://mcp2cli.dev/SKILL.md and set up a cli for my mcp server

3. With cargo

If you already have a Rust toolchain:

Terminal window
cargo install --git https://github.com/mcp2cli/source-code --locked

Verify

Terminal window
mcp2cli --version

See the full install guide for requirements, man-page setup, PATH configuration, updating, and uninstall steps.


Your First Server Connection

Option A: Demo Mode (no server needed)

The built-in demo mode uses a file-backed backend — perfect for learning without setting up a real server.

Terminal window
# Create a demo config
mcp2cli config init --name demo --app bridge \
--transport streamable_http --endpoint https://demo.invalid/mcp
# Set it as active
mcp2cli use demo
# Discover capabilities
mcp2cli ls

Option B: Local Stdio Server

Spawn a local MCP server as a subprocess:

Terminal window
# Create config pointing to a local server
mcp2cli config init --name local --app bridge --transport stdio \
--stdio-command npx \
--stdio-args '@modelcontextprotocol/server-everything'
mcp2cli use local
mcp2cli ls

Option C: Remote HTTP Server

Connect to a running HTTP MCP server:

Terminal window
mcp2cli config init --name remote --app bridge \
--transport streamable_http \
--endpoint http://127.0.0.1:3001/mcp
mcp2cli use remote
mcp2cli ls

Option D: Ad-Hoc (no config file)

Skip configuration entirely with --url or --stdio:

Terminal window
# HTTP server — just point and go
mcp2cli --url http://127.0.0.1:3001/mcp ls
# Stdio server — just run
mcp2cli --stdio "npx @modelcontextprotocol/server-everything" ls

Explore What the Server Offers

Terminal window
# List everything
mcp2cli ls
# Filter by type
mcp2cli ls --tools # Tools only
mcp2cli ls --resources # Resources only
mcp2cli ls --prompts # Prompts only
# Search
mcp2cli ls --filter echo

Call a Tool

Server tools become typed CLI commands. Flags come directly from JSON Schema:

Terminal window
# Simple tool call
mcp2cli echo --message "hello world"
# Tool with multiple arguments
mcp2cli add --a 5 --b 3
# Tool with complex arguments
mcp2cli deploy --tags '["alpha","beta"]' --config '{"replicas":3}'

Read a Resource

Terminal window
# By URI
mcp2cli get demo://resource/readme.md
# Resource template (parameterized)
mcp2cli user-profile --user-id 42

Run a Prompt

Terminal window
mcp2cli simple-prompt
mcp2cli complex-prompt --temperature 0.7 --style concise

Make your server feel like a standalone application:

Terminal window
mcp2cli link create --name work
# Now use it directly
work ls
work echo --message "hello from alias"
work doctor

JSON Output for Scripts

Every command supports structured JSON output:

Terminal window
# JSON envelope
work --json ls
# Pipe to jq
work --json echo --message hello | jq '.data'
# NDJSON for streaming
work --output ndjson ls

What’s Next?

GoalRead
Configure timeout, logging, eventsConfiguration Reference
Customize command names and groupingProfile Overlays
Run background jobsBackground Jobs
Set up CI/CD pipelinesShell Scripting with MCP
Connect AI agentsAI Agents + MCP via CLI
Manage multiple serversNamed Configs & Aliases
Keep connections warmDaemon Mode