OpenSearch MCP Server

Apache 2.0
3
  • Apple

Integrations

  • Enables running an OpenSearch cluster through Docker Compose for development and testing purposes, with a preconfigured 3-node cluster setup.

  • Offers access to Kibana as part of the OpenSearch integration, allowing users to visualize and explore data stored in OpenSearch through the Kibana interface.

  • Provides tools for searching documents, analyzing indices, and managing OpenSearch clusters, including operations to list indices, retrieve mappings and settings, search documents using Query DSL, and monitor cluster health and statistics.

OpenSearch MCP 服务器

概述

此代码库由elastic-mcp-server分支而来,并转换为opensearch-mcp-server MCP 服务器。它是一个模型上下文协议 (MCP) 服务器实现,提供与 OpenSearch 的交互。该服务器支持通过一组工具搜索文档、分析索引和管理集群。

提供与开放搜索交互的模型上下文协议 (MCP) 服务器实现。该服务器通过一组工具支持文档搜索、索引分析和集群管理。

特征

索引操作

  • list_indices :列出 Opensearch 集群中的所有索引。
  • get_mapping :检索特定索引的映射配置。
  • get_settings :获取特定索引的设置配置。

文档操作

  • search_documents :使用 Opensearch Query DSL 在索引中搜索文档。

集群操作

  • get_cluster_health :获取集群的健康状态。
  • get_cluster_stats :获取有关集群的统计信息。

启动 Opensearch 集群

使用 Docker Compose 启动 Opensearch 集群:

docker-compose up -d

这将启动一个 3 节点的 Opensearch 集群和 Kibana。默认 Opensearch 用户名opensearch ,密码test123

您可以从http://localhost:5601访问 Kibana。

与 Claude Desktop 一起使用

使用 uv 进行本地开发

使用uv需要在本地克隆仓库并指定源代码路径。在 Claude Desktop 的配置文件claude_desktop_config.json中添加以下配置。

您需要将path/to/src/opensearch_mcp_server更改为您克隆存储库的路径。

{ "mcpServers": { "opensearch": { "command": "uv", "args": [ "--directory", "path/to/src/opensearch_mcp_server", "run", "opensearch-mcp-server" ], "env": { "OPENSEARCH_HOST": "https://localhost:9200", "OPENSEARCH_USERNAME": "opensearch", "OPENSEARCH_PASSWORD": "test123" } } } }
  • 在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

重新启动 Claude Desktop 以加载新的 MCP 服务器。

现在,您可以使用自然语言命令通过 Claude 与 Opensearch 集群进行交互,例如:

  • “列出集群中的所有索引”
  • “学生鲍勃多大了?”
  • “显示集群健康状态”

执照

该项目根据 Apache 许可证版本 2.0 获得许可 - 有关详细信息,请参阅LICENSE文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

模型上下文协议服务器实现,支持与 OpenSearch 集群进行自然语言交互,允许用户通过简单的对话命令搜索文档、分析索引和管理集群。

  1. Overview
    1. Features
      1. Index Operations
      2. Document Operations
      3. Cluster Operations
    2. Start Opensearch Cluster
      1. Usage with Claude Desktop
        1. Using uv with local development
      2. License
        ID: lddmyhpjgk