CE

cr7258/elasticsearch-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

314 stars 67 forks Качество 85 Тренд 33Apache-2.0

cr7258/elasticsearch-mcp-server — это кандидат на MCP-сервер, импортированный из https://github.com/cr7258/elasticsearch-mcp-server.

Обзор

cr7258/elasticsearch-mcp-server — это кандидат на MCP-сервер, импортированный из https://github.com/cr7258/elasticsearch-mcp-server.

Обзор (машинный перевод)

Обзор

Реализация сервера Model Context Protocol (MCP), обеспечивающая взаимодействие Elasticsearch и OpenSearch. Этот сервер позволяет искать документы, анализировать индексы и управлять кластером с помощью набора инструментов.

Демо

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

Особенности

Общие операции

  • general_api_request: Выполнить общий запрос HTTP API. Используйте этот инструмент для любого Elasticsearch/OpenSearch API без выделенного инструмента.

Индексные операции

  • list_indices: Перечислить все индексы.
  • get_index: Возвращает информацию (отображения, настройки, псевдонимы) об одном или нескольких индексах.
  • create_index: Создать новый индекс.
  • delete_index: Удалить индекс.
  • create_data_stream: Создать новый поток данных (требуется шаблон сопоставления индекса).
  • get_data_stream: Получить информацию об одном или нескольких потоках данных.
  • delete_data_stream: Удалить один или несколько потоков данных и их поддерживающих индексов.

Операции с документами

  • search_documents: Поиск документов.
  • index_document: Создаёт или обновляет документ в индексе.
  • get_document: Получите документ по удостоверению личности.
  • delete_document: Удалить документ по ID.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Elasticsearch/OpenSearch MCP Server

Overview

A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction. This server enables searching documents, analyzing indices, and managing cluster through a set of tools.

Demo

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

Features

General Operations

  • general_api_request: Perform a general HTTP API request. Use this tool for any Elasticsearch/OpenSearch API that does not have a dedicated tool.

Index Operations

  • list_indices: List all indices.
  • get_index: Returns information (mappings, settings, aliases) about one or more indices.
  • create_index: Create a new index.
  • delete_index: Delete an index.
  • create_data_stream: Create a new data stream (requires matching index template).
  • get_data_stream: Get information about one or more data streams.
  • delete_data_stream: Delete one or more data streams and their backing indices.

Document Operations

  • search_documents: Search for documents.
  • index_document: Creates or updates a document in the index.
  • get_document: Get a document by ID.
  • delete_document: Delete a document by ID.
  • delete_by_query: Deletes documents matching the provided query.

Cluster Operations

  • get_cluster_health: Returns basic information about the health of the cluster.
  • get_cluster_stats: Returns high-level overview of cluster statistics.

Alias Operations

  • list_aliases: List all aliases.
  • get_alias: Get alias information for a specific index.
  • put_alias: Create or update an alias for a specific index.
  • delete_alias: Delete an alias for a specific index.

Analyzer Operations

  • analyze_text: Analyze text using a specified analyzer or custom analysis chain. Useful for debugging search queries and understanding how text is tokenized.

Configure Environment Variables

The MCP server supports the following environment variables:

Basic Authentication (Username/Password)

  • ELASTICSEARCH_USERNAME: Username for basic authentication
  • ELASTICSEARCH_PASSWORD: Password for basic authentication
  • OPENSEARCH_USERNAME: Username for OpenSearch basic authentication
  • OPENSEARCH_PASSWORD: Password for OpenSearch basic authentication
Открыть полный README на GitHub

Установка

uvx elasticsearch-mcp-server
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "elasticsearch-mcp-server": { "command": "uvx", "args": [ "elasticsearch-mcp-server" ], "env": { "ELASTICSEARCH_CLUSTERS": "{\"prod\": {\"hosts\": [\"https://prod-es:9200\"], \"api_key\": \"<PROD_API_KEY>\", \"verify_certs\": true}, \"staging\": {\"hosts\": [\"https://staging-es:9200\"], \"username\": \"elastic\", \"password\": \"<STAGING_PASSWORD>\"}}", "DEFAULT_CLUSTER": "prod" } } } }