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

# Get started with Algolia Public MCP

> Connect AI assistants to curated Algolia indices and Recommend models using Algolia Public MCP.

export const DashboardLink = ({href = "dashboard", children}) => {
  const base = "https://dashboard.algolia.com/";
  const utmParams = "utm_source=docs&utm_medium=page_link";
  const cleanHref = href.startsWith("/") ? href.slice(1) : href;
  const separator = cleanHref.includes("?") ? "&" : "?";
  const url = `${base}${cleanHref}${separator}${utmParams}`;
  return <a href={url}>{children}</a>;
};

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

export const Index = () => <Tooltip tip="An Algolia index is a searchable dataset that consists of records and configuration settings. These settings define how the records are searched and ranked.">
    index
  </Tooltip>;

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

export const APIKey = () => <Tooltip tip="An alphanumeric string that controls access to the Algolia APIs. It defines what actions are allowed, such as searching an index or adding new records." cta="API key" href="/doc/guides/security/api-keys">
    API key
  </Tooltip>;

## Before you begin

To connect Algolia Public MCP, make sure you have:

* An Algolia <Application /> with at least one <Index /> and some <Records />. <DashboardLink>Create one in the Algolia dashboard</DashboardLink> if needed.
* An MCP client such as [OpenAI Playground](https://platform.openai.com/playground), [ChatGPT](https://chatgpt.com), or [Claude](https://claude.ai).

## Create or locate an MCP server

1. Go to the <DashboardLink href="generativeAi/mcp-servers/servers">MCP servers page</DashboardLink> in the Algolia dashboard and select the appropriate application.
2. If an existing MCP server is available, click the link icon to copy the URL.
3. To create a <DashboardLink href="generativeAi/mcp-servers/servers/new">new MCP server</DashboardLink>:
   1. Select up to five indices and any Recommend models you want to expose.
   2. Add descriptions to help the LLM choose the right index or tool.
   3. Save and copy the URL of the new MCP instance.

You can create up to 5 MCP server instances per application. Authentication uses your Search <APIKey />.

## Connect to an MCP client

<Tabs>
  <Tab title="Cursor">
    1. Open **Cursor settings**, then click **Tools and MCPs**.
    2. Click **Add MCP Server** and fill in the following:
       * **MCP Server URL:** `https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp`
       * **Name:** Algolia
       * **Description:** add a description that helps the LLM understand the tool’s purpose.
       * **Authentication:** none.
    3. Click **Save**.
    4. Enable the Algolia MCP connection from the prompt bar.

    Alternatively, you directly add the following to your `~/.cursor/mcp.json` or `%USERPROFILE%\.cursor\mcp.json` file:

    ```json theme={"system"}
    {
      "mcpServers": {
        "Algolia": { // [!code ++]
          "url": "https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp" // [!code ++]
        } // [!code ++]
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    Add the following to your `~/.vscode/mcp.json` or `%USERPROFILE%\.vscode\mcp.json` file:

    ```json theme={"system"}
    {
      "servers": {
        "Algolia": { // [!code ++]
          "type": "http", // [!code ++]
          "url": "https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp" // [!code ++]
        } // [!code ++]
      }
    }
    ```
  </Tab>

  <Tab title="ChatGPT">
    1. Open [Connectors settings](https://chatgpt.com/#settings/Connectors), then click **Create**.
    2. Fill in the following:
       * **Server URL:** `https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp`
       * **Label:** Algolia
       * **Description:** add a description that helps the LLM understand the tool’s purpose.
       * **Authentication:** none.
    3. Check **I trust this application**.
    4. Click **Create**.
    5. Enable the Algolia MCP connection from the prompt bar.
  </Tab>

  <Tab title="OpenAI Playground">
    1. Open [OpenAI Platform → Playground](https://platform.openai.com/playground).
    2. Go to **Tools → + Add**.
    3. Choose **MCP server**.
    4. Click **+ Server** and enter:
       * **Server URL:** `https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp`
       * **Label:** Algolia
       * **Description:** add a description that helps the LLM understand the tool’s purpose.
       * **Authentication:** none.
    5. Click **Connect**.
    6. Use a system prompt that preserves result fidelity, such as:

    ```txt theme={"system"}
    You are an AI assistant that helps users with searching for results in an Algolia index.
    Display the Algolia results exactly as returned. Do not filter, reorder, or summarize the hits.
    ```
  </Tab>

  <Tab title="Claude">
    1. Open [Connectors settings](https://claude.ai/settings/connectors), then click **Add Custom Connector**.
    2. Fill in the following:
       * **Remote MCP server URL:** `https://{APP_ID}.algolia.net/mcp/1/{UNIQ_ID}/mcp`
       * **Name:** Algolia
       * Leave **Advanced Settings** empty
    3. Click **Add**.
    4. Enable the Algolia MCP connection from the prompt bar.
  </Tab>
</Tabs>

## Tools exposed by Algolia Public MCP

Algolia Public MCP exposes a **tool** per index and a small set of shared tools:

| Tool                              | API                                                                     |
| --------------------------------- | ----------------------------------------------------------------------- |
| **Search**                        |                                                                         |
| `algolia_search_{index_name}`     | [Search an index](/doc/rest-api/search/search-single-index)             |
| `algolia_search_for_facet_values` | [Search for facet values](/doc/rest-api/search/search-for-facet-values) |
| **Recommend**                     |                                                                         |
| `algolia_recommendations`         | [Retrieve recommendations](/doc/rest-api/recommend/get-recommendations) |

ChatGPT requires two extra tools (see [OpenAI MCP docs](https://platform.openai.com/docs/mcp#create-an-mcp-server)):

| Tool     | API                                                         |
| -------- | ----------------------------------------------------------- |
| `search` | [Search an index](/doc/rest-api/search/search-single-index) |
| `fetch`  | [Get an object](/doc/rest-api/search/get-object)            |

## Guidelines

* **Usage and billing**. API requests made through Algolia Public MCP count toward your Algolia usage. Each tool call typically maps to one API request.
* **Data access and permissions**. The MCP grants the connected LLM access to your Algolia records according to the permissions defined in your Search <APIKey />.
* **Prompt design**. Use a clear system prompt that tells the assistant to return Algolia results exactly as provided.
