Apify Mcpc

Developer tools

The most compatible MCP CLI client. Supports: Tools, Resources, Prompts, Completions, Tasks, Skills, stdio and streamable HTTP, MCP versions 2024-10-07 through 2026-07-28, persistent sessions, OAuth 2.1 with DCR, CIMD, client credentials, and ID-JAG, OS keychain, --json for code mode, grep for tool discovery, proxy for AI sandboxes, x402, and more.

Your AI app calls the Apify Mcpc MCP server, which does the developer tools work and sends the result back to the chat.

About Apify Mcpc

Apify Mcpc is the official MCP server from apify, filed in our directory under developer tools. The most compatible MCP CLI client. Supports: Tools, Resources, Prompts, Completions, Tasks, Skills, stdio and streamable HTTP, MCP versions 2024-10-07 through 2026-07-28, persistent sessions, OAuth 2.1 with DCR, CIMD, client credentials, and ID-JAG, OS keychain, --json for code mode, grep for tool discovery, proxy for AI sandboxes, x402, and more.

At a glance

Publisher
apify, the company behind the product
Runs
See the README for setup
Written in
TypeScript
License
Apache-2.0
GitHub stars
1,126

How to set up Apify Mcpc

  1. Follow the install steps in the Apify Mcpc README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Apify Mcpc README for keys or settings; the registry lists none that Apify Mcpc requires.
  3. Add Apify Mcpc to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Apify Mcpc tools to confirm the connection.
  5. Run one read-only task with Apify Mcpc first, and keep your app asking before each tool call until the results look right.

Apify Mcpc compared with similar servers

  • Mcd Saver Strategist by hujjun has fewer GitHub stars than Apify Mcpc (1.1k against 1.1k); Apify Mcpc is official while Mcd Saver Strategist is a community server, and Mcd Saver Strategist runs as a remote server and Apify Mcpc runs on your own machine.
  • Inspo by Nutlope has more GitHub stars than Apify Mcpc (1.1k against 1.1k); Apify Mcpc is official while Inspo is a community server, and Inspo runs as a remote server and Apify Mcpc runs on your own machine.
  • SSH by classfang has fewer GitHub stars than Apify Mcpc (1.1k against 1.1k); Apify Mcpc is official while SSH is a community server, and both run locally.

Before you connect Apify Mcpc

  • Give Apify Mcpc its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Apify Mcpc tool call until you trust what it does with them.
  • Treat text that Apify Mcpc fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Apify Mcpc on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Apify Mcpc

How marketing and sales teams put Apify Mcpc to work, by company size. Pick the size closest to yours and start Apify Mcpc on one use case.

Small business

  • A small business with a developer can use Apify Mcpc to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Apify Mcpc to explain and fix a marketing site issue without context switching between tools.
  • Apify Mcpc runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Apify Mcpc to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Apify Mcpc to keep scripts and automations documented and versioned as they change.
  • Start Apify Mcpc on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Apify Mcpc with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Apify Mcpc so web and marketing engineering share one reviewed way of working with AI.
  • Because Apify Mcpc comes from apify, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Apify Mcpc README

From apify/mcpc on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

mcpc, a universal MCP CLI client

mcpc is a command-line client for the Model Context Protocol (MCP) that maps MCP operations to intuitive shell commands.

Use it to inspect and debug MCP servers and to script repeatable MCP workflows in plain shell. mcpc gives AI agents access to most capabilities of the 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, Resources, Prompts, Tasks, Skills, Completions, Notifications, over both 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, DCR, client credentials, and enterprise-managed auth, uses OS keychain for credentials storage.
  • 🤖 AI sandboxing - Proxy MCP server connections to protect credentials from untrusted 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. Here's how it compares to other MCP CLI clients (see Related work for the full table, legend, and notes):

Demo:

Table of contents

  • Motivation
  • Install
  • Quickstart
  • Usage
  • Sessions
  • Authentication
  • MCP proxy
  • AI agents
  • Agentic payments (x402)
  • MCP support
  • Configuration
  • Security
  • Errors
  • Development
  • Related work
  • License

Motivation

Many AI agents misuse MCP. They treat tools as prompt-time function calls, repeatedly injecting tool definitions and results into the context. Tokens get wasted, context rots, the agent gets slower and less reliable, leading to the popular conclusion: "MCP sucks, CLIs are better".

