apify/mcpc

A universal CLI client for MCP. mcpc supports persistent sessions, stdio/HTTP, OAuth 2.1, tasks, JSON output for code mode, proxy for AI sandboxes, x402, and more.

747 ★68 forksTypeScriptUpdated 1d ago

What you need to know

A universal MCP CLI client by Apify that maps every MCP operation to an intuitive shell command — persistent named sessions, full OAuth 2.1 (CIMD/DCR), tools/resources/prompts/async tasks/skills over stdio and Streamable HTTP, grep-based progressive tool discovery, JSON code mode for scripting, and experimental x402 agentic payments.

Install

brew install apify/tap/mcpc   # macOS/Linux (brings its own Node.js)
npm install -g @apify/mcpc
bun install -g @apify/mcpc

Usage

  • `mcpc login mcp.apify.com` to log in and save an OAuth profile; `mcpc connect mcp.apify.com @test` to create a persistent session.
  • `mcpc @test tools-list` / `mcpc @test tools-get <name>` / `mcpc @test tools-call <tool> key:="value"` to inspect and call tools.
  • `mcpc grep "search"` searches tools/instructions across all active sessions for progressive tool discovery; `--json` mode composes with jq/xargs for scripting.
  • Bulk connect: `mcpc connect` auto-discovers standard config files (`.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`, `~/.claude.json`, Claude Desktop, Windsurf, etc.).
  • AI sandboxing: `mcpc connect mcp.apify.com @relay --proxy 8080` exposes a local proxy MCP server that never reveals the original auth tokens to the client.

Key features

  • Full MCP support: protocol 2026-07-28 (auto-negotiated), stdio + Streamable HTTP transports, tools, resources (incl. subscriptions), prompts, async tasks, list-change notifications, pagination, server discovery.
  • Full OAuth 2.1 flow with PKCE, CIMD, DCR, resource indicators, and automatic refresh-token rotation; bearer-token and client-credentials (machine-to-machine) grants; enterprise-managed authorization (ID-JAG).
  • Persistent named sessions with auto-reconnect, keepalive pings, and session state reporting.
  • MCP proxy for AI sandboxing; schema validation for CI (`--schema`); built-in agent skill via `mcpc help --skill`.
  • Experimental x402 payment protocol for agents to autonomously pay for MCP tool calls with USDC on Base.

Best for

CLI/scripting and AI-agents-through-Bash() access to any MCP server — debugging servers, automating repeatable MCP workflows in shell, and code-mode integration for Claude Code/Codex-style agents.

Caveats

  • x402 payments are experimental and opt-in; skills support (SEP-2640) and logging-set-level are experimental/deprecated (logging removed by MCP 2026-07-28).
  • Does not use an LLM on its own (no sampling support); async tasks require a 2025-11-25 server (2026-07-28 tasks extension not yet supported).
  • Linux headless/CI systems fall back to a file-based credential store instead of the OS keychain (Secret Service API for GNOME/KDE).
Platforms: macOS · Windows · LinuxClients: Claude Code · Codex CLI · Any Bash()-capable AI agent
Documentation ↗

Reviewed 2026-08-07

Topics

ai-agentsbashclaudeclicode-modecommand-linemcpmcp-clientmodel-context-protocolshell
View on GitHub ↗
Stars
747★
Forks
68
Language
TypeScript
License
Apache-2.0
Created
2025-12-09
Last push
2026-08-06