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

# Quickstart

> Connect your agent, build a mirror, and gate merges in CI.

There are two ways in. The fastest is to [connect an MCP client](#option-a-connect-an-mcp-client) and let your AI client do the driving; the classic path is to [add the collector](#option-b-add-the-collector) to your agent and build a mirror from its traces. They end in the same place: real sessions replaying against every change, in CI.

## Option A: connect an MCP client

Mirrors hosts an MCP server that exposes the full product surface — build, explore, query, and eval mirrors from Claude Code, Cursor, VS Code, ChatGPT, Codex, and any other MCP client. Sign-in happens in the browser on first use; no API key needed.

```bash theme={null}
claude mcp add --transport http mirrors https://api.runmirrors.com/mcp
```

Then run `/mcp` → `mirrors` → **Authenticate** and ask your client to build a mirror from your traces. See [MCP server](/mcp-server) for every client, one-click installs, and headless setups.

## Option B: add the collector

<Steps>
  <Step title="Get an API key">
    Sign in at [runmirrors.com](https://www.runmirrors.com/login) and mint a workspace API key (`mk_live_…`) under **Settings → API keys**.
  </Step>

  <Step title="Add two lines to your agent">
    Install the collector and initialize it before your agent runs. It auto-instruments LangChain/LangGraph, Anthropic, and OpenAI, and ships traces in the background — non-blocking, and it never raises into your app.

    <CodeGroup>
      ```python Python theme={null}
      # pip install mirrorkit
      import mirrorkit
      mirrorkit.init(api_key="mk_live_...", project="my-agent")
      ```

      ```typescript TypeScript theme={null}
      // npm install mirrorkit
      import * as mirrorkit from 'mirrorkit';
      mirrorkit.init({ apiKey: 'mk_live_...', project: 'my-agent' });
      ```

      ```go Go theme={null}
      // go get github.com/ai-singhal/mirrorkit-go
      mirrorkit.Init(mirrorkit.Options{APIKey: "mk_live_...", Project: "my-agent"})
      ```
    </CodeGroup>

    Run your agent normally — traces start streaming. Details per language: [Python](/collectors/python), [TypeScript](/collectors/typescript), [Go](/collectors/go).
  </Step>

  <Step title="Build a mirror">
    From the dashboard (**Ingest → Build**), or from the [CLI](/cli):

    ```bash theme={null}
    pip install "mirrorkit[cli]"
    mirrors login                                   # paste your mk_live_… key
    mirrors build --project my-agent --name my-agent
    ```

    Mirrors turns the traces into a schema, a seeded database, and tool bindings — a runnable copy of your agent's world, scored per tool for fidelity.
  </Step>

  <Step title="Replay and query it">
    ```bash theme={null}
    mirrors query my-agent "cancel my flight"   # one-shot run + trace
    mirrors chat my-agent                       # multi-turn conversation
    ```

    Or use the Playground in the dashboard. Same session, two versions of the agent, one caught regression.
  </Step>

  <Step title="Gate merges in CI">
    In **Quickstart → CI eval gate**, connect the GitHub App and bind your repo to a mirror and an eval set. Every PR that touches your agent replays the eval set and reports a **Mirrors eval gate** status check you can make required. See [CI gate](/ci-gate).
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="How it works" icon="lightbulb" href="/how-it-works">
    Fidelity scoring, deterministic seeding, business context, and evals.
  </Card>

  <Card title="CI gate" icon="code-branch" href="/ci-gate">
    Block regressions at the pull request, Vercel-style.
  </Card>
</CardGroup>
