Meilisearch Hybrid Search MCP server

Bridges Claude with Meilisearch's hybrid search capabilities, enabling adjustable semantic-to-keyword ratio searches with customizable document filtering for precise information retrieval.
Back to servers
Provider
miiton
Release date
Apr 03, 2025
Language
Go
Stats
11 stars

This MCP server lets you perform hybrid searches on a Meilisearch index, combining traditional keyword-based search with semantic vector search for more powerful and context-aware results.

Environment Setup

Before running the server, configure the following environment variables:

export MEILI_HOST="http://your-meilisearch-instance:7700" # Meilisearch host URL
export MEILI_API_KEY="your_api_key"                     # Meilisearch API key (if required)
export MEILI_INDEX="your_index_name"                    # The name of the index to search in
export MEILI_EMBEDDER="your_embedder_name"              # The name of the embedder configured in Meilisearch
export MEILI_FILTERABLE_ATTRIBUTES="attr1,attr2"        # Comma-separated filterable attributes

Installation

Build the server for your platform:

# For Linux
GOOS=linux GOARCH=amd64 go build -o meilisearch-hybrid-search-mcp .

# For macOS
GOOS=macos GOARCH=amd64 go build -o meilisearch-hybrid-search-mcp .

# For Windows
GOOS=windows GOARCH=amd64 go build -o meilisearch-hybrid-search-mcp.exe .

Running the Server

Start the server by running the compiled binary:

./meilisearch-hybrid-search-mcp

The server listens on standard input/output for MCP protocol commands.

Using the Hybrid Search Tool

The MCP server provides a hybrid_search tool with the following parameters:

Parameters

  • keywords (string, required): Your search query keywords
  • semantic_ratio (number, optional, default: 0.5): Controls the balance between keyword and semantic search
    • 0.0: Pure keyword search
    • 1.0: Pure semantic search
    • 0.5: Equal balance between keyword and semantic search
  • filterable_attribute (string, optional): The attribute to filter results on (e.g., "genre", "author")
  • filter_word (string, optional): The value to filter by (e.g., "Drama", "Tolkien")

Usage Examples

Basic hybrid search:

{
  "name": "hybrid_search",
  "arguments": {
    "keywords": "machine learning algorithms"
  }
}

Adjusting the semantic ratio for more contextual results:

{
  "name": "hybrid_search",
  "arguments": {
    "keywords": "machine learning algorithms",
    "semantic_ratio": 0.7
  }
}

Filtering results by a specific attribute:

{
  "name": "hybrid_search",
  "arguments": {
    "keywords": "fantasy adventures",
    "filterable_attribute": "genre",
    "filter_word": "Fantasy"
  }
}

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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