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.

What it solves

AI agents often misuse the Model Context Protocol (MCP) by injecting massive tool definitions into their context, which wastes tokens and reduces reliability. mcpc solves this by providing a lightweight, command-line interface that maps MCP operations to intuitive shell commands, allowing agents to interact with any MCP server using the universal UNIX shell.

How it works

mcpc acts as a bridge between AI agents and MCP servers. It supports both local (stdio) and remote (Streamable HTTP) servers and maintains persistent, stateful sessions via a lightweight bridge process. It features a "Code mode" that outputs JSON for easy integration with shell pipelines (jq, xargs) and includes a grep command for dynamic tool discovery, allowing agents to search for specific tools rather than loading all available definitions into their context at once.

Who it’s for

  • AI Agent Developers who want to give their agents full MCP support via a single Bash() tool call.
  • Developers looking to manually inspect, debug, or script repeatable MCP workflows in the terminal.
  • Users needing a secure way to manage MCP server authentication (including OAuth 2.1) and session states.

Highlights

  • Full MCP Support: Handles tools, prompts, resources, tasks, and logging.
  • Dynamic Tool Discovery: Uses grep to help agents find relevant tools on the fly to save tokens.
  • Secure Authentication: Implements OAuth 2.1 with PKCE and uses the OS keychain for credential storage.
  • Agentic Payments: Experimental support for the x402 protocol on Base.
  • Persistent Sessions: Maintains stateful connections to multiple servers in parallel.