
一个适用于MCP的通用CLI客户端。MCPC支持持久会话、stdio/HTTP、OAuth 2.1、任务、代码模式的JSON输出、AI沙盒代理、x402等。
概览
mcpc 是模型上下文协议(MCP)的命令行客户端,将每个 MCP 操作映射到一个直观的命令,用于交互式壳层使用、脚本编写和 AI 代理。 mcpc 是你为 MCP 打造的新瑞士军刀。你可以用它手动检查和调试 MCP 服务器,编写可重复的 MCP 工作流,或者通过最通用的界面——UNIX shell,为 AI 编码代理提供现代 MCP 的全部功能。 - 🔧 - 工具、提示、资源、异步任务、技能、通知,以及通过stdio和可流式HTTP进行日志记录。- 🔄 - 保持多个带状态的连接与不同服务器并行保持活跃。- 🗺️ - 实时查找相关MCP工具以节省令牌并提高准确性。- 🔌 - JSON输出与jq、xargs和MCP工作流程的shell流水线合成,作为shell脚本。- 🔒 - 完全支持OAuth 2.1,支持CIMD和DCR,使用操作系统密钥链存储凭证。- 🤖 - 代理MCP服务器连接以保护凭证免受AI生成代码侵害。
概述(AI 翻译)
mcpc 是模型上下文协议(MCP)的命令行客户端
它将每个MCP操作映射到一个直观的shell命令。
你可以用它手动检查和调试MCP服务器,在纯shell中编写可重复的MCP工作流程脚本,或者
通过一个 Bash() 工具调用,为 AI 代理提供了完整的 MCP 协议,使其能够与任何 MCP 交互
服务器及其最新功能,采用了最通用的编程接口:UNIX shell。
主要功能:
- 🔧 完整MCP支持 - 工具、提示、资源、异步任务、技能、通知,以及通过stdio和可流式HTTP进行日志记录。
- 🔄 持久会话 - 无论服务器协议是有状态还是无状态协议,都保持多台服务器的并行连接。
- 🗺️ 渐进式工具发现 - 随时查找相关MCP工具,节省代币并提高准确性。
- 🔌 代码模式 - JSON 输出与
jq、[xargs以及 MCP 工作流程的 shell 流水线组成 shell 脚本。 - 🔒 Secure - 完全支持 OAuth 2.1,支持 CIMD 和 DCR,使用操作系统密钥链存储凭证。
- 🤖 AI 沙箱 - 通过代理 MCP 服务器连接保护凭证免受 AI 生成代码侵害。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
mcpc — a universal MCP CLI client
mcpc is a command-line client for the Model Context Protocol (MCP)
that maps every MCP operation to an intuitive shell command.
Use it to manually inspect and debug MCP servers, to script repeatable MCP workflows in plain shell, or to
give AI agents the full MCP protocol through a single Bash() tool call, so they can interact with any MCP
server and its latest capabilities using the most universal programming interface there is: the UNIX shell.
Key features:
- 🔧 Full MCP support - Tools, prompts, resources, async tasks, skills, notifications, and logging over stdio and Streamable HTTP.
- 🔄 Persistent sessions - Keep connections to multiple servers alive in parallel, whether the server protocol is stateful or stateless.
- 🗺️ Progressive tool discovery - Find relevant MCP tools on the fly to save tokens and increase accuracy.
- 🔌 Code mode - JSON output composes with
jq,xargs, and shell pipelines for MCP workflows as shell scripts. - 🔒 Secure - Full OAuth 2.1 support with CIMD and DCR, uses OS keychain for credentials storage.
- 🤖 AI sandboxing - Proxy MCP server connections to protect credentials from AI-generated code.
- 🪶 Lightweight - Minimal dependencies, works on Mac/Win/Linux, doesn’t use LLMs on its own.
- 💸 Agentic payments - Experimental support for the x402 protocol on Base.
mcpc is the most MCP specification-compliant CLI client available:
the only one that covers tools, resources, prompts, async tasks, and skills, plus the OAuth client-credentials and
enterprise-managed authorization extensions, on the latest protocol version. Here’s how it compares to other MCP CLI
clients (see Related work for the full table, legend, and notes):

Table of contents
安装
npx -y @modelcontextprotocol/server-filesystem /tmp配置
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com",
"headers": {
"Authorization": "Bearer ${APIFY_TOKEN}"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"env": {
"DEBUG": "mcp:*"
}
},
"local-package": {
"command": "node",
"args": ["/path/to/server.js"]
}
}
}