Agent skill

mcpc

Use mcpc CLI to interact with MCP servers - call tools, read resources, get prompts. Use this when working with Model Context Protocol servers, calling MCP tools, or accessing MCP resources programmatically.

Stars 418
Forks 34

Install this agent skill to your Project

npx add-skill https://github.com/apify/mcp-cli/tree/main/docs/claude-skill

SKILL.md

mcpc: MCP command-line client

Use mcpc to interact with MCP (Model Context Protocol) servers from the command line. This is more efficient than function calling - generate shell commands instead.

Quick reference

bash
# List sessions and auth profiles
mcpc

# Show server info
mcpc <server>
mcpc @<session>

# Tools
mcpc <target> tools-list
mcpc <target> tools-get <tool-name>
mcpc <target> tools-call <tool-name> key:=value key2:="string value"

# Resources
mcpc <target> resources-list
mcpc <target> resources-read <uri>

# Prompts
mcpc <target> prompts-list
mcpc <target> prompts-get <prompt-name> arg1:=value1

# Sessions (persistent connections)
mcpc <server> connect @<name>
mcpc @<name> <command>
mcpc @<name> close

# Authentication
mcpc <server> login
mcpc <server> logout

Target types

  • mcp.example.com - Direct HTTPS connection to remote server
  • localhost:8080 or 127.0.0.1:8080 - Local HTTP server (http:// is default for localhost)
  • @session-name - Named persistent session (faster, maintains state)
  • config-entry - Entry from config file (with --config)

Passing arguments

Arguments use key:=value syntax. Values are auto-parsed as JSON when valid:

bash
# String values
mcpc @s tools-call search query:="hello world"

# Numbers, booleans, null (auto-parsed as JSON)
mcpc @s tools-call search query:="hello" limit:=10 enabled:=true

# Complex JSON values
mcpc @s tools-call search config:='{"nested":"value"}' items:='[1,2,3]'

# Force string type with JSON quotes
mcpc @s tools-call search id:='"123"'

# Inline JSON object (if first arg starts with { or [)
mcpc @s tools-call search '{"query":"hello","limit":10}'

# From stdin (auto-detected when piped)
echo '{"query":"hello"}' | mcpc @s tools-call search

JSON output for scripting

Always use --json flag for machine-readable output:

bash
# Get tools as JSON
mcpc --json @apify tools-list

# Call tool and parse result with jq
mcpc --json @apify tools-call search query:="test" | jq '.content[0].text'

# Chain commands
mcpc --json @server1 tools-call get-data | mcpc @server2 tools-call process

Sessions for efficiency

Create sessions for repeated interactions:

bash
# Create session (or reconnect if exists)
mcpc mcp.apify.com connect @apify

# Use session (faster - no reconnection overhead)
mcpc @apify tools-list
mcpc @apify tools-call search query:="test"

# Restart session (useful after server updates)
mcpc @apify restart

# Close when done
mcpc @apify close

Session states:

  • 🟢 live - Bridge running, server might or might not be responding
  • 🟡 crashed - Bridge crashed; auto-restarts on next use
  • 🔴 expired - Server rejected session; needs close and reconnect

Authentication

OAuth (interactive login):

bash
mcpc mcp.apify.com login
mcpc mcp.apify.com connect @apify

Bearer token:

bash
mcpc -H "Authorization: Bearer $TOKEN" mcp.apify.com tools-list
mcpc -H "Authorization: Bearer $TOKEN" mcp.apify.com connect @myserver

Proxy server for AI isolation

Create a proxy MCP server that hides authentication tokens:

bash
# Human creates authenticated session with proxy
mcpc mcp.apify.com connect @ai-proxy --proxy 8080

# AI agent connects to proxy (no access to original tokens)
# Note: localhost defaults to http://
mcpc localhost:8080 tools-list
mcpc 127.0.0.1:8080 connect @sandboxed

Common patterns

List and inspect tools:

bash
mcpc @s tools-list
mcpc @s tools-get tool-name

Call tool and extract text result:

bash
mcpc --json @s tools-call my-tool | jq -r '.content[0].text'

Read resource content:

bash
mcpc @s resources-read "file:///path/to/file"

Use config file for local servers:

bash
mcpc --config .vscode/mcp.json filesystem resources-list

Exit codes

  • 0 - Success
  • 1 - Client error (invalid arguments)
  • 2 - Server error (tool failed)
  • 3 - Network error
  • 4 - Authentication error

Debugging

bash
# Verbose output shows protocol details
mcpc --verbose @s tools-call my-tool

Example script

See docs/examples/company-lookup.sh for a complete example of an AI-generated script that validates prerequisites and calls MCP tools.

Expand your agent's capabilities with these related and highly-rated skills.

apify/agent-skills

apify-actor-development

Develop, debug, and deploy Apify Actors - serverless cloud programs for web scraping, automation, and data processing. Use when creating new Actors, modifying existing ones, or troubleshooting Actor code.

1,813 189
Explore
apify/agent-skills

apify-actorization

Convert existing projects into Apify Actors - serverless cloud programs. Actorize JavaScript/TypeScript (SDK with Actor.init/exit), Python (async context manager), or any language (CLI wrapper). Use when migrating code to Apify, wrapping CLI tools as Actors, or adding Actor SDK to existing projects.

1,813 189
Explore
apify/agent-skills

apify-generate-output-schema

Generate output schemas (dataset_schema.json, output_schema.json, key_value_store_schema.json) for an Apify Actor by analyzing its source code. Use when creating or updating Actor output schemas.

1,813 189
Explore
apify/agent-skills

apify-ultimate-scraper

Universal AI-powered web scraper for any platform. Scrape data from Instagram, Facebook, TikTok, YouTube, Google Maps, Google Search, Google Trends, Booking.com, and TripAdvisor. Use for lead generation, brand monitoring, competitor analysis, influencer discovery, trend research, content analytics, audience analysis, or any data extraction task.

1,813 189
Explore
davila7/claude-code-templates

verl-rl-training

Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.

23,776 2,298
Explore
davila7/claude-code-templates

openrlhf-training

High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.

23,776 2,298
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results