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

# Mirror connections and MCP servers

> Connect Mirror CLI to services such as Linear, Notion, and Slack, or to your own MCP servers

Connections give the agent tools for services outside your project. For example, connecting Linear lets the agent read and update issues, and connecting Notion lets it search your team's pages. Each connection is an MCP (Model Context Protocol) server, and once it's connected its tools work like the agent's built-in ones.

## Connect a service

Mirror knows how to connect Notion, Datadog, Linear, and Slack.

1. Run `/connect` and choose a service, or name it directly, as in `/connect linear`.
2. Sign in to the service in your browser. Mirror opens the sign-in page and also prints its link. Press `Escape` to cancel.
3. When Mirror confirms the connection, the service's tools are available to the agent.

Mirror saves the sign-in under `~/.mirror/mcp/credentials/`, so you only sign in again if it expires or the service rejects it. If that happens, Mirror tells you which service needs attention; run `/connect <service>` to sign in again.

## Manage connections

| Command | Effect |
| - | - |
| `/connections` | Show connected services and their status. |
| `/connect [service]` | Connect a service, or sign in to one again. |
| `/disconnect [service]` | Disconnect a service. This deletes its definition file in `~/.mirror/mcp/` and its saved sign-in. Without a name, choose from a list. |

The agent sees each tool as `mcp__<service>__<tool>`, such as `mcp__linear__create_issue`. Tool calls from connections need your approval when the workspace uses [manual approval](/mirror-overview#choose-what-to-approve).

## Web search

The agent's web search and page-reading tools don't use a connection. They need a Firecrawl API key in your environment instead.

In preview, Mirror supports the [Firecrawl API](https://www.firecrawl.dev/) for web search. We'll support additional search providers by launch.

<Steps>
  <Step title="Get a Firecrawl API key">
    Create a Firecrawl account, then copy your key from the [API Keys page](https://www.firecrawl.dev/app/api-keys).
  </Step>

  <Step title="Export the key and start Mirror">
    Replace the placeholder with your Firecrawl API key and run these commands in the same terminal:

    ```bash theme={null}
    export FIRECRAWL_API_KEY="fc-YOUR_API_KEY"
    mirror
    ```

    If Mirror is already running, exit and restart it from this terminal so it picks up the key.
  </Step>

  <Step title="Ask Mirror to search">
    Enter a prompt that asks for a web search, for example:

    ```text theme={null}
    Search the web for the official Python asyncio TaskGroup documentation and summarize how it handles exceptions. Include links to your sources.
    ```
  </Step>
</Steps>

* **Keep the key for future sessions:** Add the export line to your shell profile, such as `~/.zshrc` for zsh. Open a new terminal before starting Mirror.
* **Use the right key:** `FIRECRAWL_API_KEY` is separate from your `REFLECTION_API_KEY`.
* **Skip search setup:** You can use Mirror for coding tasks without a Firecrawl key. Its built-in web search and browsing tools require one.

## Add your own server

To connect an MCP server that Mirror doesn't list, describe it in a JSON file in `~/.mirror/mcp/`, then run `/connect <name>`. The file name is the server's name: `~/.mirror/mcp/my-server.json` is connected with `/connect my-server`. Names can contain letters, digits, `-`, and `_`. Each file describes one server and sets either `url` or `command`.

Mirror only reads server definitions from this directory, never from a project, so cloning a repository can't add servers. To keep definitions somewhere else, set `MIRROR_MCP_DIR`.

### A remote server

For a server reached over HTTP, set its `url`. If it signs in with OAuth, set the auth type, and `/connect` opens the sign-in page:

```json theme={null}
{
  "url": "https://mcp.example.com/mcp",
  "auth": { "type": "oauth" }
}
```

Add `"clientId"` to `auth` if the service requires a registered client ID.

If the server takes an API key instead, name the environment variable that holds it, and export that variable in the shell where you start Mirror. The key itself never goes in the file:

```json theme={null}
{
  "url": "https://mcp.example.com/mcp",
  "auth": {
    "type": "bearer",
    "tokenEnvVar": "EXAMPLE_MCP_KEY"
  }
}
```

A server that uses authentication must use HTTPS. The exception is a server on your own machine (`localhost`, `127.0.0.1`, or `::1`).

### A local server

For a server that runs as a program on your machine, set its `command` and `args`:

```json theme={null}
{
  "command": "npx",
  "args": ["-y", "example-mcp"],
  "env": {
    "API_KEY": "EXAMPLE_MCP_KEY"
  }
}
```

In `env`, each key is a variable name the server will see, and each value is the name of one of your environment variables, not the secret itself. This example gives the server your `EXAMPLE_MCP_KEY` as `API_KEY`.

<Warning>
  A local server runs with your account's permissions. Only configure servers you trust.
</Warning>

### Optional settings

| Field | Meaning |
| - | - |
| `enabledTools` | Expose only the tools listed, such as `["search", "get_page"]`. Omit it for every tool, or use `[]` for none. |
| `startupTimeoutSeconds` | How long to wait for the server to start. Defaults to 15. |
| `toolTimeoutSeconds` | How long a tool call may run. Defaults to 300. |

If Mirror can't start a server, `/connect` reports it and names the file to check. Changes to a server that's already connected take effect the next time you start Mirror.

<Note>
  `/disconnect` deletes the server's JSON file. Keep a copy of any custom definition you may want to reconnect later.
</Note>
