AL
OfficialSearch

Algolia Experimental MCP Server for Search APIs

Explore this experimental MCP server for Algolia Search APIs; fork, test, or build on it with caution, as it's unsupported and may change or be removed.

Quick Install
npx -y @algolia/mcp

Overview

This repository contains an experimental Model Context Protocol (MCP) server that exposes Algolia Search APIs to MCP-enabled clients (for example Claude Desktop or mcphost + models). It’s a lightweight Go-based prototype you can run locally to let LLMs interact with an Algolia index via MCP tools (search, read, write, recommendations, etc.). The server is intended for exploration, prototyping, and developer experimentation — not production use.

Important: this project is unsupported by Algolia, may change or be removed, and is not covered by Algolia SLAs. Treat it as experimental code: fork, test, and modify at your own risk. You may find the source and updates at the GitHub repo: https://github.com/algolia/mcp

Features

  • Implements MCP endpoints to expose Algolia search functionality to LLMs and MCP clients
  • Supports running as stdio or SSE server (MCP_SERVER_TYPE)
  • Configurable set of tools (enable/disable by name)
  • Read and write operations for indices (split into search_read / search_write as needed)
  • Simple Go binary you can build locally and run with environment variables
  • Works with MCP inspectors for debugging and with mcphost to orchestrate multiple MCP servers

Installation / Configuration

Prerequisites:

  • Go installed (https://go.dev/doc/install)
  • An Algolia Application ID and API keys (search-only and admin/write if needed)

Clone and build:

git clone [email protected]:algolia/mcp.git
cd mcp/cmd/mcp
go build
# binary will be ./mcp
pwd
# /path/to/mcp/cmd/mcp

Environment variables (example):

export ALGOLIA_APP_ID="YOUR_APP_ID"
export ALGOLIA_INDEX_NAME="YOUR_INDEX"
export ALGOLIA_API_KEY="YOUR_SEARCH_KEY"
export ALGOLIA_WRITE_API_KEY="YOUR_ADMIN_KEY"   # optional: required for write operations
export MCP_ENABLED_TOOLS=""                      # comma-separated list, empty = all enabled
export MCP_SERVER_TYPE="stdio"                   # "stdio" (default) or "sse"
export MCP_SSE_PORT="8080"                       # used only when MCP_SERVER_TYPE="sse"

Example MCP server entry for Claude Desktop or mcphost (JSON):

{
  "mcpServers": {
    "algolia": {
      "command": "/path/to/mcp/cmd/mcp/mcp",
      "env": {
        "ALGOLIA_APP_ID": "APP_ID",
        "ALGOLIA_INDEX_NAME": "INDEX_NAME",
        "ALGOLIA_API_KEY": "SEARCH_API_KEY",
        "ALGOLIA_WRITE_API_KEY": "ADMIN_API_KEY",
        "MCP_ENABLED_TOOLS": "",
        "MCP_SERVER_TYPE": "stdio",
        "MCP_SSE_PORT": "8080"
      }
    }
  }
}

Run the MCP server directly (after setting env vars):

./mcp

Debugging with the MCP Inspector:

# from repo root
cd cmd/mcp
go build
npx @modelcontextprotocol/inspector ./mcp

Available Tools / Resources

Available tools (enable with MCP_ENABLED_TOOLS or leave empty to enable all):

Tool namePurpose
searchAll search operations (read + write)
search_readRead-only index actions (list indices, get settings, run queries, fetch objects)
search_writeWrite actions (clear, copy, delete/move indices, set settings, insert/delete objects)
collectionsCollections-related API access
recommendRecommendations endpoints
querysuggestionsQuery Suggestions endpoints
analyticsAnalytics endpoints
monitoringMonitoring / metrics endpoints
abtestingA/B testing endpoints
usageUsage and billing-like endpoints

Resources:

  • Repo: https://github.com/algolia/mcp
  • MCP spec and quickstart: https://modelcontextprotocol.io

Use Cases

  • Local prototyping: Let an LLM query a real Algolia index using MCP so you can test prompt flows that require live search results.
    • Example: Use Claude Desktop + Algolia MCP to create a conversational search assistant that retrieves and cites matching records.
  • Tool-restricted experimentation: Enable only search_read to allow model querying without any risk of accidental writes.
    • Set MCP_ENABLED_TOOLS=“search_read,querysuggestions”
  • Integration testing: Use the MCP server behind mcphost to run automated tests that verify LLM-tool interactions with search and recommendation APIs.
  • Development sandbox with local models: Run mcphost + Ollama and this MCP server to simulate LLM-driven UI experiences without exposing production keys.

Warnings & Best Practices

  • This project is experimental and not supported by Algolia. Do not rely on it for production workloads.
  • If you enable write operations, supply an admin API key carefully and consider using short-lived/test keys.
  • Changes to the repository may occur; consider forking if you plan persistent customizations.
  • Monitor API usage to avoid unexpected charges when models trigger many requests.

For issues, contributions, or feedback, open an issue or PR in the repository: https://github.com/algolia/mcp

Tags:search