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

# MCP Installation

> Use the Relace MCP to integrate FAS into any coding agent.

## Overview

The easiest way to get started with FAS is to expose the subagent as a tool to your main agent via the Relace MCP.

For personal use, you can integrate with any coding agent that has a custom MCP feature (*e.g.* Cursor, Claude Code). Using MCP is also the fastest way to test FAS in your production coding agent.

## Prerequisites

* [Sign up](https://app.relace.ai) for a Relace account.
* Create an [API key](https://app.relace.ai/settings/api-keys).
* [Install uv](https://docs.astral.sh/uv/getting-started/installation/). This makes it possible to run `relace-mcp-server` without any additional Python environment setup via `uvx`.
* [Install ripgrep](https://github.com/BurntSushi/ripgrep#installation). This is what enables our `grep_search` tool to efficiently search over large code bases.

## Installation

Most MCP-compatible clients use a standard JSON configuration format. To use Relace, add the following to your client's MCP settings file:

```json theme={null}
{
  "mcpServers": {
    "Relace": {
      "command": "uvx",
      "args": ["relace-mcp-server"],
      "env": {
        "RELACE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}
```

See below for client-specific instructions on where to place this configuration.

<Accordion title="Claude Code">
  <Steps>
    <Step title="Add MCP Server">
      Run the following command:

      ```bash theme={null}
      claude mcp add Relace --scope user --env RELACE_API_KEY=YOUR_API_KEY_HERE -- uvx relace-mcp-server
      ```
    </Step>

    <Step title="Configure CLAUDE.md">
      Add the following to your `CLAUDE.md` file:

      ```
      Always use relace_search for codebase exploration. Do not call it in parallel with other tools.
      ```
    </Step>
  </Steps>
</Accordion>

<Accordion title="Cursor">
  <Steps>
    <Step title="Add MCP Server">
      Open Cursor Settings and navigate to **Tools & MCP > New MCP Server**.

      Add the following JSON:

      ```json theme={null}
      {
        "mcpServers": {
          "Relace": {
            "command": "uvx",
            "args": ["relace-mcp-server"],
            "env": {
              "RELACE_API_KEY": "YOUR_API_KEY_HERE"
            }
          }
        }
      }
      ```
    </Step>

    <Step title="Configure User Rules">
      Navigate to **Rules and Commands > User Rules > Add Rule**.

      Add the following text:

      ```
      Always use relace_search for codebase exploration. Do not call it in parallel with other tools.
      ```
    </Step>
  </Steps>
</Accordion>

<Accordion title="VS Code">
  <Steps>
    <Step title="Add MCP Server">
      Use `MCP: Open User Configuration` in the command palette to open your MCP config, then add the following:

      ```json theme={null}
      {
        "servers": {
          "Relace": {
            "command": "uvx",
            "args": ["relace-mcp-server"],
            "env": {
              "RELACE_API_KEY": "YOUR_API_KEY_HERE"
            }
          }
        }
      }
      ```
    </Step>

    <Step title="Configure Copilot Instructions">
      Add the following to your `.github/copilot-instructions.md` file:

      ```
      Always use relace_search for codebase exploration. Do not call it in parallel with other tools.
      ```
    </Step>
  </Steps>
</Accordion>

## How It Works

Once installed, the Relace MCP exposes a `relace_search` tool that your agent can invoke. The `relace-mcp-server` package includes our agentic search harness optimized to execute parallel `view_file` and `grep` commands in your local filesystem.

When your agent invokes `relace-search` with a `query`, the FAS subagent sifts through the codebase and returns a formatted list of relevant files with line ranges—the same `report_back` output from the [FAS API](/docs/fast-agentic-search/quickstart).

## Next Steps

To build out a custom FAS agent, see the [Overview](/docs/fast-agentic-search/integration) section for a full code sample of the agent harness.
