$git clone https://github.com/apify/mcpcmcpc is a command-line client for the Model Context Protocol (MCP) that maps every MCP operation to an intuitive command for interactive shell use, scripting, and AI agents.
| 1 | # mcpc — a universal MCP CLI client |
| 2 | |
| 3 |  |
| 4 | |
| 5 | [](https://www.npmjs.com/package/@apify/mcpc) |
| 6 | [](https://www.npmjs.com/package/@apify/mcpc) |
| 7 | [](https://github.com/apify/mcpc/actions/workflows/ci.yml) |
| 8 | [](https://github.com/apify/mcpc/blob/main/LICENSE) |
| 9 | |
| 10 | `mcpc` is a command-line client for the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) |
| 11 | that maps every MCP operation to an intuitive shell command. |
| 12 | |
| 13 | Use it to manually inspect and debug MCP servers, to script repeatable MCP workflows in plain shell, or to |
| 14 | give AI agents the full MCP protocol through a single `Bash()` tool call, so they can interact with any MCP |
| 15 | server and its latest capabilities using the most universal interface there is: the UNIX shell. |
| 16 | |
| 17 | **Key features:** |
| 18 | |
| 19 | - 🔧 [**Full MCP support**](#mcp-support) - Tools, prompts, resources, async tasks, skills, notifications, and logging over stdio and Streamable HTTP. |
| 20 | - 🔄 **Persistent sessions** - Keep multiple stateful connections to different servers alive in parallel. |
| 21 | - 🗺️ **Progressive tool discovery** - Find relevant MCP tools on the fly to save tokens and increase accuracy. |
| 22 | - 🔌 **Code mode** - JSON output composes with `jq`, `xargs`, and shell pipelines for MCP workflows as shell scripts. |
| 23 | - 🔒 **Secure** - Full OAuth 2.1 support with CIMD and DCR, uses OS keychain for credentials storage. |
| 24 | - 🤖 **AI sandboxing** - Proxy MCP server connections to protect credentials from AI-generated code. |
| 25 | - 🪶 **Lightweight** - Minimal dependencies, works on Mac/Win/Linux, doesn't use LLMs on its own. |
| 26 | - 💸 **Agentic payments** - Experimental support for the [x402](https://www.x402.org/) protocol on [Base](https://www.base.org/). |
| 27 | |
| 28 |  |
| 29 | |
| 30 | ## Table of contents |
| 31 | |
| 32 | <!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 33 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 34 | |
| 35 | - [Motivation](#motivation) |
| 36 | - [Install](#install) |
| 37 | - [Quickstart](#quickstart) |
| 38 | - [Usage](#usage) |
| 39 | - [Sessions](#sessions) |
| 40 | - [Authentication](#authentication) |
| 41 | - [MCP proxy](#mcp-proxy) |
| 42 | - [AI agents](#ai-agents) |
| 43 | - [Agentic payments (x402)](#agentic-payments-x402) |
| 44 | - [MCP support](#mcp-support) |
| 45 | - [Configuration](#configuration) |
| 46 | - [Security](#security) |
| 47 | - [Errors](#errors) |
| 48 | - [Development](#development) |
| 49 | - [Related work](#related-work) |
| 50 | - [License](#license) |
| 51 | |
| 52 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 53 | |
| 54 | ## Motivation |
| 55 | |
| 56 | Many AI agents misuse MCP. They treat tools as prompt-time function calls, repeatedly injecting |
| 57 | tool definitions and results into the context. Tokens get wasted, context rots, the |
| 58 | agent gets slower and less reliable — hence the popular conclusion: _"MCP sucks, CLIs are better"_. |
| 59 | |
| 60 | `mcpc` challenges that narrative. It maps every MCP operation to an intuitive CLI command that |
| 61 | agents pick up from `--help` alone. Any agent with shell access gets full MCP support without |
| 62 | wiring up dozens of MCP functions. Just one `Bash()` tool, and `mcpc` handles the rest: |
| 63 | |
| 64 | ``` |
| 65 | |
| 66 | ┌──────────┐ Bash() ┌────────┐ MCP ┌────────────┐ |
| 67 | │ AI agent │ ─────────► │ mcpc │ ────────► │ MCP server │ |
| 68 | └──────────┘ └────────┘ └────────────┘ |
| 69 | Sessions, OAuth, Tools, |
| 70 | Resources, Prompts, |
| 71 | Tasks, x402, ... |
| 72 | ``` |
| 73 | |
| 74 | CLI is the perfect _local_ interface between agents and MCP, while MCP remains the |
| 75 | standard _remote_ interface for server discovery, authentication, payments, and access control. |
| 76 | The two aren't exclusive – they're complementary. |
| 77 | |
| 78 | As a bonus, the same `mcpc` configuration, OAuth prof |