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.
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
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 .
Start the server by running the compiled binary:
./meilisearch-hybrid-search-mcp
The server listens on standard input/output for MCP protocol commands.
The MCP server provides a hybrid_search
tool with the following parameters:
keywords
(string, required): Your search query keywordssemantic_ratio
(number, optional, default: 0.5): Controls the balance between keyword and semantic search
0.0
: Pure keyword search1.0
: Pure semantic search0.5
: Equal balance between keyword and semantic searchfilterable_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")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"
}
}
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 > 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"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.