米利搜索MCP

@meilisearch/meilisearch-mcp
Hosted
0 Stars 1.0k 次浏览 meilisearch 更新于 2026-08-23

用于通过 Claude 等 LLM 接口与 [Meilisearch](https://www.meilisearch.com/) 交互的服务器。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "meilisearch": {
      "args": [
        "-n",
        "meilisearch-mcp"
      ],
      "command": "uvx"
    }
  }
}

该服务需要配置环境变量:MEILI_HTTP_ADDR、MEILI_MASTER_KEY

可用工具 (21 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get-connection-settings

Get current Meilisearch connection settings

该工具无需必填参数,直接调用即可

update-connection-settings 2 个参数

Update Meilisearch connection settings

该工具无需必填参数,直接调用即可

health-check

Check Meilisearch server health

该工具无需必填参数,直接调用即可

get-version

Get Meilisearch version information

该工具无需必填参数,直接调用即可

get-stats

Get database statistics

该工具无需必填参数,直接调用即可

create-index 2 个参数 需填 1 项

Create a new Meilisearch index

必填参数:uid

list-indexes

List all Meilisearch indexes

该工具无需必填参数,直接调用即可

get-documents 3 个参数 需填 1 项

Get documents from an index

必填参数:indexUid

add-documents 3 个参数 需填 2 项

Add documents to an index

必填参数:indexUid、documents

get-settings 1 个参数 需填 1 项

Get current settings for an index

必填参数:indexUid

update-settings 2 个参数 需填 2 项

Update settings for an index

必填参数:indexUid、settings

search 6 个参数 需填 1 项

Search through Meilisearch indices. If indexUid is not provided, it will search across all indices.

必填参数:query

get-task 1 个参数 需填 1 项

Get information about a specific task

必填参数:taskUid

get-tasks 15 个参数

Get list of tasks with optional filters

该工具无需必填参数,直接调用即可

cancel-tasks 4 个参数

Cancel tasks based on filters

该工具无需必填参数,直接调用即可

get-keys 2 个参数

Get list of API keys

该工具无需必填参数,直接调用即可

create-key 4 个参数 需填 2 项

Create a new API key

必填参数:actions、indexes

delete-key 1 个参数 需填 1 项

Delete an API key

必填参数:key

get-health-status

Get comprehensive health status of Meilisearch

该工具无需必填参数,直接调用即可

get-index-metrics 1 个参数 需填 1 项

Get detailed metrics for an index

必填参数:indexUid

get-system-info

Get system-level information

该工具无需必填参数,直接调用即可

服务介绍

Meilisearch MCP 服务器

一个用于通过像 Claude 这样的 LLM 接口与 Meilisearch 交互的 Model Context Protocol (MCP) 服务器。

特性

安装

# Clone repository
git clone <repository_url>
cd meilisearch-mcp

# Create virtual environment and install
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .

要求

  • Python ≥ 3.9
  • 正在运行的 Meilisearch 实例
  • Node.js(用于使用 MCP Inspector 测试)

使用方法

环境变量

MEILI_HTTP_ADDR=http://localhost:7700  # Default Meilisearch URL
MEILI_MASTER_KEY=your_master_key       # Optional: Default Meilisearch API key

动态连接配置

服务器提供了工具来查看和更新运行时的连接设置:

  • get-connection-settings:查看当前连接 URL 和 API 密钥状态
  • update-connection-settings:更新 URL 和/或 API 密钥以连接到不同的 Meilisearch 实例

通过 MCP 的示例用法:

// Get current settings
{
  "name": "get-connection-settings"
}

// Update connection settings
{
  "name": "update-connection-settings",
  "arguments": {
    "url": "http://new-host:7700",
    "api_key": "new-api-key"
  }
}

搜索功能

服务器提供了一个灵活的搜索工具,可以在一个或所有索引中进行搜索:

  • search:使用可选参数通过 Meilisearch 索引进行搜索

通过 MCP 的示例用法:

// Search in a specific index
{
  "name": "search",
  "arguments": {
    "query": "search term",
    "indexUid": "movies",
    "limit": 10
  }
}

// Search across all indices
{
  "name": "search",
  "arguments": {
    "query": "search term",
    "limit": 5,
    "sort": ["releaseDate:desc"]
  }
}

可用的搜索参数:

  • query:搜索查询(必需)
  • indexUid:要搜索的具体索引(可选)
  • limit:每个索引的最大结果数(可选,默认为 20)
  • offset:跳过的结果数量(可选,默认为 0)
  • filter:过滤表达式(可选)
  • sort:排序规则(可选)

运行服务器

python -m src.meilisearch_mcp

与 Claude Desktop 一起使用

要与 Claude Desktop 一起使用,请将以下内容添加到你的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "meilisearch": {
      "command": "uvx",
      "args": ["-n", "meilisearch-mcp"]
    }
  }
}

使用 MCP Inspector 测试

npx @modelcontextprotocol/inspector python -m src.meilisearch_mcp

可用工具

连接管理

  • get-connection-settings:查看当前 Meilisearch 连接 URL 和 API 密钥状态
  • update-connection-settings:更新 URL 和/或 API 密钥以连接到不同的实例

索引管理

  • create-index:创建一个新的索引,并可选地指定主键
  • list-indexes:列出所有可用的索引
  • get-index-metrics:获取特定索引的详细指标

文档操作

  • get-documents:从索引中分页检索文档
  • add-documents:向索引中添加或更新文档

搜索

  • search:具有过滤和排序选项的跨单个或多个索引的灵活搜索

设置管理

  • get-settings:查看索引的当前设置
  • update-settings:更新索引设置(排名、分类等)

API 密钥管理

  • get-keys: 列出所有 API 密钥
  • create-key: 创建具有特定权限的新 API 密钥
  • delete-key: 删除现有的 API 密钥

任务管理

  • get-task: 获取特定任务的信息
  • get-tasks: 列出任务,可选过滤条件:
    • limit: 返回的最大任务数量
    • from: 跳过的任务数量
    • reverse: 任务的排序顺序
    • batchUids: 按批次 UID 过滤
    • uids: 按任务 UID 过滤
    • canceledBy: 按取消来源过滤
    • types: 按任务类型过滤
    • statuses: 按任务状态过滤
    • indexUids: 按索引 UID 过滤
    • afterEnqueuedAt/beforeEnqueuedAt: 按入队时间过滤
    • afterStartedAt/beforeStartedAt: 按开始时间过滤
    • afterFinishedAt/beforeFinishedAt: 按完成时间过滤
  • cancel-tasks: 取消待处理或已入队的任务
  • delete-tasks: 删除已完成的任务

系统监控

  • health-check: 基本健康检查
  • get-health-status: 综合健康状态
  • get-version: 获取 Meilisearch 版本信息
  • get-stats: 获取数据库统计信息
  • get-system-info: 获取系统级信息

贡献

  1. Fork 仓库
  2. 创建功能分支
  3. 提交更改
  4. 创建拉取请求

许可证

MIT

相关 MCP 服务