Meilisearch MCP Server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Serves as a Model Context Protocol server implementation for Meilisearch, enabling AI assistants to interact with Meilisearch databases through a standardized interface for search, document management, and index operations

美丽搜索 MCP 服务器

美丽搜索的模型上下文协议 (MCP) 服务器实现,使 AI 助手能够通过标准化接口与美丽搜索进行交互。

特征

  • 索引管理:创建、更新和删除索引
  • 文档管理:添加、更新和删除文档
  • 搜索功能:使用各种参数和过滤器执行搜索
  • 设置管理:配置索引设置
  • 任务管理:监控和管理异步任务
  • 系统操作:健康检查、版本信息和统计数据
  • 矢量搜索:实验性矢量搜索功能

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Meilisearch MCP 服务器:

npx -y @smithery/cli install @devlimelabs/meilisearch-ts-mcp --client claude

手动安装

  1. 克隆存储库:
    git clone https://github.com/devlimelabs/meilisearch-ts-mcp.git cd meilisearch-ts-mcp
  2. 安装依赖项:
    npm install
  3. 根据示例创建一个.env文件:
    cp .env.example .env
  4. 编辑.env文件来配置您的 Meilisearch 连接。

Docker 设置

Meilisearch MCP Server 可以在 Docker 容器中运行,以便于部署和隔离。

使用 Docker Compose

开始使用 Docker 最简单的方法是使用 Docker Compose:

# Start the Meilisearch MCP Server docker-compose up -d # View logs docker-compose logs -f # Stop the server docker-compose down

手动构建并运行 Docker 镜像

您还可以手动构建并运行 Docker 镜像:

# Build the Docker image docker build -t meilisearch-ts-mcp . # Run the container docker run -p 3000:3000 --env-file .env meilisearch-ts-mcp

开发设置

对于想要为 Meilisearch MCP 服务器做出贡献的开发者,我们提供了一个方便的安装脚本:

# Clone the repository git clone https://github.com/devlimelabs-ts-mcp/meilisearch-ts-mcp.git cd meilisearch-ts-mcp # Run the development setup script ./scripts/setup-dev.sh

安装脚本将:

  1. 如果.env.example不存在,则从.env文件创建
  2. 安装依赖项
  3. 构建项目
  4. 运行测试以确保一切正常运行

运行安装脚本后,您可以以开发模式启动服务器:

npm run dev

用法

构建项目

npm run build

运行服务器

npm start

开发模式

npm run dev

Claude 桌面集成

Meilisearch MCP 服务器可以与 Claude for Desktop 集成,允许您直接通过 Claude 与您的 Meilisearch 实例进行交互。

自动设置

我们提供了一个安装脚本,可以自动配置 Claude for Desktop 与 Meilisearch MCP 服务器配合使用:

# First build the project npm run build # Then run the setup script node scripts/claude-desktop-setup.js

该脚本将:

  1. 检测您的操作系统并找到 Claude for Desktop 配置文件
  2. .env文件中读取 Meilisearch 配置
  3. 为 Claude for Desktop 生成必要的配置
  4. 提供更新 Claude for Desktop 配置的说明

手动设置

如果您希望手动配置 Claude for Desktop:

  1. 找到您的 Claude for Desktop 配置文件:
    • macOS~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows%APPDATA%\Claude\claude_desktop_config.json
    • Linux~/.config/Claude/claude_desktop_config.json
  2. 添加以下配置(根据需要调整路径):
{ "mcpServers": { "meilisearch": { "command": "node", "args": ["/path/to/meilisearch-ts-mcp/dist/index.js"], "env": { "MEILISEARCH_HOST": "http://localhost:7700", "MEILISEARCH_API_KEY": "your-api-key" } } } }
  1. 重新启动 Claude for Desktop 以应用更改。
  2. 在 Claude 中输入:“我想使用 Meilisearch MCP 服务器”以激活集成。

光标集成

Meilisearch MCP 服务器还可以与 AI 驱动的代码编辑器Cursor集成。

在光标中设置 MCP

  1. 安装并设置 Meilisearch MCP 服务器:
    git clone https://github.com/devlimelabs/meilisearch-ts-mcp.git cd meilisearch-ts-mcp npm install npm run build
  2. 启动 MCP 服务器:
    npm start
  3. 在 Cursor 中,打开命令面板 (Cmd/Ctrl+Shift+P) 并搜索“MCP:连接到 MCP 服务器”。
  4. 选择“连接到本地 MCP 服务器”并输入以下详细信息:
    • 名称: 美丽搜索
    • 命令:节点
    • 参数:/absolute/path/to/meilisearch-ts-mcp/dist/index.js
    • 环境变量
      MEILISEARCH_HOST=http://localhost:7700 MEILISEARCH_API_KEY=your-api-key
  5. 单击“连接”建立连接。
  6. 您现在可以通过 Cursor 与您的 Meilisearch 实例进行交互,只需输入诸如“在我的 Meilisearch 索引中搜索有关...的文档”之类的命令即可。

可用工具

Meilisearch MCP 服务器提供以下工具:

索引工具

  • create-index :创建新索引
  • get-index :获取有关索引的信息
  • list-indexes :列出所有索引
  • update-index :更新索引
  • delete-index :删除索引

文档工具

  • add-documents :将文档添加到索引
  • get-document :通过 ID 获取文档
  • get-documents :获取多个文档
  • update-documents :更新文档
  • delete-document :根据 ID 删除文档
  • delete-documents :删除多个文档
  • delete-all-documents :删除索引中的所有文档

搜索工具

  • search :搜索文档
  • multi-search :在单个请求中执行多个搜索

设置工具

  • get-settings :获取索引设置
  • update-settings :更新索引设置
  • reset-settings :将索引设置重置为默认值
  • 各种特定设置工具(同义词、停用词、排名规则等)

任务工具

  • list-tasks :列出带有可选过滤的任务
  • get-task :获取有关特定任务的信息
  • cancel-tasks :根据提供的过滤器取消任务
  • wait-for-task :等待特定任务完成

系统工具

  • health :检查Meilisearch服务器的健康状态
  • version :获取版本信息
  • info :获取系统信息
  • stats :获取有关索引的统计信息

矢量工具(实验性)

  • enable-vector-search :启用向量搜索
  • get-experimental-features :获取实验功能状态
  • update-embedders :配置嵌入器
  • get-embedders :获取嵌入器配置
  • reset-embedders :重置嵌入器配置
  • vector-search :执行向量搜索

执照

麻省理工学院

ID: mpo9y8xfor