---
title: MCP
description: Connect a coding agent to Distill so it records the decisions behind a change as it works.
sidebar:
  order: 2
---

Distill runs an MCP server at `https://app.distill.review/mcp`. It uses OAuth, so your agent opens a browser the first time it connects and you sign in with your Distill account. There is nothing else to configure.

## Connect an agent

**Claude Code**

```sh
claude mcp add --transport http distill https://app.distill.review/mcp
```

**Codex**

```sh
codex mcp add distill --url https://app.distill.review/mcp
```

**Cursor**

Add to `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "distill": { "url": "https://app.distill.review/mcp" }
  }
}
```

Run `whoami` from the agent to confirm the connection.

## Tools

- `recordDecision` records a decision for a repository and branch. The pull request can be opened later and Distill attaches the decisions to it.
- `getBranchFeedback` returns open feedback on the pull request for a branch, across everyone's Distills.
- `listDistills`, `getDistill` and `postDistillDiscussionMessage` read Distills and reply to their discussions.
- `whoami`, `listOrganisations` and `getProfile` describe the signed-in person and their organisations.

## Tell your agent to record decisions

Add this to your repository's `AGENTS.md` or `CLAUDE.md`:

```md
## Decisions

Use the Distill MCP to record the decisions behind this change as they are made. Pass the GitHub repository and the current branch; a pull request does not need to exist yet.

- At the start of work, record the intent first: what the change is trying to achieve, and why, attributed to whoever set the goal.
- Record each decision as soon as it is made, in one or two sentences, with the rationale.
- Be explicit about who decided. Use `decidedBy: "user"` when the person chose, and `decidedBy: "agent"` when you chose.
- When you act on a decision stated in Linear, Jira, Trello, Notion or GitHub, use `decidedBy: "external"` and include a `source` with the system, a direct link, the title and the author. Add the issue key, card ID, page ID or issue number when you have it. Use `system: "other"` with a name for anything else.
- Only record an external decision when the source states it. Requirements and your own interpretation are not external decisions.
- Always include `agentName` and, when known, `agentModel`.
```
