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

# Integrations

> Connect Aegis to Claude Code, Cursor, or VS Code Copilot via MCP over SSE. No code changes required. Just paste a config snippet and restart your tool.

Aegis connects to your AI coding agent using the [Model Context Protocol](https://modelcontextprotocol.io) (MCP) over Server-Sent Events (SSE). When your agent calls a tool, pushing code, opening a pull request, creating a branch, that request flows through Aegis first. Aegis evaluates it against your policies, logs it, and either allows it, routes it for approval, or blocks it. You do not need to modify your agent or your repositories.

## Supported tools

<CardGroup cols={3}>
  <Card title="Claude Code" icon="terminal" href="/integrations/claude-code">
    User-level or project-level config via `~/.claude/mcp.json`.
  </Card>

  <Card title="Cursor" icon="code" href="/integrations/cursor">
    User-level or workspace-level config via `~/.cursor/mcp.json`.
  </Card>

  <Card title="VS Code Copilot" icon="code-branch" href="/integrations/vscode-copilot">
    Workspace-level config via `.vscode/mcp.json`.
  </Card>
</CardGroup>

<Note>
  **Coming soon:** Windsurf and Codex support is in progress. These tools will appear on the Integrations page in the Aegis dashboard when they are ready.
</Note>

## How the connection works

Every integration uses the same SSE endpoint with query parameters that identify you, the room, and your role:

```text theme={null}
https://app.runaegis.co/sse?user_id=YOUR_USER_ID&room_id=ROOM_ID&access_token=ACCESS_TOKEN&role=ROLE
```

When your agent starts, it opens a persistent connection to this URL. From that point on, every MCP tool call the agent makes passes through Aegis.

## Connection flow

<Steps>
  <Step title="Create a room">
    In the Aegis dashboard, go to **Rooms** and create a room for the repository you want to govern. A room ties together a repository, its policies, and the agents allowed to act on it. You must create a room before you can connect an agent.
  </Step>

  <Step title="Copy your credentials">
    After creating the room, copy the **room ID** and **access token** from the room detail page. You will also need your **user ID**, which you can find in **Settings → Profile**.
  </Step>

  <Step title="Paste the config and restart">
    Open the config file for your tool, paste the MCP snippet with your credentials substituted in, and restart the tool. Your agent will connect on next startup and Aegis will begin logging its actions immediately.
  </Step>
</Steps>

## Where to find your credentials

| Credential     | Where to find it                              |
| -------------- | --------------------------------------------- |
| `user_id`      | **Settings → Profile** in the Aegis dashboard |
| `room_id`      | The room detail page under **Rooms**          |
| `access_token` | The room detail page under **Rooms**          |

## Choosing a role

The `role` parameter controls what actions Aegis permits for this agent connection. Choose the role that matches the trust level you want to grant.

| Role        | Use case                                                    |
| ----------- | ----------------------------------------------------------- |
| `DEVELOPER` | Day-to-day coding agents. Use this for most connections.    |
| `ADMIN`     | CI pipelines or automation that needs elevated permissions. |
| `OWNER`     | Full access. Reserve for trusted tooling you fully control. |

<Tip>
  Start with `DEVELOPER` and promote to `ADMIN` or `OWNER` only if the agent needs capabilities that a developer role does not cover.
</Tip>

<Warning>
  Keep your access token private. If it is ever exposed, rotate it immediately from the room detail page in the Aegis dashboard.
</Warning>
