Skip to main content
The Model Context Protocol (MCP) lets AI agents and LLM clients call external tools. Meilisearch ships a native MCP server at the POST /mcp route so any MCP-compatible client can search your indexes directly. The server exposes four read-only, search-focused tools: listIndexes, describeIndex, searchInIndexes, and facetSearch.

Requirements

  • A Meilisearch project running v1.54 or later
  • Your project’s host URL and an API key with the permissions below
  • An MCP client that supports remote HTTP servers, such as Claude Code, Codex, or Cursor

Enable the MCP route

The MCP server is currently an experimental feature. Configure experimental features to enable it.

Create an API key for MCP

Each MCP tool requires the same API key action as the route it wraps:
  • listIndexes requires indexes.get
  • describeIndex requires documents.get
  • searchInIndexes and facetSearch require search
Create a key with the indexes.get, documents.get, and search actions, limited to the indexes you want agents to reach.
The default Search API key does not have permissions for indexes.get and documents.get, so calls to listIndexes or describeIndex will fail.

Connect an MCP client

Register https://your-host/mcp as a remote MCP server and send the API key you created as a bearer token in the Authorization header. There is no OAuth flow. The API key is the only credential. Most clients allow configuring MCP servers through their UI. Some clients prefer configuration files, or accept configuration through CLI commands.
See the Claude Code, Codex, and Cursor documentation for the syntax each client expects for remote MCP servers with custom headers.

Available tools

The server’s instructions tell agents to call listIndexes, then describeIndex, then searchInIndexes, in that order, so the agent understands what data is available before searching it.
describeIndex only returns sample documents. It does not return an index’s settings or configured embedders.

Limitations

This MCP server only exposes search-related tools. It cannot create or delete indexes, add or edit documents, change index settings, manage API keys, or check tasks or instance health. Use the Meilisearch API or the Cloud UI for anything beyond search.

Troubleshooting

If your MCP client can’t connect or calls fail:
  • Confirm the mcpRoute experimental feature is enabled. When it is off, /mcp returns feature_not_enabled
  • Confirm the client sends your API key in an Authorization: Bearer header. A missing header returns missing_authorization_header
  • Confirm the key has search, documents.get, and indexes.get on the indexes you’re querying. A call that fails a permission check returns a JSON-RPC error
  • Confirm your client supports remote MCP servers over HTTP, rather than only local stdio servers
  • Check your client’s own logs for the raw error returned by the /mcp route

Legacy meilisearch-mcp server

The meilisearch-mcp Python package is as a local stdio process alongside desktop clients like Claude Desktop. It is deprecated in favor of the built-in /mcp route described on this page, and it is no longer actively maintained.