Loading...
Loading...
Use the mcpc CLI to work with MCP (Model Context Protocol) servers from the shell - connect to a server as a persistent session, then list and call tools, read resources, get prompts, and run async tasks. Use --json for scripting and code mode. Reach for this whenever interacting with MCP servers, calling MCP tools, or accessing MCP resources programmatically.
npx skill4agent add apify/mcpc mcpcmcpc--json@session@sessionmcpc <url> tools-list--jsonjqmcpc --help # all commands + global options
mcpc help connect # help for one command
mcpc @apify tools-call foo --help # that tool's details + schemamcpc # list sessions + auth profiles (start here)
mcpc connect mcp.apify.com @apify # connect, create the @apify session
mcpc @apify # server info, capabilities, tools overview
mcpc @apify tools-list # list tools
mcpc @apify tools-call <tool> q:="hi" # call a toolconnectmcp.example.comhttps://localhost:8080127.0.0.1:8080http://localhost127.0.0.1~/.vscode/mcp.json:filesystemfile:entry~/.vscode/mcp.jsonmcpc connect mcp.apify.com @apify # remote server, explicit session name
mcpc connect mcp.apify.com # auto-name the session → @apify
mcpc connect ./.vscode/mcp.json:fs @fs # one config entry (stdio or http)
mcpc connect # discover standard configs + connect everything@sessionmcp.apify.com@apify--stdio--protocol-version <version>--protocol-version 2025-11-25loginlogouthttp(s)://mcpc # list all sessions and their state
mcpc @apify # session details, capabilities, tools (also reports the
# negotiated MCP version and the transport carrying it)
mcpc restart @apify # restart (after server updates, or to recover an 'expired' session)
mcpc close @apify # tear the session downmcpc login <server>mcpc restart @sessionmcpc restart @sessionmcpc @apify tools-list # compact list with inline param signatures
mcpc @apify tools-list --full # full JSON schemas
mcpc @apify tools-get <tool> # one tool's details + schema
mcpc @apify tools-call <tool> --help # shortcut for tools-get: that tool's details + schema
mcpc grep "search" # search tools + instructions across ALL sessions
mcpc @apify grep "actor" --resources # search one session
# grep filters: --tools/--resources/--prompts/--instructions, -E regex, -s case-sensitive, -m <n> max
# grep exits 0 on match, 1 on no matches (grep convention)greptools-getmcpc --json @apify tools-get <tool> > expected.json # snapshot the schema
mcpc @apify tools-call <tool> --schema expected.json <args> # fail fast if it drifted
# also on tools-get; --schema-mode strict | compatible (default) | ignore# 1) key:=value — values are auto-parsed as JSON, falling back to string
mcpc @apify tools-call search query:="hello world" limit:=10 enabled:=true
mcpc @apify tools-call search config:='{"nested":"value"}' items:='[1,2,3]'
mcpc @apify tools-call search id:='"123"' # force a string with JSON quotes
# 2) inline JSON — when the first arg starts with { or [
mcpc @apify tools-call search '{"query":"hello","limit":10}'
# 3) stdin — auto-detected when piped and no positional args are given
echo '{"query":"hello"}' | mcpc @apify tools-call search--jsonmcpc --json @apify tools-list | jq -r '.[].name'
mcpc --json @apify tools-call search query:="test" | jq -r '.content[0].text'
# chain tools across calls/sessions
mcpc --json @apify tools-call search-actors keywords:="scraper" \
| jq -r '.content[0].text | fromjson | .items[0].id' \
| xargs -I{} mcpc --json @apify tools-call get-actor actorId:="{}"mcpc --json{ "sessions": [...], "profiles": [...] }mcpc @apify resources-list
mcpc @apify resources-read "file:///path/to/file" # -o <file> to save (binary-safe), --raw to pipe
mcpc @apify resources-templates-list
mcpc @apify resources-subscribe <uri> <file> # keep local <file> in sync with the resource
mcpc @apify resources-unsubscribe <uri> # stop syncing, keep the file
mcpc @apify prompts-list
mcpc @apify prompts-get <name> arg1:=value1 # same argument syntax as tools-call (values coerced to strings)mcpc @apify tools-call <tool> --task <args> # run as a task with a progress spinner; Ctrl+C (or
# ESC) leaves it running and prints the task ID.
# Falls back to a normal sync call if the server has no task support.
mcpc @apify tools-call <tool> --detach <args> # start and return the task ID immediately
mcpc @apify tasks-list
mcpc @apify tasks-get <taskId> # status
mcpc @apify tasks-result <taskId> # block until the final result is ready
mcpc @apify tasks-cancel <taskId>tools-list[task:optional|required|forbidden]--task--detachtasks-*--detachtaskId# OAuth — interactive browser login, saved as a reusable profile
mcpc login mcp.apify.com # "default" profile
mcpc login mcp.apify.com --profile work # a named profile (multiple accounts per server)
mcpc connect mcp.apify.com @apify --profile work
mcpc logout mcp.apify.com
# Bearer token — not stored as a profile; kept per-session
mcpc connect mcp.apify.com @s -H "Authorization: Bearer $TOKEN"
mcpc @s tools-list
# Machine-to-machine (CI/CD, daemons) — client-credentials grant, no browser needed
mcpc login mcp.example.com --grant client-credentials --client-id my-svc --client-secret s3cr3t
# Enterprise-managed authorization — SSO once at the corporate IdP (e.g. Okta),
# then identity assertion grants (ID-JAG); clients are pre-registered by IT
mcpc login mcp.example.com --grant id-jag --idp https://acme.okta.com \
--idp-client-id idp-client --client-id mcp-client --client-secret s3cr3tdefault--no-profile--profile <name># Human: authenticated session + proxy listening on :8080
mcpc connect mcp.apify.com @ai-proxy --profile ai-access --proxy 8080
# AI in a sandbox limited to localhost: no access to the original tokens
mcpc connect localhost:8080 @sandboxed
mcpc @sandboxed tools-listmcpc @apify skills-list
mcpc @apify skills-get <name> --raw # print the SKILL.md markdown (pipe to a file or an LLM)mcpc help --skillskills-listskills-get--json # machine-readable, MCP-spec-shaped output (code mode)
--verbose # protocol-level debug logging (JSON-RPC, transport)
--profile <name> # OAuth profile to use ("default" if omitted)
--timeout <seconds> # request timeout in seconds (default: 60)
--max-chars <n> # truncate human-readable output to n chars (ignored with --json)
--insecure # skip TLS verification (self-signed certs only)--no-profile--stdio--proxy-Hconnectmcpc--x402mcpc help x402mcpc --verbose @apify tools-call <tool> # protocol-level detail (JSON-RPC, transport)
mcpc @apify logs # bridge log; -n <N>, --follow, --since 1h
mcpc @apify ping # round-trip health check
mcpc @apify server-discover # what the server advertises now (2026-07-28 only;
# on older servers use mcpc @apify instead)
mcpc @apify logging-set-level debug # deprecated; 2025-11-25 servers only, will be removed
mcpc clean # tidy stale sessions/logs (also: mcpc clean all)01grep234