How it works
- Open your repository in your agentUse a coding agent with terminal access, such as Claude Code, Codex, Cursor, or GitHub Copilot CLI. Copy the prompt above into its chat.
- Sign in and reload the agentYour agent installs Apex and sets up its tools. Complete the Cantina sign-in link in your browser when prompted. Restart the agent or open a new chat if it needs to load the new tools, then paste the same prompt again.
- See your existing scan resultsThe agent checks the connection, selects the workspace for your repository, and reads your latest scan. If more than one workspace matches, it asks you to choose.
Connected means your agent can show your workspace, scan status, and findings. You use the same Cantina account as the web app; no API key is needed for local setup.
What to ask next
Already ran your first scan? Start with its results. Each prompt includes the context your agent needs.
Review my first scan
Bring the results you already have into your agent.
Read https://ai.cantina.xyz/docs/agents.md and summarize my latest Apex scan.Run a scan
Check the scope and available credits, then start one scan.
Read https://ai.cantina.xyz/docs/agents.md and help me scan this repository with Apex.Prepare a fix
Investigate a finding and test a fix in your repository.
Read https://ai.cantina.xyz/docs/agents.md and help me fix an Apex finding.Prefer to set it up yourself?
Use Node.js 20 or newer. Run these commands from the repository you want to connect.
If you ran a trial scan, claim it with apex claim on the same machine before starting a new login.
npm install -g @cantinasecurity/apex-cli@0.1.28
apex loginChoose the command for your installed agent, then restart it or open a new chat.
Claude Code
apex setup claudeRequires the Claude Code CLI. Run from your repository to install its project skill as well as the MCP server.
Codex
apex setup codexRequires the Codex CLI on PATH. Restart Codex after setup so it can load the Apex MCP server and skill.
Copilot CLI
apex setup copilotRequires GitHub Copilot CLI. Restart it after setup so the Apex tools are available.
Cursor and other local MCP clients
For Cursor, merge this into .cursor/mcp.json in your repository, preserving your existing servers. For other local clients, add a stdio server named apex with command apex-mcp and no arguments.
{
"mcpServers": {
"apex": {
"type": "stdio",
"command": "apex-mcp",
"args": []
}
}
}Enable Apex in your agent, open a new chat, and paste the connection prompt above. If you ran a trial scan, use apex claim on the same machine first to bring it into your account.
Running an agent in the cloud?
For agents without a local terminal, use the hosted MCP endpoint at https://ai.cantina.xyz/mcp. An organization manager or administrator supplies a service key through the client's secret storage or environment. Hosted MCP has its own tool inputs and does not use local device login.
If the agent cannot see your scan
- No Apex tools: restart the agent after setup and check that its MCP server is enabled. The agent must be able to launch
apex-mcpfrom its PATH. - Wrong or missing workspace: ask the agent to list your workspaces and select the one used in the web app. Connecting an existing scan does not require creating a workspace or scanning again.
- Trial results: claim the trial on the same machine and user account that ran it. Your agent checks the trial state before starting a new login.
- Asked for a browser token: update Apex CLI, re-run setup, and restart the agent. Current Apex tools use your normal Apex login; you do not need to paste cookies or tokens into chat.