Give your agent Cloud access
Install the remote MCP so your agent can search traces, run SQL, read reports, and manage evals. The human approves every project binding and permission scope.
Measure your agent
Run your coding agent through the Caveman gateway with zero code changes. Spend, latency, and traces show up attributed to the agent.
Connect over MCP
The remote MCP endpoint lives at your installation’s/mcp path. It exposes Cloud operations as tools the agent can call. This connection manages evidence and evals; it does not route LLM traffic.
Install the MCP server
Open Connect your coding agent in the Caveman Cloud console, select your agent, and copy the install command. You can also browse the connection page at/mcp/connect.
Keep existing MCP servers when editing configuration. Credentials stay in the host’s OAuth storage, never in chat logs or repository files.
- Claude Code
- Codex
- Cursor
Run this command in your repository, then open
/mcp in Claude Code and authenticate Caveman Cloud.Approve the connection
After installing, authenticate from the host’s MCP settings. A browser OAuth flow asks you to approve the intended project and access level. Metadata reads are selected by default. Captured content, authoring, and paid runs require separate choices. Do not approve your own connection, change retention consent, or bypass a refusal.Verify with caveman_context
Copying a command does not prove the connection is live. Callcaveman_context after connecting and confirm the intended project and endpoint before the agent reads or writes anything.
If the project, endpoint, or access does not match what you expect, stop project reads and writes immediately. Continue only independent repository inspection while blocked.
What the agent can do once connected
Once verified, the agent can call Cloud operations through six stable tools:caveman_context, caveman_search, caveman_describe, caveman_read, caveman_write, and caveman_draft. Exact operation schemas require authorized search and describe calls.
Common next steps:
- Set up automated project setup
- Query traces and spend with SQL
- Run evals to build quality evidence
- Review and approve improvement proposals
Permissions and revoking
MCP respects the same permission model as the console and CLI. An agent connection defaults to metadata reads. Access to billing data, payloads, authoring, and paid execution must be granted explicitly. To review or revoke a connection, see Team and Admin. For the full tool reference and protocol details, see MCP.Route agent traffic through the gateway
If you want the coding agent’s own model calls to flow through Caveman Cloud so spend, traces, and attribution show up in your project, use the open-sourcecaveman CLI. This is a separate CLI from cvm.
Install the caveman CLI
caveman and cave. It is one TypeScript file with no runtime dependencies.
Run a registered agent
Use the agent shortcut:aider, claude, codex, gemini, hermes, openclaw, and opencode. Each profile declares the agent’s binaries, wire protocol, and how to inject the gateway base URL. The injection method is one of three: literal environment variables, inline config env content, or a temporary config file overlay. The wire protocol must be one the proxy speaks natively: anthropic-messages, openai-chat, openai-responses, or gemini-generatecontent.
Attribution header
The profile sets thex-cave-agent header so telemetry knows which agent made the request. You can also label the session with a workflow:
How it works with Claude Code
Claude Code readsANTHROPIC_BASE_URL from the environment. The CLI sets this to the gateway URL and injects your Caveman API key. No code changes are required inside Claude Code itself.
Troubleshooting
The agent cannot find the MCP server after installation
The agent cannot find the MCP server after installation
Keep existing MCP servers when editing config. Make sure the endpoint URL ends in
/mcp with no query string, hash, or credentials embedded. Restart the agent after adding the server.caveman_context reports a project mismatch
caveman_context reports a project mismatch
Stop project reads and writes immediately. Confirm the intended project ID and endpoint in the console, then reinstall if the connection was bound to the wrong project. Copying a command is not proof of a valid connection.
The agent sees no Cloud operations
The agent sees no Cloud operations
Permissions are checked live. If the connection was approved with metadata reads only, content reads, authoring, and paid runs will not appear. Re-authenticate from the host’s MCP settings and grant the additional scopes.
caveman claude says the binary is missing
caveman claude says the binary is missing
Install the agent itself first. Each profile includes an install hint, such as
npm i -g @anthropic-ai/claude-code. The caveman CLI wraps the agent, it does not replace it.I do not see spend attribution for the agent
I do not see spend attribution for the agent
Make sure the agent routes through the gateway on your personal key, either with
caveman <agent> or caveman run -- <agent>, or with the direct-connect settings from Developers → Connect an agent. Launches that do not route through the gateway will not emit attributed telemetry. Verify the x-cave-agent header is present in your trace headers. See Coding agent analytics for per-agent setup.