mcpc challenges that narrative. It maps (almost) every MCP operation to an intuitive CLI command that agents pick up from --help alone. Any agent with shell access gets full MCP support without wiring up dozens of MCP functions. Just one Bash() tool, and mcpc handles the rest:


 ┌──────────┐   Bash()   ┌────────┐    MCP    ┌────────────┐
 │ AI agent │ ─────────► │  mcpc  │ ────────► │ MCP server │
 └──────────┘            └────────┘           └────────────┘
                                     Sessions, OAuth, Tools,
                                     Resources, Prompts,
                                     Tasks, Skills, x402, ...

CLI is the perfect local interface between agents and MCP, while MCP remains the standard remote interface for server discovery, authentication, and access control. The two aren't exclusive, they're complementary.

As a bonus, the same mcpc configuration, OAuth profiles, and live sessions can be shared across many AI agents on the same machine. Authenticate once, reuse everywhere.

Install

With Homebrew (macOS and Linux), which brings its own Node.js:

brew install mcpc

With Nix (from nixpkgs unstable):

nix profile install nixpkgs#mcpc

Otherwise install the latest Node.js or Bun first, then:

npm install -g @apify/mcpc

# Or with Bun
bun install -g @apify/mcpc

Linux: credentials use the OS keychain via the Secret Service API. GNOME/KDE desktops work out of the box. On headless/CI systems, mcpc falls back to a file-based store (~/.mcpc/credentials.json, mode 0600).

To force the keychain on headless systems, install gnome-keyring (via apt-get, dnf, or pacman) and run:

dbus-run-session -- bash -c "echo -n 'password' | gnome-keyring-daemon --unlock && mcpc ..."

Quickstart

# List all active sessions and saved authentication profiles
mcpc

# Log in to a remote MCP server and save OAuth credentials for future use
mcpc login mcp.apify.com

# Create a persistent session and interact with it
mcpc connect mcp.apify.com @test
mcpc @test              # show server info and capabilities
mcpc @test tools-list   # list available tools
mcpc @test tools-call search-actors keywords:="website crawler"

# Use JSON mode for scripting
mcpc --json @test tools-list

# Use a local MCP server package (stdio) referenced from a config file
mcpc connect ./.vscode/mcp.json:filesystem @fs
mcpc @fs tools-list

Usage

Usage: mcpc [<@session>] [<command>] [options]

Universal command-line client for the Model Context Protocol (MCP).

Commands:
  connect [<server>] [@session]  Connect to an MCP server and start a new named @session
  close <@session>               Close a session
  restart <@session>             Restart a session (losing all state)
  login <server>                 Log in to a server and save an OAuth profile
  logout <server>                Delete an OAuth profile for a server
  clean [resources...]           Clean up mcpc data (sessions, profiles, logs, all)
  grep <pattern>                 Search tools and instructions across all active sessions
  x402 [subcommand] [args...]    Configure an x402 payment wallet (EXPERIMENTAL)
  help [command] [subcommand]    Show help for a command

Options:
  --json                         Output in JSON format for scripting
  --verbose                      Enable debug logging
  --profile <name>               OAuth profile for the server ("default" if not provided)
  --timeout <seconds>            Request timeout in seconds (default: 60)
  --max-chars <n>                Truncate output to n characters (ignored in --json mode)
  --insecure                     Skip TLS certificate verification (for self-signed certs)
  -v, --version                  Output the version number
  -h, --help                     Display help

MCP session commands (after connecting):
  <@session>                     Show MCP server info, capabilities, and tools overview
  <@session> grep <pattern>      Search tools and instructions
  <@session> tools-list          List all server tools
  <@session> tools-get <name>    Get tool details and schema
  <@session> tools-call <name> [arg:=val ... | <json> | <stdin]
  <@session> tasks-list
  <@session> tasks-get <taskId>
  <@session> tasks-result <taskId>
  <@session> tasks-cancel <taskId>
  <@session> prompts-list
  <@session> prompts-get <name> [arg:=val ... | <json> | <stdin]
  <@session> completion-complete prompt|resource <ref> <arg:=val ... | <json> | <stdin>
  <@session> resources-list
  <@session> resources-read <uri> [-o <file> | --raw]
  <@session> resources-subscribe <uri> <file>
  <@session> resources-unsubscribe <uri>
  <@session> resources-templates-list
  <@session> resources-directory-read <uri>
  <@session> skills-list
  <@session> skills-get <skill> [file] [--raw]
  <@session> logging-set-level <level>
  <@session> ping
  <@session> server-discover
  <@session> logs [-n N] [--follow] [--since 1h]

