mcp-cli
mcpc is a CLI client for MCP. It supports persistent sessions, stdio/HTTP, OAuth 2.1, JSON output for code mode, proxy for AI sandboxes, and much more.
claude mcp add --transport stdio apify-mcp-cli npx -y @apify/mcpc
How to use
mcpc is a universal MCP command-line client that lets you interact with MCP servers through a shell-friendly interface. It maps MCP operations to intuitive commands, enabling you to connect to remote MCP servers, manage authentication profiles, and run tools, prompts, and resources in JSON mode for scripting. With persistent sessions, you can keep multiple server connections alive and switch between them as needed. The tool also supports a code mode that emits JSON output, making it friendly for scripting and AI agents to parse and act on MCP data.
To use mcpc, install the CLI (via npm/pnpm/bun), then connect to an MCP server using mcpc connect <server> <@session>. After connecting, you can list tools, call a tool with tools-call, read resources, or open an interactive shell for ongoing interaction. Use mcpc --json to emit JSON for automation, and mcpc login to authenticate and store OAuth credentials for future sessions. For scripting, you can reference local servers via config files and perform batch operations across multiple sessions.
How to install
Prerequisites:
- Node.js (LTS) and npm, or Bun
- Basic familiarity with MCP and command-line tools
Installation steps:
- Install the mcpc CLI from npm (or via npx on first use):
npm install -g @apify/mcpc
Or use Bun:
bun install -g @apify/mcpc
- Verify installation:
mcpc --version
-
Optional: set up OS keychain support on Linux/macOS environments. See the README for details about libsecret and secret service daemons if you plan to use password-based OAuth storage.
-
Connect to a server:
mcpc connect mcp.apify.com @myserver
- Authenticate and save credentials:
mcpc login mcp.apify.com
- Start using mcpc to list tools, call tools, and manage sessions:
mcpc @myserver tools-list
mcpc @myserver tools-call search-actors keywords:="website crawler"
Additional notes
Tips and common issues:
- mcpc uses OAuth profiles to store credentials. Use mcpc login to create and persist profiles for servers you connect to.
- For scripting, prefer JSON output with mcpc --json to simplify parsing with tools like jq.
- If you’re running in headless environments, mcpc falls back to a file-based credential store at ~/.mcpc/credentials when OS keychain is unavailable.
- When using local/stdio MCP servers via config files, mcpc supports the config file entry format like ~/.vscode/mcp.json:filesystem.
- The x402 support (experimental) enables paying for MCP tool calls; use mcpc x402 with appropriate subcommands and wallet configuration if you need this feature.
- Ensure network access to MCP servers, and be aware of session-scoped commands that require an active @session (e.g., tools-list, tools-call, shell).
Related MCP Servers
mxcp
Model eXecution + Context Protocol: Enterprise-Grade Data-to-AI Infrastructure
dynamic-shell
Dynamic Shell Command MCP Server
create -kit
Scaffold a production-ready Model Context Protocol (MCP) server in seconds.
litemcp
A minimal, lightweight client designed to simplify SDK adoption into MCP
bibble
Transform your terminal into an intelligent AI workspace with autonomous tool-calling and multi-step workflow execution, real-time streaming responses, persistent chat history, and comprehensive MCP (Model Context Protocol) client functionality for seamless tool integration.
mcp-tidy
CLI tool to visualize and manage MCP server configurations in Claude Code. List servers, analyze usage statistics, and clean up unused servers