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

# MCP server

> Connect AI tools to Realm via the Model Context Protocol

## Overview

Realm works as an MCP (Model Context Protocol) server, so any MCP-compatible AI tool can search your knowledge base and talk to your Realm agents directly, without copy-pasting context back and forth.

<Note>
  This page is for connecting your AI tools to Realm. If you are an admin looking to give Realm agents access to external MCP servers (like Linear or Notion), see [Connect MCP servers to Realm](/admin/mcp) instead.
</Note>

## What you can do

<CardGroup cols={2}>
  <Card title="Search your knowledge" icon="magnifying-glass">
    Let your AI tool search your Realm knowledge base and pull in relevant documents as context for any prompt.
  </Card>

  <Card title="Talk to your agents" icon="robot">
    Chat with your Realm agents from inside the tools you already use, so you can trigger them without leaving your editor or assistant.
  </Card>
</CardGroup>

## Connect your tool

Any MCP-compatible client can connect to Realm at `https://app.withrealm.com/api/mcp`. Pick your tool below for the exact steps.

<Tip>
  Replace `app.withrealm.com` with your own Realm URL if your organization uses a custom subdomain.
</Tip>

<Tabs>
  <Tab title="Claude Code">
    Run this from any project:

    ```bash theme={null}
    claude mcp add --transport http realm https://app.withrealm.com/api/mcp
    ```

    Or add this snippet to your project's `.mcp.json` or your user-level Claude Code config:

    ```json theme={null}
    {
      "mcpServers": {
        "realm": {
          "type": "http",
          "url": "https://app.withrealm.com/api/mcp"
        }
      }
    }
    ```

    See [Claude Code's MCP docs](https://code.claude.com/docs/en/mcp) for details.
  </Tab>

  <Tab title="Claude Desktop">
    Open Claude Desktop, go to **Settings > Connectors**, click **Add custom connector**, and paste `https://app.withrealm.com/api/mcp` as the URL. Custom connectors require a paid Claude plan.
  </Tab>

  <Tab title="Cursor">
    Open **Settings > MCP & Integrations** and add a new server, or paste this into `~/.cursor/mcp.json` for a global server (or `.cursor/mcp.json` inside a project for a project-scoped one):

    ```json theme={null}
    {
      "mcpServers": {
        "realm": {
          "url": "https://app.withrealm.com/api/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windsurf">
    Open **Settings > Cascade > MCP Servers**, click **Add Server**, and paste this into `~/.codeium/windsurf/mcp_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "realm": {
          "serverUrl": "https://app.withrealm.com/api/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="ChatGPT">
    Custom MCP connectors in ChatGPT require a **Business, Enterprise, or Edu** workspace. Go to **Settings > Apps & Connectors > Advanced settings** and turn on **Developer mode**, then open **Settings > Apps & Connectors** and click **Create** to add `https://app.withrealm.com/api/mcp` as a custom MCP app. Admins manage workspace-wide availability in **Workspace settings > Apps & Connectors**.
  </Tab>
</Tabs>

## Authentication

You do not need an API key. The first time your AI tool connects, Realm opens a browser window so you can sign in with OAuth, the same way you sign into Realm in any other app. After that, your tool stays connected.

## Related pages

<CardGroup cols={2}>
  <Card title="Connect MCP servers to Realm" icon="server" href="/admin/mcp">
    Add external MCP servers so your Realm agents can use them
  </Card>

  <Card title="Browser extension" icon="chrome" href="/integrations/chrome-extension">
    Search and chat with Realm from any webpage
  </Card>
</CardGroup>
