Meilisearch MCP 服务器是一款基于 Model Context Protocol (MCP) 的工具,它能提供高效且灵活的搜索和索引功能,帮助用户更便捷地处理数据搜索与索引相关任务。
在运行服务器之前,请确保设置以下环境变量:
MEILISERVER:指定 Meilisearch 服务的地址,默认为 http://localhost:7200。MCP_API_KEY:MCP 接口的认证密钥。支持动态调整连接参数,如代理和 SSL 验证。通过以下命令查看或修改配置:
# 查看当前配置
curl http://localhost:7200/config
# 修改配置
curl --data '{"tls_skip_verify":true}' http://localhost:7200/config
支持多种搜索模式,包括精确匹配和模糊搜索。例如:
# 精确查询
curl --user_key your_api_key --get 'http://localhost:7200/indexes/your_index_name/search?q=your_query'
# 模糊查询
curl --user_key your_api_key --data '{"q":"search term","page":1}' http://localhost:7200/indexes/your_index_name/search
启动 Meilisearch MCP 服务器:
python -m src.meilisearch_mcp
在 claude_desktop_config.json 中添加以下内容以集成 MCP 服务器:
{
"mcp_server": {
"url": "http://localhost:7200",
"api_key": "your_api_key"
}
}
使用 Node.js 工具启动 Inspector:
npx @modelcontextprotocol/inspector python -m src.meilisearch_mcp
get-connection-settings:获取当前连接设置。update-connection-settings:更新连接参数。create-index:创建新索引。delete-index:删除指定索引。list-indexes:查看所有索引。add-document:添加文档。get-document:获取单个文档。update-document:更新文档。delete-document:删除文档。get-settings:获取索引设置。update-settings:更新索引配置。create-task:创建新任务。get-task:获取任务状态。list-tasks:查看所有任务。cancel-task:取消未完成任务。health-check:检查服务器健康状态。get-stats:获取系统统计信息。get-version:查看 Meilisearch 版本。本项目遵循 MIT 协议。