Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-opensearch

该项目是一个基于OpenSearch的MCP服务器实现,为Claude等LLM应用提供语义记忆存储和检索功能,支持通过标准协议连接AI工具与数据源。

article

README

🚀 MCP-Server-OpenSearch:一个OpenSearch MCP服务器

MCP-Server-OpenSearch旨在为OpenSearch创建一个MCP服务器,实现LLM应用程序与OpenSearch这个分布式搜索和分析引擎之间的无缝集成,为LLM提供所需的上下文。

smithery徽章

⚠️ 重要提示

模型上下文协议 (MCP) 是一个开放协议,使LLM应用程序与外部数据源和工具之间实现无缝集成。无论您是构建AI驱动的IDE、增强聊天界面还是创建自定义AI工作流程,MCP都提供了一种标准化方式来连接LLM与其所需上下文。

此仓库展示了如何为OpenSearch创建一个MCP服务器的例子。OpenSearch是一个分布式搜索和分析引擎。

🚀 快速开始

当前阻碍 - OpenSearch的异步客户端无法安装

Open Search Async Client文档

pip install opensearch-py[async]
zsh: 没有匹配项:opensearch-py[async]

概述

一个基本的MCP服务器,用于在OpenSearch引擎中保存和检索记忆。它作为OpenSearch数据库之上的语义记忆层。

✨ 主要特性

组件 - 工具

  1. search-openSearch
    • 在OpenSearch数据库中存储一条记忆
    • 输入:
      • query(json):准备好的JSON查询消息
    • 返回:确认消息

📦 安装指南

通过Smithery安装

要自动使用Smithery为Claude Desktop安装mcp-server-opensearch:

npx -y @smithery/cli install @ibrooksSDX/mcp-server-opensearch --client claude

使用uv(推荐)

当使用uv时,无需特别安装即可直接运行mcp-server-opensearch

uv run mcp-server-opensearch \
  --opensearch-url "http://localhost:9200" \
  --index-name "my_index" \

uv run fastmcp run demo.py:main

💻 使用示例

测试 - 本地OpenSearch客户端

图片4

uv run python src/mcp-server-opensearch/test_opensearch.py

测试 - MCP服务器与OpenSearch客户端连接

图片1
图片2

cd src/mcp-server-opensearch
uv run fastmcp dev demo.py

与Claude Desktop的集成使用

要将此服务器与Claude Desktop应用程序一起使用,请在“mcpServers”部分的claude_desktop_config.json文件中添加以下配置:

{
  "opensearch": {
    "command": "uvx",
    "args": [
      "mcp-server-opensearch",
      "--opensearch-url",
      "http://localhost:9200",
      "--opensearch-api-key",
      "your_api_key", // 替换为您的API密钥
      "--index-name",
      "your_index_name" // 替换为您要使用的索引名称
    ]
  }, 
  "Demo": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp"
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client