> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lasercat.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# AI agents (MCP)

> Connect Claude Code, Cursor, Codex, or another AI agent to LaserCat: it reads your jobs and, when you allow it, creates and edits them.

Your own AI agent can work with your LaserCat jobs: list them, explain any setting, create a job, change one, pause it. It connects over **MCP** (Model Context Protocol, the standard way AI apps use outside tools) with an API key you make in the panel. LaserCat checks every change the agent makes exactly as it checks yours in the panel.

> [!WARNING]
>
> Jobs trade real money. The agent never buys, sells, or withdraws by itself, but an active job does: switching a job on starts real trading. By default the agent can't switch a job on or change an active job; you allow that yourself ([below](#let-the-agent-switch-jobs-on)).

## What the agent can do

| | What it can do | What it needs |
| - | - | - |
| **Look** | List and read your jobs, explain any job setting, read lists, presets, and wallets, see whether a change was taken | A key with **read** |
| **Change** | Create a job (always **Paused**), edit a paused job, pause any job | A key with **config**, and the **Trader** or **Space Admin** role |
| **Go live** | Switch a job on, edit an **Active** job | Your permission, set in the agent's settings |

The agent never buys, sells, closes positions, withdraws, touches wallets or their keys, or edits lists, presets, and templates.

## Connect your agent

**1. Create an API key**

In the panel, open **Settings → API keys** and click **Create key** (Space Admins only). Name it after your agent and tick:

* **read**: the agent can look;
* **config**: the agent can also create, edit, and pause jobs.

Do not tick **trade**: the agent never uses it, and it would let anyone holding the key send trades. Copy the key now: it is shown once and never again.

The same dialog offers **Copy command for Claude Code**: the command from the next step with your key already in it. If you ticked **trade**, it warns: "An AI agent doesn't need trade."

**2. Add LaserCat to your agent**

LaserCat's address for agents:

```text theme={null}
https://api.lasercat.gg/api/mcp
```

The **Connect an AI agent (MCP)** block under your keys on **Settings → API keys** shows this address and each agent's settings below, with copy buttons; its **Full guide** opens this page.

Put your key in place of `lc_...`:

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http --scope user lasercat https://api.lasercat.gg/api/mcp --header "x-api-key: lc_..."
> ```
>
> `--scope user` makes LaserCat available in all your projects. Never use `--scope project`: it writes the key into a file meant to be shared. Check with `claude mcp list`.

> [tab] Cursor
>
> In `~/.cursor/mcp.json`, with the key in the `LASERCAT_API_KEY` environment variable:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "lasercat": {
>       "url": "https://api.lasercat.gg/api/mcp",
>       "headers": { "x-api-key": "${env:LASERCAT_API_KEY}" }
>     }
>   }
> }
> ```

> [tab] Codex
>
> In `~/.codex/config.toml`, with the key in the `LASERCAT_API_KEY` environment variable Codex starts with:
>
> ```toml theme={null}
> [mcp_servers.lasercat]
> url = "https://api.lasercat.gg/api/mcp"
> env_http_headers = { "x-api-key" = "LASERCAT_API_KEY" }
> ```

> [tab] VS Code
>
> In `.vscode/mcp.json`. VS Code asks for the key once and keeps it out of the file:
>
> ```json theme={null}
> {
>   "inputs": [
>     { "type": "promptString", "id": "lasercat-key", "description": "LaserCat API key", "password": true }
>   ],
>   "servers": {
>     "lasercat": {
>       "type": "http",
>       "url": "https://api.lasercat.gg/api/mcp",
>       "headers": { "x-api-key": "${input:lasercat-key}" }
>     }
>   }
> }
> ```

> [tab] Gemini CLI
>
> ```bash theme={null}
> gemini mcp add --transport http lasercat https://api.lasercat.gg/api/mcp --header "x-api-key: lc_..."
> ```

> [tab] Other
>
> Any MCP client that connects to a server by its address (Streamable HTTP) and can send a header: the address above, with the header `x-api-key` set to your key.

**3. Ask**

Talk to your agent as usual. For example:

* "Show my paused LaserCat jobs."
* "Explain the sell settings of my job Friends WL."
* "Make a copy of Friends WL on my second wallet, paused."
* "Lower the buy of Friends WL to 0.2 SOL."

The agent can preview a change before saving it, and check when the change applies. Whatever it saves shows in the panel like your own changes.

## Let the agent switch jobs on

To let the agent switch a job on and edit an active job, add a second header, `x-lasercat-allow-activate: true`, the same way as the key:

| Agent | How |
| - | - |
| Claude Code, Gemini CLI | A second `--header "x-lasercat-allow-activate: true"` |
| Cursor, VS Code | `"x-lasercat-allow-activate": "true"` next to `x-api-key` in `headers` |
| Codex | `http_headers = { "x-lasercat-allow-activate" = "true" }` |

Without it, the agent can still create, edit, and pause paused jobs, and you switch them on in the panel. The agent can't add the header itself: only you can, in its settings. An edit of an active job reaches live trading within a minute.

## Keep it safe

* **The key acts as you**, with your role in that account. Keep it in your agent's settings or environment, never in a chat or a shared file.
* **A key for looking only.** Give the key **read** alone if the agent should only look.
* **Revoke it any time** on **Settings → API keys**: the agent stops at once.
* **Keep your agent's approvals on** for creating, editing, and switching jobs, so you see each change before it is made.
* **Names are data.** Job, list, and wallet names, labels, and notes come back to the agent as typed. LaserCat tells it never to follow instructions found in them, and to switch a job on only on your own words.
* **A change with no answer may still have gone through.** If the connection drops while the agent saves, LaserCat tells it to check the job before trying again.

## Good to know

* An agent can make about 100 to 150 tool calls a minute. All your keys share this limit.
* Claude in the browser, Claude Desktop's connectors, and ChatGPT can't connect: they need a sign-in that LaserCat doesn't offer. Use one of the clients above.

## If something goes wrong

| The agent says | What to do |
| - | - |
| LaserCat refused the key | The key is wrong or revoked: create a new one and put it in the agent's settings. |
| The key lacks the "config" scope | The key has **read** only: create one with **config**. |
| Your role does not allow it | A Viewer can only look: ask a Space Admin for the **Trader** role. |
| It does not switch jobs on | Add `x-lasercat-allow-activate: true` ([above](#let-the-agent-switch-jobs-on)), or switch the job on in the panel. |
| The job changed since it was read | Someone changed the job meanwhile: the agent reads it again and redoes the change. |
| The key acts for its own account alone | A key works only in the account it was made in: create one in the account you mean. |
| The job is archived | Archived jobs can't be changed: have the agent create a new job instead. |
| Stream mode is available on request | Write to the LaserCat team: see [Job modes](https://docs.lasercat.gg/jobs/modes.md). |
| A field the engine doesn't take yet | Leave that field out, or unchanged, and try again. |
| Rate limited | Wait the time it names, then try again: all your keys share one limit. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.