API Reference
CLI and MCP server
Deploy and manage agents from a terminal, CI, or a coding agent over MCP
camelrun deploys and manages agents from a terminal, a script or CI. Coding
agents such as Claude Code, Cursor and Codex get the same operations over MCP,
so they can write an agent's manifest, deploy it, talk to the agent and read what
it did. Use the hosted MCP server at https://run.camelai.com/mcp with
nothing to install, or run camelrun mcp on your machine.
Hosted MCP server
The hosted server speaks Streamable HTTP. Add it by URL and sign in when your client asks: the sign-in page (GitHub, or an API token) asks you to allow the client, which then acts for your account until you revoke it.
claude mcp add --transport http camelrun https://run.camelai.com/mcp
# Then run /mcp in Claude Code to sign in. Or skip signing in with a key:
claude mcp add --transport http camelrun https://run.camelai.com/mcp --header "Authorization: Bearer art_..."The hosted server's deploy takes a manifest's YAML as text. It reads no files
or environment variables, so systemPromptFile, specFile and ${NAME} are
refused: write the values in, or deploy from your machine with the CLI.
Connected apps appear in the console under API tokens, where you revoke them. To connect a client to one agent instead, see Agents as MCP servers. Their access tokens last an hour and can't create API tokens.
Install the CLI
npm install -g @camelai/camelrun # Node 22+; or npx @camelai/camelrun <command>
camelrun login # paste an API key from the console's API tokens pagelogin checks the key and saves it to ~/.config/camelrun/credentials.json.
CAMELAI_API_KEY and CAMELAI_URL (for a self-hosted runtime), or --api-key
and --url, take precedence over it.
Deploy from a manifest
An agent's configuration lives in your repository as agent.yaml, and
camelrun deploy makes it so in camelRun. camelrun init [key] writes one to
start from.
key: support # the same key is the same definition
name: Support
model: anthropic/claude-sonnet-5-5
systemPromptFile: prompts/support.md
builtins: [web_search, ask_user]
mcpServers:
- name: app
url: https://app.example.com/mcp
auth: { type: bearer, token: "${APP_MCP_TOKEN}" }
agents: # keyed agents made from it on deploy
- key: support-main
- key: support-eu
systemPromptAppend: Answer customers in the EU region.- Every field except
key,agents,systemPromptFileand an OpenAPI source'sspecFileis sent as the definition. ${NAME}and${NAME:-default}read the environment, so credentials stay out of the file. An unset variable is an error.- Each entry of
agentsis a keyed agent made from the definition, with the fields ofPOST /v1/agents. - A file can hold several manifests separated by
---.
camelrun deploy # ./agent.yaml (or agent.yml, agent.json)
camelrun deploy agents/*.yaml # several files
camelrun deploy --dry-run # what would change, credentials hidden
camelrun deploy --apply # also move live agents to the new revisionDeploying upserts each definition by its key: created the first time, a new
revision when the manifest changed it, and unchanged otherwise, so you can
deploy on every push. Agents keep the revision they were made with until you
deploy with --apply, which reconfigures each live agent between its turns and
keeps its history.
Commands
An agent is named by its key or its id (client_...), and a definition by its
key or id (def_...).
| Command | |
|---|---|
whoami | The account the key belongs to, and its default model |
models [--available] | The model catalog, or the models your account can use |
init [key] [--model m] | Write agent.yaml |
deploy [file...] [--apply] [--dry-run] | Deploy manifests |
agents list, agents get <agent> | List agents, or show one's configuration and tool sources |
agents create <key> [--definition d] [--model m] [--prompt text] | Create an agent outside a manifest |
agents configure <agent> [--model m] [--prompt text] [--prompt-append text] [--thinking level] | Change one agent between runs |
agents delete <agent> --yes | Stop an agent and delete its history and files |
run <agent> <message...> | Send a message and print the reply |
runs get <agent> <requestId> [--wait s] | A run's result |
history <agent> [--limit n] | Its latest messages, tool calls included |
abort <agent> | Stop its running turn |
inputs [agent], answer <agent> <inputId> <value> | Questions and approvals waiting on someone, and answering them |
schedules list|add|delete <agent> | Wake-ups: add --text t --in 3600 [--every 86400] |
definitions list|get|agents|delete | Definitions, and the revision each agent has |
run waits for the run to end. --wait 30 waits at most 30 seconds, and
--no-wait prints the request id to follow with runs get. --from user-1
says who is sending, and --steer gives the message to a running turn.
answer takes true or false for an approval, the chosen label or your own
words for a question, the fields as JSON for a form, or decline.
Output is text on a terminal and JSON otherwise (or with --json). Exit codes
are 0 for done, 1 for an error or a failed run, and 2 when the run waits
on a person.
Local MCP server
camelrun mcp serves the same tools over stdio, with the CLI's credentials. Its
deploy also takes file, a path to a manifest, and reads the files and
environment variables it names.
claude mcp add camelrun -- npx -y @camelai/camelrun mcp
# or with a key of its own:
claude mcp add camelrun -e CAMELAI_API_KEY=art_... -- npx -y @camelai/camelrun mcpMCP tools
Both servers offer deploy, list_agents, get_agent, create_agent,
configure_agent, delete_agent, run_agent, get_run, agent_history,
abort_agent, list_inputs, answer_input, the schedule and definition tools,
list_models, whoami, and read_docs, which reads the camelRun docs.
run_agent and get_run wait at most wait seconds (default 50) so a call
stays inside clients' tool timeouts. A run still going comes back as running
with its requestId. A run that asks a person something comes back as
input_required, and the coding agent should ask you and answer with what you
decided. delete_agent and delete_definition are marked destructive, so
clients that confirm such calls ask you first.
A key or a connected app can create and delete every agent in your account. Give a coding agent a key of its own, or connect it with OAuth, so you can revoke it alone.