Meilisearch MCP server

Integrates with Meilisearch to enable powerful search operations with filtering and sorting capabilities for structured data retrieval
Back to servers
Setup instructions
Provider
Shinnosuke Takeda
Release date
Mar 08, 2025
Language
Go

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.

Installation

Prerequisites

  • Go 1.24 or higher
  • Running Meilisearch instance

Build From Source

# Clone the repository
git clone https://github.com/cnosuke/mcp-meilisearch.git
cd mcp-meilisearch

# Install dependencies
make deps

# Build
make bin/mcp-meilisearch

Configuration

You can configure the connection to your Meilisearch server using either a YAML configuration file or environment variables.

Using config.yml

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

Using Environment Variables

Alternatively, you can use these environment variables:

  • MEILISEARCH_HOST: Address of Meilisearch server
  • MEILISEARCH_API_KEY: Meilisearch API key

Usage

Starting the Server

Start 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 file

Integrating with Claude Desktop

To 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.

Available Tools

The MCP server provides several tools that can be used to interact with Meilisearch.

Server Management

  • health_check: Check the Meilisearch server status
    • Parameters: None
    • Returns: Server health information

Index Management

  • list_indexes: Get all available indexes

    • Parameters: None
    • Returns: Array of indexes
  • create_index: Create a new index

    • Parameters:
      • uid: Unique identifier (required)
      • primary_key: Primary key for documents (optional)
    • Returns: Creation task information

Document Operations

  • get_documents: Retrieve documents from an index

    • Parameters:
      • index_uid: Index UID (required)
      • limit: Maximum documents to retrieve (optional)
      • offset: Documents to skip (optional)
      • fields: Specific fields to retrieve (optional)
    • Returns: Array of documents
  • add_documents: Add documents to an index

    • Parameters:
      • index_uid: Index UID (required)
      • documents: Array of documents to add (required)
      • primary_key: Primary key (optional)
    • Returns: Addition task information

Search

  • search: Search documents in an index
    • Parameters:
      • 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)
    • Returns: Search results

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later