mcp2cli

Documentation

mcp2cli turns any MCP server into a native command-line application. Server tools become verbs, resources become nouns, prompts become workflows — no MCP protocol knowledge required at the command line.

Terminal window
# One binary. Any server. Real CLI commands.
work echo --message hello
work email send --to user@example.com --body "Meeting at 3"
work get file:///project/README.md
staging deploy --version 2.1.0 --background

Why mcp2cli?

Problemmcp2cli Solution
MCP requires JSON-RPC plumbing to interact with serversAuto-discovers capabilities → typed CLI commands
Testing MCP servers needs custom client codemcp2cli ls, mcp2cli echo --message test — instant validation
AI agents can’t easily call MCP toolsJSON output mode + structured envelopes for programmatic parsing
Each server needs its own CLI wrapperOne binary + config files = unlimited server bindings
CI/CD pipelines can’t orchestrate MCP--json output, --non-interactive mode, exit codes, pipes

Architecture at a Glance

graph TB
    subgraph "User Interface"
        CLI["CLI Input<br/>work echo --message hello"]
        JSON["--json output"]
    end

    subgraph "mcp2cli Runtime"
        DISPATCH["Dispatch Router"]
        MANIFEST["Command Manifest<br/>auto-generated from discovery"]
        BRIDGE["Bridge Engine"]
        PROFILE["Profile Overlay<br/>aliases, groups, flags"]
        CACHE["Discovery Cache<br/>offline fallback"]
        DAEMON["Daemon (optional)<br/>warm connections"]
    end

    subgraph "MCP Transport"
        HTTP["Streamable HTTP"]
        STDIO["Stdio subprocess"]
        DEMO["Demo backend"]
    end

    subgraph "MCP Server"
        SERVER["Any MCP Server<br/>tools · resources · prompts"]
    end

    CLI --> DISPATCH
    DISPATCH --> MANIFEST
    MANIFEST --> BRIDGE
    PROFILE -.-> MANIFEST
    CACHE -.-> MANIFEST
    BRIDGE --> HTTP
    BRIDGE --> STDIO
    BRIDGE --> DEMO
    BRIDGE -.-> DAEMON
    HTTP --> SERVER
    STDIO --> SERVER
    BRIDGE --> JSON

Documentation Map

Getting Started

DocumentDescription
Getting StartedInstall, configure, and run your first command in under a minute
Configuration ReferenceComplete YAML config schema with every field explained
CLI ReferenceEvery command, flag, and option in one place
TelemetryWhat’s collected, how to opt out, and how to set up a backend

Feature Guides

Each major feature has its own deep-dive page with examples, diagrams, and best practices.

FeaturePageSummary
Discovery-Driven CLIfeatures/discovery-driven-cli.mdHow server capabilities become typed CLI commands
Profile Overlaysfeatures/profile-overlays.mdRename, hide, group, and customize commands
Transportsfeatures/transports.mdHTTP, Stdio, and Demo transport configuration
Ad-Hoc Connectionsfeatures/ad-hoc-connections.md--url and --stdio for config-free usage
Request Timeoutsfeatures/request-timeouts.mdPer-config and per-command timeout control
Fuzzy Matchingfeatures/fuzzy-matching.md”Did you mean?” suggestions for mistyped commands
Daemon Modefeatures/daemon-mode.mdKeep MCP connections warm between invocations
Background Jobsfeatures/background-jobs.md--background flag and the jobs/tasks system
Event Systemfeatures/event-system.mdWebhooks, Unix sockets, SSE, and command sinks
Authenticationfeatures/authentication.mdToken management and auth flows
Output Formatsfeatures/output-formats.mdHuman, JSON, and NDJSON output modes
Elicitation & Samplingfeatures/elicitation-and-sampling.mdInteractive server-initiated prompts
Named Configs & Aliasesfeatures/named-configs-and-aliases.mdMulti-server setup with symlink aliases

Articles & Guides

In-depth walkthroughs for specific use cases and audiences.

ArticleAudience
AI Agents + MCP via CLIAgent developers who want tool-use through shell
Testing MCP ServersServer authors validating protocol compliance
E2E & Conformance TestingServer authors building structured conformance test suites
Shell Scripting with MCPDevOps teams building CI/CD pipelines
Multi-Server WorkflowsPlatform engineers orchestrating multiple servers
Local Development & PrototypingServer developers iterating on MCP implementations
Platform EngineeringInfrastructure teams automating ops through MCP
From Zero to ProductionEnd-to-end production deployment guide