This server provides a Go-based wrapper for Meilisearch search engine that functions as a Model Context Protocol (MCP) server, allowing large language models like Claude to access Meilisearch's search capabilities directly through the MCP protocol.
# Clone the repository
git clone https://github.com/cnosuke/mcp-meilisearch.git
cd mcp-meilisearch
# Install dependencies
make deps
# Build
make bin/mcp-meilisearch
You can configure the connection to your Meilisearch server using either a YAML configuration file or environment variables.
Create a config.yml
file with the following structure:
meilisearch:
host: http://localhost:7700 # Address of Meilisearch server
api_key: '' # Set API key if needed
Alternatively, you can use these environment variables:
MEILISEARCH_HOST
: Address of Meilisearch serverMEILISEARCH_API_KEY
: Meilisearch API keyStart the MCP server by running:
./bin/mcp-meilisearch server --config config.yml
Additional options:
--no-logs
: Minimize log output (show errors only)--log <file path>
: Output logs to the specified fileTo use the MCP server with Claude Desktop, add an entry to your claude_desktop_config.json
file:
{
"mcpServers": {
"sqlite": {
"command": "./bin/mcp-meilisearch",
"args": ["server", "--no-logs", "--log", "path_to_log_file"],
"env": {
"MEILISEARCH_HOST": "http://localhost:7700",
"MEILISEARCH_API_KEY": "api_key"
}
}
}
}
Important: Since MCP uses stdio for communication, you must redirect logs away from stdio using the --no-logs
and --log
flags as shown above.
The MCP server provides several tools that can be used to interact with Meilisearch.
list_indexes: Get all available indexes
create_index: Create a new index
uid
: Unique identifier (required)primary_key
: Primary key for documents (optional)get_documents: Retrieve documents from an index
index_uid
: Index UID (required)limit
: Maximum documents to retrieve (optional)offset
: Documents to skip (optional)fields
: Specific fields to retrieve (optional)add_documents: Add documents to an index
index_uid
: Index UID (required)documents
: Array of documents to add (required)primary_key
: Primary key (optional)index_uid
: Index to search (required)query
: Search query (required)limit
: Maximum results to return (optional)offset
: Results to skip (optional)filter
: Filter expression (optional)sort
: Array of sort criteria (optional)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "meilisearch" '{"command":"./bin/mcp-meilisearch","args":["server","--no-logs","--log","path_to_log_file"],"env":{"MEILISEARCH_HOST":"http://localhost:7700","MEILISEARCH_API_KEY":"api_key"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"meilisearch": {
"command": "./bin/mcp-meilisearch",
"args": [
"server",
"--no-logs",
"--log",
"path_to_log_file"
],
"env": {
"MEILISEARCH_HOST": "http://localhost:7700",
"MEILISEARCH_API_KEY": "api_key"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"meilisearch": {
"command": "./bin/mcp-meilisearch",
"args": [
"server",
"--no-logs",
"--log",
"path_to_log_file"
],
"env": {
"MEILISEARCH_HOST": "http://localhost:7700",
"MEILISEARCH_API_KEY": "api_key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect