CLI's MCP server gives Claude Code, Cursor and other MCP apps about 100 cli_* tools. Each tool maps to one API endpoint (a few combine two or wait for a result), so an agent using MCP gets the same behaviour, checks and limits as one calling the API directly. To connect an agent, see Connect your AI agent; to add the server to a particular app, see Install in your agent app.
The server tells the agent to read the skill file first. It's available to MCP apps as the resource cli://skill, the same text as /skill.md. It covers sign-in, funding, the deploy loop, guardrails and what to do about each error code.
#The why argument
Every tool that takes arguments also takes why: one sentence, up to 300 characters, on why the agent is doing this. CLI sends it as the X-CLI-Intent header, and it's shown beside the change in the flight recorder and on approval requests, so you can see the agent's reasoning when you review its work (see /docs/flight-recorder).
JSON
{
"name": "cli_create_database",
"arguments": {
"projectId": "prj_…",
"kind": "postgres",
"linkTo": "svc_…",
"why": "The app failed with MISSING_ENV for DATABASE_URL and you asked for a new database."
}
}
#Dry runs and approvals
Tools that change costly or risky things take two extra arguments:
dryRun: describe what would change (cost, restarts, what breaks) without changing anything. Agents should show you the plan first.
approvalId: after a tool answers APPROVAL_REQUIRED, the agent tells you what it asked for and where to approve it, calls cli_wait_for_approval, and if you approve, calls the same tool again with the same arguments plus approvalId.
Takes dryRun and approvalId | Takes approvalId only |
|---|
cli_deploy, cli_update_service, cli_set_plan, cli_create_database, cli_delete_service, cli_deploy_template, cli_environments | cli_remove_domain, cli_restore_backup, cli_query_database, cli_exec |
See Approvals.
#Errors
When a call fails, the tool returns an error result holding CLI's error envelope, so the agent branches on error.code and follows error.remediation (see /docs/errors). The server also tells agents to stop after 3 failed fix attempts.
Two codes come from the MCP server itself rather than the API:
| Code | Meaning |
|---|
LOCAL_SPEND_LIMIT | Paying would go over CLI_SPEND_LIMIT_USDC for this MCP process. Ask the user to fund the project, or to raise the limit |
CLIENT_ERROR | Something failed before reaching CLI (for example the network) |
Every tool tells the app what it does, so the app can ask you at the right moments: whether it only reads (readOnlyHint), whether it changes something that can't be undone (destructiveHint), and whether it reaches outside your account, like deploying from GitHub or sending an email (openWorldHint).
The hosted connectors serve a core set of about 40 of these tools: projects, services and deploys, variables, databases and backups, domains, scheduled jobs, logs and health, cost, and approvals. Claude's connector (see /docs/claude) leaves out money and crypto tools and splits tools that both read and change. ChatGPT's (see /docs/chatgpt) also leaves out running commands, sandboxes and agent keys, refuses secrets, and masks credentials in its answers.
#Server settings
| Variable | Meaning |
|---|
CLI_API_URL | The CLI server |
CLI_API_KEY | A project key (clik_…): works without a wallet, with that key's role and limits |
CLI_AGENT_PRIVATE_KEY | An EVM wallet (signs in, pays on Base) |
CLI_AGENT_SOLANA_KEY | A Solana wallet (pays on Solana; signs in when there's no EVM key) |
CLI_PAY_NETWORK | base or solana, when both wallets are set |
CLI_SPEND_LIMIT_USDC | Most this MCP process may pay over x402 (default 0: it never pays, and asks you instead) |
#Account and money
| Tool | What it does |
|---|
cli_whoami | Signs in if needed and shows this agent's wallet and projects |
cli_wallet | This key's limits: spending cap, spent, remaining, scopes, the services it may change, and the project balance |
cli_topup | Adds credit by paying USDC over x402 from the agent's wallet, on Base or Solana; only what the user authorized |
cli_funding_options | Ways to fund without x402: the project's USDC deposit address and, with usd, a card link for the user to open |
cli_token | The CLI token on Robinhood Chain: price and staking info, a credit quote with the transactions to send, staking transactions, or an address's stakes |
cli_usage | Balance, burn per hour, runway, cost per service, and per-service CPU and memory use with downsize, upsize or keep advice |
cli_set_low_balance_alert | Owners: email or webhook alert when credit drops below an amount in USDC (null turns it off) |
cli_agent_credential | A signed credential of this agent's track record to show another service or person, with optional audience and ttlHours (default 168, at most 720). Needs an API key. With bindWallet: true and a wallet set, it first binds the wallet so the record follows it across projects |
See Agent credentials for what a credential holds and how it's checked.
#Projects and people
| Tool | What it does |
|---|
cli_create_project | Creates a project; the caller becomes its owner |
cli_list_projects | Lists the projects this wallet or key can access |
cli_get_project | Project details: balance (micro-USDC), status, members, services and a top-up URL |
cli_environments | Lists, creates or deletes environments; use an environment's id as projectId in other tools |
cli_add_member | Admins: adds a person by email or GitHub username as viewer, developer or admin |
cli_add_agent | Admins: lets another agent's wallet operate the project, up to a spending cap in USDC |
cli_audit_log | Who changed what, newest first |
#Services and deploys
| Tool | What it does |
|---|
cli_create_service | Creates a service from a git repo or a Docker image (private registries need credentials from the user) |
cli_update_service | Changes copies, volume, start command, port, health check, alerts, monorepo folder, watch paths or sleep; applies on the next deploy |
cli_set_plan | Changes a service's CPU and memory; applies on the next deploy |
cli_delete_service | Stops and deletes a service; a database's data is kept unless deleteData (owner only) |
cli_deploy | Deploys a service and, by default, waits until it's live or failed |
cli_deploy_status | A deploy's current status, with the classified error if it failed |
cli_rollback | Redeploys the previous healthy image of a deploy's service, without rebuilding |
cli_set_previews | Turns pull-request previews on or off for a GitHub service, with empty or copied preview databases |
cli_import | Plans (or with apply, creates) services from Railway, Heroku, Render, Fly, Vercel or Compose config, or a Railway or Heroku token |
cli_list_templates | One-click stacks: what each creates, its inputs and its hourly cost |
cli_deploy_template | Deploys a template into a project, wiring variables and starting databases first |
#Variables
| Tool | What it does |
|---|
cli_set_env | Sets or deletes (null) a service's variables, or loads a whole .env; values are write-only |
cli_check_variables | Checks that every ${{service.KEY}} reference resolves, and lists what the service depends on |
cli_shared_variables | Reads or sets project-wide shared variables, used as ${{shared.KEY}} |
#Databases
| Tool | What it does |
|---|
cli_create_database | Creates and starts a private Postgres, MySQL, Redis or MongoDB, optionally linked to an app |
cli_link_database | Puts a database's connection URL into an app's variables as a secret; redeploy afterwards |
cli_database_access | A database's connection URLs; public: true opens a port for the user's machine, false closes it |
cli_query_database | Runs SQL on Postgres or MySQL (read-only unless an admin allows writes); with no SQL, lists tables |
cli_backup_database | Backs up a database now and waits until it's done |
cli_list_backups | A database's backups and recent restores |
cli_restore_backup | Replaces all data with a backup, after a safety backup; confirm must be the database's name |
#Domains
| Tool | What it does |
|---|
cli_generate_domain | Gives an app a hosted address under CLI's domain, live at once with no DNS |
cli_rename_domain | Changes a generated address's subdomain; the old one stops working |
cli_add_domain | Attaches a custom domain and returns the TXT and CNAME records the user must create |
cli_verify_domain | Checks a custom domain's DNS; success makes it live with HTTPS |
cli_list_domains | A service's custom domains, with status and DNS records |
cli_remove_domain | Detaches a custom domain from its service |
#Cron
| Tool | What it does |
|---|
cli_create_cron | Schedules a command in an app's live image (UTC, at most every 5 minutes), billed per second |
cli_list_cron | A service's cron jobs with their next run and last result |
cli_update_cron | Changes a job's schedule, command or timeout, pauses it, or removes it |
cli_run_cron | Runs a job now and waits; returns status, exit code and masked output |
#Running and debugging
| Tool | What it does |
|---|
cli_logs | Build and runtime logs for one deploy, secrets masked |
cli_service_logs | Recent output from a running service, with text or regex search and error or warn filters over the last 5000 lines |
cli_service_health | Whether an app is up, why not, uptime over 24 hours and 7 days, and recent incidents |
cli_request_metrics | Requests per hour, 4xx and 5xx counts, and p50 and p95 latency |
cli_exec | Runs a shell command in an app's live container and returns output and exit code; wakes a sleeping app first |
cli_events | What happened in a project since a point, optionally waiting for the next event |
cli_explain_error | What an error code means and how to fix it |
cli_known_fixes | For a failed deploy, the changes that fixed the same kind of failure elsewhere (anonymized), with how often each worked |
#Shipping safely and leaving
| Tool | What it does |
|---|
cli_shadow | Runs the next version on a copy of live traffic, shows how it compares, then promotes or discards it |
cli_provenance | The signed record of how a deploy's image was built: repository, commit, digest and builder |
cli_export_manifest | What exporting the project would hold, without secrets (the archive itself is a person's download) |
#AI models and on-chain automation
| Tool | What it does |
|---|
cli_ai | The AI gateway: models and prices, keys for apps (with the variables to set), usage, the monthly cap, and one paid completion |
cli_keeper | Keepers: call a contract through a managed signer on a schedule or on an event, run one now, pause, see its runs |
cli_watch_contract | React to a contract's events: call the app, write them into a Postgres table, or run a job with them |
#Domains, email, sign-in and vector search
| Tool | What it does |
|---|
cli_domain | Search for a domain, buy it from credit (only once the user agrees) and point it at a service, add DNS records, auto-renew |
cli_email | Sending domains, email keys for apps, usage, and sending one email |
cli_app_signin | Sign-in for the user's app: turn it on, list users, disable or enable one |
cli_vector | Turn on vector search (pgvector) for a Postgres database |
#Static sites, functions, the edge and costs
| Tool | What it does |
|---|
cli_static_site | Serve an app's build output as a static site (no container, bandwidth only), or turn it back into a container |
cli_function | Create, update or read a single-file Node or Python function that sleeps when idle |
cli_edge | Rate limits, connection caps, IP allow/deny lists, bot blocking and body limits at the router; what was blocked |
cli_static_ip | Send an app's outbound traffic from fixed IPs for allow-listed APIs and databases |
cli_rightsize | A week of measured use with suggestions and their monthly savings; apply the low-risk ones |
#Workflows, testing, monitoring and forecasts
| Tool | What it does |
|---|
cli_workflow | Durable multi-step workflows: define, start, send events, check, retry or cancel runs |
cli_load_test | Load-test one of the project's apps and read latency, errors and the breaking point |
cli_browser_check | Check pages and flows in a real browser every few minutes, with screenshots on failure |
cli_secrets | Leaked secrets found in code, logs and variables; scan now; mark rotated |
cli_forecast | The month-end and 30-day spend forecast with its range, trends, runway and spikes |
#Checking and setting up
| Tool | What it does |
|---|
cli_doctor | Everything in the project that needs attention, worst first, each with a fix |
cli_detect | How to run a repo: framework, app or static site, start command, port, databases and variables |
#Logs, databases, status and selling
| Tool | What it does |
|---|
cli_log_alerts | Alert when text (or a regex) shows up in an app's output |
cli_db_tools | Schema, saved queries, and migrations that back up first and run in one transaction |
cli_status_notice | Post incidents and maintenance to the public status page, with updates |
cli_paid_apis | What a project sells and earns, and CLI's own pay-per-call APIs |
cli_sell | Charge per call for an app's API and list it in the directory |
#Launching and building
| Tool | What it does |
|---|
cli_go_live | Go-live check for one app, each missing item with its fix (/docs/go-live) |
cli_requests | Latest requests to an app from the router, filtered; replay a GET (/docs/request-inspector) |
cli_compare_environments | What differs between two environments; copy variables across |
cli_unit_economics | Cost per request and per paying caller, and a suggested price per call |
cli_project_map | The project's services, what connects to what, and what each costs, in plain words |
cli_webhook_inbox | A URL that records webhooks; see them and replay them to an app (/docs/webhook-inboxes) |
cli_flags | Feature flags: on, off or a percentage of users, no redeploy (/docs/feature-flags) |
cli_dependencies | Packages with known security problems at the live commit, and fixes for them: a pull request built in a throwaway copy, merged when a person accepts (/docs/dependency-fixes) |
cli_bounties | Find bounties, attempt one with a commit from your fork, check how it went; post and decide your own (/docs/bounties) |
#In Claude's directory connector
The hosted connector (https://api.clicloud.app/mcp, see /docs/claude) serves the same tools with three differences:
- No tools that move money or crypto:
cli_topup, cli_wallet, cli_funding_options, cli_token, cli_keeper, cli_watch_contract, cli_agent_credential, cli_find_api, cli_paid_apis and cli_sell aren't there, and cli_domain can't buy or renew.
- A tool that both reads and changes things is split in two:
cli_<name> reads and cli_<name>_change changes. Every tool is annotated as read-only or as changing something, so Claude asks before changes.
- The server's instructions describe CLI; they don't point at the skill file.
- A smaller set: the six domain tools are one tool,
cli_service_domains (list) and cli_service_domains_change (add, generate, rename, verify, remove); the four cron tools are cli_cron and cli_cron_change; cli_provenance and cli_export_manifest are left out; long descriptions are cut to their first sentences.
- Long jobs answer within about 25 seconds, with
stillRunning and the tool to check it with if they're not done.
#Governance
| Tool | What it does |
|---|
cli_recent_changes | The flight recorder: recent changes with who, why, what, the cost before and after, and whether they can be undone |
cli_undo | Undoes one change from the flight recorder, with the caller's own permissions |
cli_propose_change | Proposes a change instead of making it: CLI builds it in a throwaway copy and asks a person to approve |
cli_wait_for_approval | Waits until a person approves or denies a request, or until a timeout |
#Sandboxes
| Tool | What it does |
|---|
cli_sandbox_create | Starts a throwaway, isolated machine (python, node, ubuntu, go, rust or any image), with no network unless asked |
cli_sandbox_exec | Runs a shell command in a sandbox and returns stdout, stderr, exit code and duration |
cli_sandbox_write_file | Writes a file into a sandbox (text or base64, up to 10 MB) |
cli_sandbox_read_file | Reads a file from a sandbox (text or base64, up to 10 MB) |
cli_sandbox_delete | Deletes a sandbox now; it's billed until this moment |
See Sandboxes.
#Buying
| Tool | What it does |
|---|
cli_find_api | Searches the directory of paid APIs: price per call, uptime, real paid traffic and how to pay |
See Paying for other APIs.
Some features are only in the API, the cli command or the dashboard, for example notification channels, ask, traces and error groups, on-call proposals, managed signers and selling. Agents that can make HTTP calls reach them through the API using the skill file (see /docs/api).