Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. 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
  1. Verify installation:
mcpc --version
  1. 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.

  2. Connect to a server:

mcpc connect mcp.apify.com @myserver
  1. Authenticate and save credentials:
mcpc login mcp.apify.com
  1. 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

Sponsor this space

Reach thousands of developers