Run "mcpc" without arguments to show active sessions and OAuth profiles.
Run "mcpc --json" to get the same data as `{ sessions: [...], profiles: [...] }`.

Agent guide: mcpc help --skill

REFERENCE.md collects the full --help output of every command in one page. In your terminal, run mcpc help <command> to see the same help for a single command.

General actions

With no arguments, mcpc lists all active sessions and saved OAuth profiles:

# List all sessions and OAuth profiles (also in JSON mode)
mcpc
mcpc --json

# Show command help or version
mcpc --help
mcpc --version

# Clean stale sessions and old log files
mcpc clean
Server formats

The connect, login, and logout commands accept a <server> argument in these formats:

  • Remote URL (e.g. mcp.apify.com or https://mcp.apify.com), scheme defaults to https://
  • Config file entry (e.g. ~/.vscode/mcp.json:filesystem), file:entry-name syntax

connect additionally supports two bulk forms that connect many servers at once:

  • Config file without an entry (e.g. ~/.vscode/mcp.json), connect every server in the file
  • No argument (mcpc connect), auto-discover MCP config files in the current directory and your home dir (.mcp.json, mcp.json, .cursor/mcp.json, .vscode/mcp.json, ~/.claude.json, Claude Desktop, Windsurf, Kiro, …) and connect everything found (run mcpc connect --help for the full list).
mcpc connect                      # discover standard config files and connect all servers
mcpc connect ~/.vscode/mcp.json   # connect every server in one file

Bulk connects auto-generate session names (so they don't take an @session) and skip local stdio servers by default, pass --stdio to include them. Each discovered config file is listed with its servers, the names of the headers they send, and their status (● live, ✗ failed); files that can't be used are shown as (0 servers) or (invalid) with the reason, rather than silently ignored. The command waits for every handshake to finish (with a progress spinner in human mode); --json reports each server's details. If every server fails to connect, the command exits with a non-zero code.

Auto-discovery does not trust config files in the current directory to read environment variables. A .mcp.json checked into a repository could carry "headers": { "X": "${GITHUB_TOKEN}" } (or ${SECRET} in a hostname) pointed at an attacker's server, and a bare mcpc connect in that checkout would send the secret on the first request. So mcpc connect skips every project-scope entry that references a ${VAR}, in url, headers, command, args or env, with or without --stdio, and shows which variables it would have read; it also refuses -H, which would go to every discovered server. Files under your home directory are your own and expand ${VAR} as usual. To connect a skipped entry, review the file and name it explicitly (mcpc connect ./.mcp.json): naming a file is the trust step.

MCP commands

All MCP commands go through a named session created with connect:

# Connect to a remote server and create a session
mcpc connect mcp.apify.com @apify
mcpc @apify tools-list
mcpc @apify tools-call search-apify-docs query:="What are Actors?"

# Connect to a local server via config file entry
mcpc connect ~/.vscode/mcp.json:filesystem @fs
mcpc @fs tools-list
mcpc @fs tools-call list_directory path:=/

See MCP support for details about all supported MCP features and commands.

Command arguments

The tools-call and prompts-get commands accept arguments as positional parameters after the tool/prompt name:

# Key:=value pairs (auto-parsed: tries JSON, falls back to string)
mcpc @session tools-call <tool-name> greeting:="hello world" count:=10 enabled:=true
mcpc @session tools-call <tool-name> config:='{"key":"value"}' items:='[1,2,3]'

# Force string type with JSON quotes
mcpc @session tools-call <tool-name> id:='"123"' flag:='"true"'

# Inline JSON object (if first arg starts with {)
mcpc @session tools-call <tool-name> '{"greeting":"hello world","count":10}'

# Read from stdin (automatic when no positional args and input is piped)
echo '{"greeting":"hello","count":10}' | mcpc @session tools-call <tool-name>
cat args.json | mcpc @session tools-call <tool-name>

Auto-parsing rules for key:=value: valid JSON keeps its type (count:=10 → number, enabled:=true → boolean, cfg:='{"k":"v"}' → object); anything else is a string (greeting:=hello → "hello"). Force a string literal with JSON quotes: id:='"123"'. Inline JSON (an object) is detected when the first arg starts with {. Stdin is read when no positional args are given and input is piped.

Pitfalls: no spaces around := (use query:=hello world, not query := ...); quote the whole argument when it contains shell expansions ("query:=${VAR}"). For complex inputs, prefer piping JSON via stdin.

Grep (search across sessions)

mcpc grep searches tools, resources, and prompts across all active sessions or within a single session:

# Search tools and server instructions in all active sessions
mcpc grep "search"

# Search within a single session
mcpc @apify grep "actor"

# Search resources and prompts instead of the default tools and instructions
mcpc grep "config" --resources --prompts

# Regex search
mcpc grep "search|find" -E

# Case-sensitive search (default is case-insensitive)
mcpc grep "Search" --case-sensitive

# Limit results
mcpc grep "e" -m 5

# JSON output for scripting
mcpc grep "actor" --json

By default, grep searches tools and server instructions. Use --resources or --prompts to search those types instead (combine with --tools or --instructions to mix and match). Sessions that are crashed or unavailable are shown with their status rather than silently skipped. Like grep(1), the command exits with code 0 when there are matches and 1 when there are none.

The grep command is useful for dynamic tool discovery, also called Tool search tool by Anthropic or Dynamic context discovery by Cursor. Rather than loading all tools into the AI agent's context, the agent can use grep to discover the right tool for the job, and only load the relevant tools into the context when needed to reduce token usage and improve accuracy.

JSON mode

By default, mcpc prints output in Markdown-ish text format with colors, making it easy for both humans and AIs to read.

With --json option, mcpc always emits only a single JSON object (or array), to enable scripting. For all MCP commands, the returned objects are always consistent with the MCP specification. On success, the JSON object is printed to stdout, on error to stderr.

Note that --json is not available for mcpc --help. For login, --json prints a single { profile, serverUrl, scopes } object on stdout (interactive prompts go to stderr).

Sessions

Up to protocol version 2025-11-25, MCP was a stateful protocol: clients and servers negotiate protocol version and capabilities in an initialize handshake, and then communicate within a persistent session. Protocol version 2026-07-28 made MCP stateless, there is no handshake or server-side session anymore, and every request stands on its own.

mcpc keeps one session-based workflow on top of both: you first connect a named session, then interact with the server through it. On stateful servers the session maps directly to the protocol-level MCP session. On stateless (2026-07-28) servers the session abstracts the protocol away, a lightweight bridge process still holds the connection, the negotiated protocol version, and client-side state, so everything built on "connect first, then interact" keeps working the same: cached tool listings, searching across sessions with grep, server keepalive and status checks by periodic probing, change notifications, resource-to-file syncs, and automatic OAuth token refresh. It is also more efficient than forcing every MCP command to rediscover the server and reauthenticate.

The protocol version is negotiated automatically (mcpc @session shows the result). To pin one exact version instead, pass --protocol-version to connect (e.g. mcpc connect mcp.apify.com --protocol-version 2025-11-25), the connection then fails if the server does not support that version. Config file entries can set the same via a protocolVersion field.

Sessions are given names prefixed with @ (e.g. @apify), which then serve as unique references in commands.

# Create a persistent session
mcpc connect mcp.apify.com @apify

# List all sessions and OAuth profiles
mcpc

# Run MCP commands in the session
mcpc @apify tools-list

# Restart the session (kills and restarts the bridge process)
mcpc @apify restart    # or: mcpc restart @apify

# Close the session (terminates the bridge process)
mcpc @apify close      # or: mcpc close @apify

# ...now the session name "@apify" is forgotten and available for future use

A session name stays bound to the server it was created for. Running connect again with the same name and server revives the session if its bridge is down, using the options of that command; with a different server it is refused, so close the session first or pick another name.

Session lifecycle

Session metadata is saved in ~/.mcpc/sessions.json, authentication tokens in the OS keychain. The bridge process keeps the session alive with periodic pings (server/discover probes on 2026-07-28 servers) and auto-reconnects on network failures or its own crashes (10s cooldown on failed retries).

Session states:

State Meaning
🟢live Bridge process running and server responding
🟡connecting Initial bridge startup in progress (mcpc connect)
🟡reconnecting Bridge crashed or lost auth; auto-reconnecting in the background
🟡disconnected Bridge process running but server unreachable; auto-recovers when server responds
🟡crashed Bridge process crashed or was killed; auto-reconnects in the background
🔴unauthorized Server rejected authentication (401/403) or token refresh failed; re-run login then restart
🔴expired Server rejected session ID (404, stateful servers only); requires restart

mcpc never removes sessions automatically, failed ones stay flagged with a recovery hint in the error message. Use mcpc @apify restart to kill the bridge and open a fresh connection (with a fresh MCP-Session-Id on stateful servers), or mcpc @apify close to remove the session entirely. You can also remove dead sessions by running mcpc clean, and all sessions by running mcpc clean all (see Cleanup).

Authentication

mcpc supports all standard MCP authorization methods.

Anonymous access

For local servers (stdio) or remote servers (Streamable HTTP) which do not require credentials, mcpc can be used without authentication:

mcpc connect mcp.apify.com @test
mcpc @test tools-list
Bearer token authentication

For remote servers that require a Bearer token (but not OAuth), use the --header flag to pass the token. All headers are stored securely in the OS keychain for the session, but they are not saved as reusable OAuth profiles. This means --header must be provided again whenever you connect a new session.

# Create a session with a Bearer token (token saved to keychain for this session only)
mcpc connect https://mcp.apify.com @apify --header "Authorization: Bearer ${APIFY_TOKEN}"

# Use the session (Bearer token is loaded from keychain automatically)
mcpc @apify tools-list
OAuth profiles

For OAuth-enabled remote MCP servers, mcpc implements the full OAuth 2.1 flow with PKCE as mandated by the MCP authorization spec: WWW-Authenticate 401 challenges, Protected Resource Metadata and authorization server metadata discovery, all three client registration approaches, resource indicators (RFC 8707), and automatic refresh-token rotation.

The OAuth authentication always needs to be initiated by the user calling the login command, which opens a web browser with a login screen. mcpc never opens the web browser on its own.

The OAuth credentials for specific servers are securely stored as authentication profiles - reusable credentials that allow you to:

  • Authenticate once, use credentials across multiple commands or sessions
  • Use different accounts (profiles) with the same server
  • Manage credentials independently from sessions

Key concepts:

  • Authentication profile: Named set of OAuth credentials for a specific server (stored in ~/.mcpc/profiles.json + OS keychain)
  • Session: Active connection to a server that may reference an authentication profile (stored in ~/.mcpc/sessions.json)
  • Default profile: When --profile is not specified, mcpc uses the authentication profile named default

Example:

# Login to server and save 'default' authentication profile for future use
mcpc login mcp.apify.com

# Use named authentication profile instead of 'default'
mcpc login mcp.apify.com --profile work

# Create two sessions using the two different credentials
mcpc connect mcp.apify.com @apify-personal
mcpc connect mcp.apify.com @apify-work --profile work

# Both sessions now work independently
mcpc @apify-personal tools-list  # Uses personal account
mcpc @apify-work tools-list      # Uses work account

# Re-authenticate existing profile (e.g., to refresh or change scopes)
mcpc login mcp.apify.com --profile work

# Delete "default" and "work" authentication profiles
mcpc logout mcp.apify.com
mcpc logout mcp.apify.com --profile work
Client registration approaches

When logging in, mcpc supports all three OAuth client registration approaches defined in the MCP authorization spec, picking the one the authorization server advertises in its OAuth metadata:

Approach mcpc login flags
Pre-registration --client-id (and optional --client-secret)
Client ID Metadata Documents (CIMD) default (or --client-metadata-url <url>)
Dynamic Client Registration (DCR) fallback (or force with --no-client-metadata-url or --client-name <name>)

mcpc ships with a hosted Client ID Metadata Document so every installation presents the same client identity to CIMD-capable authorization servers. When the authorization server advertises client_id_metadata_document_supported: true, the CIMD URL is used as the client_id; otherwise mcpc falls back to Dynamic Client Registration.

# Default: mcpc's hosted CIMD is used automatically (no flags needed).
mcpc login mcp.apify.com

# Pre-registered OAuth client (public or confidential), skips CIMD.
mcpc login mcp.example.com --client-id <id> [--client-secret <secret>]

# Pre-registered client whose redirect URI was registered with localhost
# instead of 127.0.0.1 (e.g. http://localhost:3118/callback).
mcpc login mcp.example.com --client-id <id> --callback-host localhost --callback-port 3118

# Custom CIMD: override the default with your own hosted document.
mcpc login mcp.example.com --client-metadata-url https://example.com/my-client.json

# Disable CIMD: force Dynamic Client Registration even if the server supports CIMD.
mcpc login mcp.example.com --no-client-metadata-url

# Dynamic Client Registration under a client name other than "mcpc" (disables CIMD).
mcpc login mcp.example.com --client-name "My Agent"

See the MCP authorization spec for details on each approach and the format of Client ID Metadata Documents.

MCP authorization extensions

Besides the interactive browser login, mcpc supports two official MCP authorization extensions, selected with mcpc login --grant <grant>. Both save an authentication profile like a regular login, and mcpc declares both extensions to every server it connects to.

OAuth client credentials

The io.modelcontextprotocol/oauth-client-credentials extension is for non-interactive, machine-to-machine use such as CI/CD and daemons, no browser: mcpc login <server> --grant client-credentials --client-id <id> --client-secret <secret> (or a private-key JWT assertion via --client-key, RFC 7523). Access tokens are fetched and refreshed automatically; pin a non-discoverable token endpoint with --token-endpoint <url>.

Enterprise-managed authorization

The io.modelcontextprotocol/enterprise-managed-authorization extension (SEP-990) is for organizations that control MCP server access centrally through their identity provider (e.g. Okta). You sign in once with corporate SSO, and mcpc then obtains MCP server tokens via identity assertion grants (ID-JAG), no per-server consent screens:

mcpc login mcp.example.com --grant id-jag \
  --idp https://acme.okta.com --idp-client-id <idp-client> \
  --client-id <mcp-as-client> --client-secret <secret>

Both clients are pre-registered by your IT team: --idp-client-id at the enterprise IdP (add --idp-client-secret for confidential clients), --client-id/--client-secret at the MCP server's authorization server. The SSO session is kept alive with the IdP's refresh token; when it expires, affected sessions turn unauthorized with a re-login hint.

See MCP extensions for the full list of extensions mcpc supports.

Authentication precedence

When connecting, mcpc picks one auth source based on the flags you pass, explicit flags always win over stored profiles, and credentials are never silently downgraded. If a profile is missing, expired, or invalid, mcpc fails with an error that includes the right mcpc login command to recover.

Flag Behavior
--header "Authorization: ..." Use explicit header; skip OAuth auto-detection. Cannot combine with --profile.
--profile <name> Require the named profile to exist.
--no-profile Connect anonymously even if a default profile exists.
--x402 [scheme] Skip OAuth auto-detection; use x402 payments instead. Optional scheme: auto (default), upto, exact. Combine with --profile to use both.
(none) Use default profile if it exists; otherwise connect anonymously.

Headers set on a config file entry (file:entry) apply to the server that entry describes.

# Default: 'default' profile if it exists, else anonymous
mcpc connect mcp.apify.com @apify-personal

# Specific profile (fails if missing)
mcpc connect mcp.apify.com @apify-work --profile work

# Explicit bearer token (no profile)
mcpc connect mcp.apify.com @apify --header "Authorization: Bearer ${APIFY_TOKEN}"

# Skip default profile, connect anonymously
mcpc connect mcp.apify.com @apify-anon --no-profile

# x402 micropayments instead of OAuth
mcpc connect mcp.example.com @paid --x402

MCP proxy

For stronger isolation, mcpc can expose an MCP session as a new local proxy MCP server using the --proxy option. The proxy forwards all MCP requests to the upstream server but never exposes the original authentication tokens to the client. This is useful when you want to give someone or something MCP access without revealing your credentials. The proxy itself serves protocol 2025-11-25 to its clients, regardless of the protocol version negotiated with the upstream server. See also AI sandboxes.

# Human authenticates to a remote server
mcpc login mcp.apify.com

# Create authenticated session with proxy server on localhost:8080
mcpc connect mcp.apify.com @open-relay --proxy 8080

# Now any MCP client can connect to proxy like to a regular MCP server
# The client has NO access to the original OAuth tokens or HTTP headers
# Note: localhost/127.0.0.1/[::1] URLs default to http:// (no scheme needed)
mcpc connect localhost:8080 @sandboxed
mcpc @sandboxed tools-call search-actors keywords:="web scraper"

# Optionally protect the proxy with a bearer token (stored in the OS keychain)
mcpc connect mcp.apify.com @secure-relay --proxy 8081 --proxy-bearer-token secret123
# To use the proxy, the caller needs to pass the bearer token in the Authorization header
mcpc connect localhost:8081 @sandboxed2 --header "Authorization: Bearer secret123"

Proxy options for connect command:

Option Description
--proxy [host:]port Start proxy MCP server. Default host: 127.0.0.1 (localhost only)
--proxy-bearer-token <token> Requires Authorization: Bearer <token> header to access the proxy MCP server

Security model:

  • Localhost by default: --proxy 8080 binds to 127.0.0.1 only, preventing network access
  • Tokens hidden: Original OAuth tokens and/or HTTP headers are never exposed to proxy clients
  • Optional auth: Use --proxy-bearer-token to add another layer of security
  • Explicit opt-in: Proxy only starts when --proxy flag is provided

Binding to network interfaces:

# Localhost only (default, most secure)
mcpc connect mcp.apify.com @relay --proxy 8080

# Bind to all interfaces (allows network access - use with caution!)
mcpc connect mcp.apify.com @relay --proxy 0.0.0.0:8080

# Bind to specific interface
mcpc connect mcp.apify.com @relay --proxy 192.168.1.100:8080

# IPv6 loopback (brackets around the address)
mcpc connect mcp.apify.com @relay --proxy '[::1]:8080'

When listing sessions, proxy info is displayed prominently:

mcpc
# @relay → https://mcp.apify.com (HTTP, OAuth: default) [proxy: 127.0.0.1:8080]

AI agents

mcpc is designed for CLI-enabled AI agents like Claude Code or Codex CLI, supporting both interactive tool calling and code mode.

Tool calling mode - Agents call mcpc commands to dynamically explore and interact with MCP servers, using the default text output. This is similar to how MCP connectors in ChatGPT or Claude work, but the CLI gives you more flexibility and longer operation timeouts.

# Discover available tools
mcpc @server tools-list

# Get tool schema
mcpc @server tools-get search

# Call a tool
mcpc @server tools-call search query:="hello world"

Code mode - Once agents understand the server's capabilities, they can write shell scripts that compose multiple mcpc commands with --json output, see Scripting below. This can be more accurate and use fewer tokens than tool calling for complex workflows. Pair with schema validation to catch breaking changes early.

Scripting

Use --json for machine-readable output (stdout on success, stderr on error). JSON output of all MCP commands follows the MCP specification strictly.

# Chain tools across sessions
mcpc --json @apify tools-call search-actors keywords:="scraper" \
  | jq '.content[0].text | fromjson | .items[0].id' \
  | xargs -I {} mcpc @apify tools-call get-actor actorId:="{}"

# Batch operations
for tool in $(mcpc --json @server tools-list | jq -r '.[].name'); do
  mcpc --json @server tools-get "$tool" > "schemas/$tool.json"
done

For a complete example script, see docs/examples/company-lookup.sh.

Schema validation

The tools-get and tools-call commands support --schema to validate a tool's schema against an expected snapshot. This helps detect breaking changes early in scripts and CI:

# Save expected schema
mcpc --json @apify tools-get search-actors > expected.json

# Validate without calling (read-only check)
mcpc @apify tools-get search-actors --schema expected.json

# Validate before calling (fails if schema changed incompatibly)
mcpc @apify tools-call search-actors --schema expected.json keywords:="test"

Available schema validation modes (--schema-mode):

  • compatible (default)
    • Input schema: new optional fields OK, required fields must have the same type.
    • Output schema: new fields OK, removed required fields cause error.
  • strict - Both input and output schemas must match exactly, including all fields, types, and descriptions
  • ignore - Skip validation completely (YOLO)
AI sandboxes

To ensure AI coding agents don't perform destructive actions or leak credentials, it's always a good idea to run them in a code sandbox with limited access to your resources.

The proxy MCP server feature provides a security boundary for AI agents:

  1. Human creates authentication profile: mcpc login mcp.apify.com --profile ai-access
  2. Human creates session: mcpc connect mcp.apify.com @ai-sandbox --profile ai-access --proxy 8080
  3. AI runs inside a sandbox: If the sandbox's access is limited to localhost:8080, it can only interact with the MCP server through the @ai-sandbox session, without access to the original OAuth credentials, HTTP headers, or mcpc configuration.

This ensures AI agents operate only with pre-authorized credentials, preventing unauthorized access to MCP servers. The human controls which servers the AI can access and with what permissions (OAuth scopes).

IMPORTANT: Beware that MCP proxy will not make an insecure MCP server secure. Local stdio servers will still have access to your local system, and HTTP servers to provided auth credentials, and both can easily perform destructive actions or leak credentials on their own, or let MCP clients do such actions. Always use only trusted local and remote MCP servers and limit their access to the necessary minimum.

Agent skills

mcpc ships a built-in agent skill that always matches the installed version:

mcpc help --skill

No setup is needed: mcpc help mentions mcpc help --skill, so an agent can discover and load the guide on its own when it needs it.

If you'd rather have the skill installed persistently (e.g. for Claude Code or any agent that loads SKILL.md files), mcpc help --skill prints a valid SKILL.md, just redirect it into your skills directory:

mkdir -p ~/.claude/skills/mcpc
mcpc help --skill > ~/.claude/skills/mcpc/SKILL.md

That copy is a snapshot; re-run it after upgrading mcpc to refresh it.

Separately, mcpc also acts as a client for skills served by MCP servers, see Skills for the skills-list / skills-get commands.

Agentic payments (x402)

⚠️ Experimental. This feature is under active development and may change.

mcpc has experimental support for the x402 payment protocol, which enables AI agents to autonomously pay for MCP tool calls using cryptocurrency. When an MCP server charges for a tool call (HTTP 402), mcpc automatically signs a USDC payment on the Base blockchain and retries the request, no human intervention needed.

This is entirely opt-in: existing functionality is unaffected unless you explicitly pass the --x402 flag.

How it works

Two schemes are supported, both signed by your local wallet:

  • exact, EIP-3009 TransferWithAuthorization. Settles on-chain at call-time.
  • upto, Permit2 PermitWitnessTransferFrom. You sign a max cap; the facilitator settles accumulated usage later. First use auto-grants a one-time USDC.approve(PERMIT2, MAX_UINT256) (needs a tiny native ETH float for gas).

Flow: server returns HTTP 402 with a PAYMENT-REQUIRED header → mcpc picks the best scheme per your preference, signs, and retries with PAYMENT-SIGNATURE → server verifies and fulfills. Tools that advertise pricing in _meta.x402 are signed proactively, skipping the 402 round-trip.

Read the rest of the Apify Mcpc README on GitHub

Questions about Apify Mcpc

What is the Apify Mcpc MCP server?

The most compatible MCP CLI client. Supports: Tools, Resources, Prompts, Completions, Tasks, Skills, stdio and streamable HTTP, MCP versions 2024-10-07 through 2026-07-28, persistent sessions, OAuth 2.1 with DCR, CIMD, client credentials, and ID-JAG, OS keychain, --json for code mode, grep for tool discovery, proxy for AI sandboxes, x402, and more. Apify Mcpc is published by apify, the company behind the product, on GitHub at apify/mcpc, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Apify Mcpc MCP server?

Apify Mcpc doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (apify/mcpc). Like most servers, Apify Mcpc ends with a command or URL you paste into your AI app's MCP config.

Does Apify Mcpc need an API key?

The registry lists no required keys for Apify Mcpc. Check the Apify Mcpc README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Apify Mcpc an official MCP server?

Yes. Apify Mcpc is published by apify, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is Apify Mcpc under?

Apify Mcpc is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Apify Mcpc; the service it connects to has its own terms.