Meilisearch MCP Server for Conversational Search
Enable AI assistants to manage indexes, perform conversational searches, and handle data with Meilisearch via an MCP server.
npx -y @meilisearch/meilisearch-mcpOverview
The Meilisearch MCP Server implements the Model Context Protocol (MCP) so language models and agent frameworks can manage Meilisearch instances through conversational flows. It exposes Meilisearch functionality as MCP tools over stdio, letting any MCP-compatible client (Claude, OpenAI agents, or other LLM-driven systems) create indices, add documents, run searches, tune settings, and monitor tasks without calling the Meilisearch HTTP API directly.
This server is useful when you want to embed search and retrieval into agent workflows or conversational applications. Instead of embedding the Meilisearch HTTP client inside your agent logic, the agent talks to the MCP server; the server translates agent actions into Meilisearch operations, handles credentials, and returns structured results suitable for downstream reasoning or presentation.
Repository: https://github.com/meilisearch/meilisearch-mcp
Features
- Index management: create, update, delete indices and primary keys
- Document operations: add, update, and delete documents (batching supported)
- Search and multi-index search: natural and filtered searches, sorting, pagination
- Settings management: update ranking rules, synonyms, stop words, searchable/sortable attributes
- Task and health monitoring: track asynchronous indexing tasks and instance health
- API key handling: configure and switch API keys securely at runtime
- Dynamic connection switching: connect to multiple Meilisearch instances without restarting
- stdio MCP transport: compatible with MCP clients that use stdio (e.g., Claude Desktop); other transports may be added later
- Deployable via PyPI package, Docker image, or from-source installation
Installation / Configuration
Prerequisites:
- Python ≥ 3.9 (for source / pip installation) or Docker
- A running Meilisearch instance
- MCP-compatible client (Claude Desktop, OpenAI agents, etc.)
Install from PyPI:
Run with uvx (recommended for MCP stdio integration):
Run via Docker (recommended in containers and CI):
Common environment variables:
| Variable | Purpose | Example |
|---|---|---|
| MEILI_HTTP_ADDR | Meilisearch HTTP address | http://meilisearch:7700 |
| MEILI_MASTER_KEY | Master API key for Meilisearch | masterKey |
| MCP_LOG_LEVEL | Logging level for the server | info, debug |
Configure Claude Desktop (example snippet):
From source (development):
Available Tools / Resources
The server exposes a set of MCP tools that agents can call. Typical tool names and capabilities include:
- list_indices — List existing indices and basic stats
- create_index — Create an index with optional primary key
- delete_index — Remove an index
- add_documents — Add or replace documents in an index (batch)
- get_document / delete_document — Single-document operations
- search — Query an index with filters, sort, and pagination
- search_multi — Run a search across multiple indices and aggregate results
- update_settings — Modify ranking rules, synonyms, stop words, etc.
- get_tasks — Inspect indexing tasks and status
- health — Check Meilisearch instance health
- api_keys — List and manage API keys (if enabled)
Return payloads are JSON-serializable and structured to make it easy for an LLM to reason over results (e.g., top hits, counts, task statuses).
Use Cases
- Conversational RAG (Retrieval-Augmented Generation): Connect an assistant to Meilisearch for retrieving relevant documents (e.g., knowledge base articles) in response to user queries, then synthesize answers with contextual citations.
- Agent-driven data management: Let an autonomous agent create indices, ingest data, and tune searching behavior as part of a workflow (e.g., automating e-commerce catalog updates).
- Multi-index exploration: Ask an assistant to search across several indices (blogs, docs, tutorials) and summarize cross-index findings.
- Integrations with automation platforms (n8n, Airflow): Run the MCP server as a container to expose search capabilities to low-code flows and orchestrations.
Example conversation-driven flow:
- User: “Create an index called products with id as primary key.”
- Agent calls create_index({“name”:“products”,“primaryKey”:“id”})
- Server returns success and index metadata.
- User: “Add a few products.” Agent calls add_documents with a list of product JSONs.
- User: “Search for electronics under $50.” Agent calls search with filter “category = ‘electronics’ AND price <= 50”.
Tips and Best Practices
- Use sortable attributes for fields you plan to sort on (e.g., “date”, “price”).
- Batch document uploads to reduce task overhead.
- Use multi-index searches for cross-collection discovery, then refine with index-specific filters.
- Manage API keys and environment variables securely in production deployments.
For full implementation details, supported tool signatures, and examples, see the repository: https://github.com/meilisearch/meilisearch-mcp