Skip to main content
Glama

Elasticsearch MCP Server

Apache 2.0
127
  • Apple

Elasticsearch/OpenSearch MCP サーバー

概要

ElasticsearchとOpenSearchの連携を可能にするModel Context Protocol(MCP)サーバー実装。このサーバーは、ドキュメントの検索、インデックスの分析、そして一連のツールによるクラスター管理を可能にします。

デモ

https://github.com/user-attachments/assets/f7409e31-fac4-4321-9c94-b0ff2ea7ff15

特徴

一般業務

  • general_api_request : 一般的なHTTP APIリクエストを実行します。専用ツールがないElasticsearch/OpenSearch APIには、このツールを使用します。

インデックス操作

  • list_indices : すべてのインデックスを一覧表示します。
  • get_index : 1 つ以上のインデックスに関する情報 (マッピング、設定、エイリアス) を返します。
  • create_index : 新しいインデックスを作成します。
  • delete_index : インデックスを削除します。

ドキュメント操作

  • search_documents : ドキュメントを検索します。
  • index_document : インデックス内のドキュメントを作成または更新します。
  • get_document : ID でドキュメントを取得します。
  • delete_document : ID でドキュメントを削除します。
  • delete_by_query : 指定されたクエリに一致するドキュメントを削除します。

クラスター操作

  • get_cluster_health : クラスターの健全性に関する基本情報を返します。
  • get_cluster_stats : クラスター統計の概要を返します。

エイリアス操作

  • list_aliases : すべてのエイリアスを一覧表示します。
  • get_alias : 特定のインデックスのエイリアス情報を取得します。
  • put_alias : 特定のインデックスのエイリアスを作成または更新します。
  • delete_alias : 特定のインデックスのエイリアスを削除します。

環境変数を設定する

.env.exampleファイルを.envにコピーし、それに応じて値を更新します。

Elasticsearch/OpenSearch クラスターを起動する

Docker Compose を使用して Elasticsearch/OpenSearch クラスターを起動します。

# For Elasticsearch docker-compose -f docker-compose-elasticsearch.yml up -d # For OpenSearch docker-compose -f docker-compose-opensearch.yml up -d

Elasticsearchのデフォルトのユーザー名はelastic 、パスワードはtest123です。OpenSearchのデフォルトのユーザー名はadmin 、パスワードはadminです。

Kibana/OpenSearch ダッシュボードには http://localhost:5601からアクセスできます。

Claude Desktopでの使用

オプション1: Smithery経由でインストールする

Smithery経由で Claude Desktop 用の Elasticsearch Server を自動的にインストールするには:

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

オプション2: uvxを使用する

uvxを使用すると、PyPIからパッケージが自動的にインストールされるため、リポジトリをローカルにクローンする必要はありません。Claude Desktopの設定ファイルclaude_desktop_config.jsonに以下の設定を追加してください。

// For Elasticsearch { "mcpServers": { "elasticsearch-mcp-server": { "command": "uvx", "args": [ "elasticsearch-mcp-server" ], "env": { "ELASTICSEARCH_HOSTS": "https://localhost:9200", "ELASTICSEARCH_USERNAME": "elastic", "ELASTICSEARCH_PASSWORD": "test123" } } } } // For OpenSearch { "mcpServers": { "opensearch-mcp-server": { "command": "uvx", "args": [ "opensearch-mcp-server" ], "env": { "OPENSEARCH_HOSTS": "https://localhost:9200", "OPENSEARCH_USERNAME": "admin", "OPENSEARCH_PASSWORD": "admin" } } } }

オプション3: ローカル開発でUVを使用する

uvを使用するには、リポジトリをローカルにクローンし、ソースコードへのパスを指定する必要があります。Claude Desktop の設定ファイルclaude_desktop_config.jsonに以下の設定を追加してください。

// For Elasticsearch { "mcpServers": { "elasticsearch-mcp-server": { "command": "uv", "args": [ "--directory", "path/to/src/elasticsearch_mcp_server", "run", "elasticsearch-mcp-server" ], "env": { "ELASTICSEARCH_HOSTS": "https://localhost:9200", "ELASTICSEARCH_USERNAME": "elastic", "ELASTICSEARCH_PASSWORD": "test123" } } } } // For OpenSearch { "mcpServers": { "opensearch-mcp-server": { "command": "uv", "args": [ "--directory", "path/to/src/elasticsearch_mcp_server", "run", "opensearch-mcp-server" ], "env": { "OPENSEARCH_HOSTS": "https://localhost:9200", "OPENSEARCH_USERNAME": "admin", "OPENSEARCH_PASSWORD": "admin" } } } }
  • macOSの場合: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

新しい MCP サーバーをロードするには、Claude Desktop を再起動します。

次のような自然言語コマンドを使用して、Claude を通じて Elasticsearch/OpenSearch クラスターと対話できるようになりました。

  • 「クラスター内のすべてのインデックスを一覧表示する」
  • 「ボブという生徒は何歳ですか?」
  • 「クラスターのヘルスステータスを表示」

Anthropic MCPクライアントでの使用

uv run mcp_client/client.py src/server.py

ライセンス

このプロジェクトは、Apache License バージョン 2.0 に基づいてライセンスされています。詳細については、 LICENSEファイルを参照してください。

You must be authenticated.

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

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

モデルコンテキストプロトコル サーバーと自然言語コマンドを介してユーザーがインデックス操作、ドキュメント検索、クラスター管理を実行できるようにすることで、Elasticsearch クラスターとのやり取りを容易にします。

  1. 概要
    1. デモ
      1. 特徴
        1. 一般業務
        2. インデックス操作
        3. ドキュメント操作
        4. クラスター操作
        5. エイリアス操作
      2. 環境変数を設定する
        1. Elasticsearch/OpenSearch クラスターを起動する
          1. Claude Desktopでの使用
            1. オプション1: Smithery経由でインストールする
            2. オプション2: uvxを使用する
            3. オプション3: ローカル開発でUVを使用する
          2. Anthropic MCPクライアントでの使用
            1. ライセンス

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables LLMs to interact with Elasticsearch clusters, allowing them to manage indices and execute search queries using natural language.
                Last updated -
                1
                JavaScript
              • A
                security
                F
                license
                A
                quality
                Provides a scalable knowledge graph implementation for Model Context Protocol using Elasticsearch, enabling AI models to store and query information with advanced search capabilities, memory-like behavior, and multi-zone architecture.
                Last updated -
                17
                6
                TypeScript
              • A
                security
                A
                license
                A
                quality
                Provides an MCP protocol interface for interacting with Elasticsearch 7.x databases, supporting comprehensive search functionality including aggregations, highlighting, and sorting.
                Last updated -
                3
                1
                Python
                Apache 2.0
              • A
                security
                A
                license
                A
                quality
                Connects Claude and other MCP clients to Elasticsearch data, allowing users to interact with their Elasticsearch indices through natural language conversations.
                Last updated -
                3
                565
                241
                JavaScript
                Apache 2.0

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/cr7258/elasticsearch-mcp-server'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server