Skip to main content
Glama
Meilisearch MCP Server

Meilisearch MCP Server

Official
by meilisearch

美丽搜索 MCP 服务器

模型上下文协议 (MCP) 服务器,用于通过 Claude 等 LLM 接口与 Meilisearch 交互。

特征

Related MCP server: Perplexity MCP Server

安装

# 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

  • 运行美丽搜索实例

  • 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. 创建拉取请求

执照

麻省理工学院

Available Tools

22 tools
add-documentsC

Add documents to an index

Inputs: documents (required), indexUid (required), primaryKey.

cancel-tasksC

Cancel tasks based on filters

Inputs: indexUids, statuses, types, uids.

create-indexC

Create a new Meilisearch index

Inputs: uid (required), primaryKey.

create-keyC

Create a new API key

Inputs: actions (required), indexes (required), description, expiresAt.

delete-indexC

Delete a Meilisearch index

Inputs: uid (required).

delete-keyC

Delete an API key

Inputs: key (required).

get-connection-settingsB

Get current Meilisearch connection settings

Inputs: no named parameters.

get-documentsC

Get documents from an index

Inputs: indexUid (required), limit, offset.

get-health-statusB

Get comprehensive health status of Meilisearch

Inputs: no named parameters.

get-index-metricsC

Get detailed metrics for an index

Inputs: indexUid (required).

get-keysC

Get list of API keys

Inputs: limit, offset.

get-settingsC

Get current settings for an index

Inputs: indexUid (required).

get-statsC

Get database statistics

Inputs: no named parameters.

get-system-infoC

Get system-level information

Inputs: no named parameters.

get-taskC

Get information about a specific task

Inputs: taskUid (required).

get-tasksC

Get list of tasks with optional filters

Inputs: afterEnqueuedAt, afterFinishedAt, afterStartedAt, batchUids, +11 more.

get-versionB

Get Meilisearch version information

Inputs: no named parameters.

health-checkB

Check Meilisearch server health

Inputs: no named parameters.

list-indexesB

List all Meilisearch indexes

Inputs: no named parameters.

update-connection-settingsC

Update Meilisearch connection settings

Inputs: api_key, url.

update-settingsC

Update settings for an index

Inputs: indexUid (required), settings (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific resources like indexes, documents, tasks, keys, or settings, with clear boundaries. However, get-health-status and health-check could cause confusion as they both relate to health monitoring, though their descriptions differ slightly (comprehensive vs. basic check).

    Naming Consistency5/5

    Tool names follow a consistent verb-noun pattern with hyphens throughout, such as create-index, get-documents, and update-settings. There are no deviations in style or convention, making the set predictable and easy to parse.

    Tool Count4/5

    With 22 tools, the count is on the higher side but reasonable for a comprehensive Meilisearch server covering indexes, documents, tasks, keys, settings, and system info. It feels slightly heavy but not excessive, as each tool serves a specific function in the domain.

    Completeness5/5

    The tool set provides complete CRUD/lifecycle coverage for Meilisearch operations, including index management (create, delete, list), document handling (add, get, search), task monitoring (get, cancel), key management (create, delete, get), and settings (get, update). No obvious gaps are present for the server's purpose.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers