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

# Run from a chat tool

> Add Sensei runs to Claude, Cursor or Codex as an MCP server and start runs by asking.

Sensei runs are available as an MCP server. Add one address to Claude, Cursor or Codex, and you can say "run refund-requests on ticket 48213", "approve it" or "that one was wrong" in chat.

## Add the server

The address is on the dashboard: open **Runs**, click **New run**, then **Run it from Claude, Cursor or code**. It has this form:

```
https://runs.sense-lab.ai/mcp/
```

How you sign in depends on the tool.

| Tool | Sign-in |
| - | - |
| Cursor, Codex, Claude Code | Send your Sensei key as the `Authorization` header: `Bearer amfs_...` |
| Claude Desktop, claude.ai | Add the address as a connector and sign in when asked |

> [tab] Cursor
>
> Add this to `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "sensei-runs": {
>       "url": "https://runs.sense-lab.ai/mcp/",
>       "headers": { "Authorization": "Bearer amfs_..." }
>     }
>   }
> }
> ```

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http sensei-runs https://runs.sense-lab.ai/mcp/ \
>   --header "Authorization: Bearer amfs_..."
> ```

> [tab] Codex
>
> ```bash theme={null}
> export SENSELAB_API_KEY=amfs_...
> codex mcp add sensei-runs --url https://runs.sense-lab.ai/mcp/ \
>   --bearer-token-env-var SENSELAB_API_KEY
> ```

## What the chat tool can do

| Tool | Does |
| - | - |
| `run_start` | Starts a run and waits a short while for it. A saved agent runs by name with its input. Anything else is a task in your words. With `repo` it changes a repository, starting from the default branch or from the branch or commit given as `ref`. With `repo` and `pr` it works on an open pull request. |
| `run_status` | Reads a run |
| `run_answer` | Sends your approve, correct or reject to a waiting run |
| `run_cancel` | Stops a run |
| `run_outcome` | Records whether a finished run was right or wrong |
| `runs_list` | Lists recent runs |
| `batch_start` | Starts several changes to one repository as one batch: `repo`, `tasks` and, when wanted, `ref`, `instructions`, `parallel`, `together`, `deliver`, `each_usd` and `total_usd`. The server tells the assistant to ask you for a spending limit before a large one. See [Several changes at once](https://docs.sense-lab.ai/sensei/runs/batches.md). |
| `batch_check` | Tests a finished batch's changes together again, against the branch as it is now |
| `settings_list` | Lists what the project's runs are given: settings with their values, secrets by name only, and the names recent runs needed and did not get |
| `setting_set` | Saves a plain setting, such as a region or a bucket name. It does not save secrets. |
| `agents_list`, `agent_get`, `agent_save` | Lists saved agents with their figures, reads one, saves a definition |
| `tools_list` | Lists the tools connected on the project |
| `schedules_list`, `schedule_add`, `schedule_update`, `schedule_remove` | Manages schedules |

A finished run's reply says which model served it when one of your [routing rules](https://docs.sense-lab.ai/sensei/routing/rules.md) sent its calls to a model on your own key.

A long run outlives one chat reply. `run_start` returns after about 50 seconds with the run's status and address, and the assistant can check it again with `run_status`.

## What stays out of chat

Secrets do not go through chat. Connect a tool or a repository with the `sensei` command or on the dashboard, save a secret for your runs with `sensei secrets set NAME`, and never paste a token to a model. `setting_set` refuses a value that looks like a key or a token.

Decisions stay with you. The server instructs the assistant to show you a waiting run's action and reason and to ask for your answer. It is told not to answer for you. When a run finishes, the assistant is told to show the output, the evidence and what the run was not sure about as they are.

To hand tasks off from a coding agent that has reached its limit, see [Hand work off at your limit](https://docs.sense-lab.ai/sensei/runs/hand-off.md).


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