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

# Fix with Ordyn

> Ordyn writes the fix and opens the pull request, or hands the work to your own coding agent. You review and merge.

When an investigation ends in a fix, Ordyn can write it. The **Fix** page lists every pull request Ordyn has opened and holds the settings for how fixes are built.

## Choose your build agent

Pick which agent writes the code. Ordyn gives it the investigation, the evidence, and the suggested change either way.

| Build agent | Notes |
| - | - |
| **Ordyn Build Agent** (default) | Runs in a sandbox Ordyn manages. You configure scripts, secrets, and instructions per repository. |
| **Cursor** | Ordyn hands the task to a Cursor background agent on your team plan. Needs your Cursor API key. |
| **Devin** | Ordyn hands the task to a Devin session in your organization. Needs your Devin organization ID and API key. |

## Build agent credentials

### Cursor

A Cursor API key: a user or service-account API key that can start and follow up on Cloud Agents

#### Build agent

Hand fixes to Cursor Cloud Agents on your team plan.

| Scope | Used for |
| - | - |
| `Cloud Agents` | a user or service-account API key that can start and follow up on Cloud Agents |

Permission catalog version `2026-10-16.1`. See [permission changes](/reference/permission-changes).

### Devin

A Devin service user API key and your organization ID: a service user key (cog\_…) whose role can create, read and message sessions in your organization

#### Build agent

Hand fixes to Devin sessions in your organization.

| Scope | Used for |
| - | - |
| `Sessions` | a service user key (cog\_…) whose role can create, read and message sessions in your organization |

Permission catalog version `2026-10-16.1`. See [permission changes](/reference/permission-changes).

## Decide when the PR opens

* **When I ask.** Ordyn proposes a fix and waits. Click **Create PR** in the Slack thread or the app.
* **Automatically.** Ordyn opens the PR on its own when the investigation's confidence meets the bar you set, 4 or 5 out of 5, and the alert came from a source you allow. Everything else still waits for you.

Every PR links back to its investigation, and CI runs as usual. Nothing merges without a human.

## Ordyn Build Agent settings

Configure these per repository from the **Fix** page settings.

| Setting | What it does |
| - | - |
| **Instructions** | Repository-specific guidance: conventions, architecture notes, libraries to prefer or avoid. |
| **Pre-execution script** | Runs before changes are made. Dependency installation, environment setup. |
| **Post-execution script** | Runs after changes are made. Tests, linting, formatting. Match this to your CI so PRs arrive green. |
| **Secrets** | Environment variables the sandbox needs, such as registry tokens or test API keys. Stored encrypted and injected at runtime. |

Scripts run non-interactively. Keep them idempotent.

A build creates a branch from your default branch, runs the pre-execution script, makes the change, and runs the post-execution script. If tests fail, Ordyn iterates. Then it commits, opens the PR, and posts the link back to the thread.

Requires the [GitHub](/integrations/github) app installed on the repository with permission to create branches and pull requests.

## Hand off to your coding agent

If you would rather write the fix yourself, bring the investigation into Claude Code or Cursor.

**Copy the context.** The **Context for Agents** button on Slack alert cards, and **Copy context** in the app, copy the root cause, evidence, and suggested change so you can paste them into any agent.

**Connect the Ordyn MCP server.** It gives your coding agent direct access to investigations, issues, and monitors. Install it from **Settings → Workspace**.

**Claude Code**

Copy the install command from settings. It looks like:

```bash theme={null}
claude mcp add --transport http --scope user struct <your-mcp-url>
```

`--scope user` adds Ordyn to all your projects. Then run `/mcp` in Claude Code to sign in.

**Cursor**

Click **Install in Cursor** in settings, or add this to `.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "struct": { "url": "<your-mcp-url>" }
  }
}
```

**Use the CLI.** It adds the Ordyn MCP server to your agent with only the server URL; your agent signs in to Ordyn itself.

```bash theme={null}
npm install -g @struct-ai/cli
struct mcp install --client claude   # or cursor, codex
```

See the [MCP server reference](/reference/mcp-server) and the [CLI reference](/reference/cli) for everything available.


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