Skip to main content
Glama

Elasticsearch 7.x MCP Server

by imlewc

Servidor MCP de Elasticsearch 7.x

Un servidor MCP para Elasticsearch 7.x, que proporciona compatibilidad con las versiones de Elasticsearch 7.x.

Características

  • Proporciona una interfaz de protocolo MCP para interactuar con Elasticsearch 7.x
  • Admite operaciones básicas de Elasticsearch (ping, información, etc.)
  • Admite una funcionalidad de búsqueda completa, incluidas consultas de agregación, resaltado, clasificación y otras funciones avanzadas.
  • Acceda fácilmente a la funcionalidad de Elasticsearch a través de cualquier cliente MCP

Requisitos

  • Python 3.10+
  • Elasticsearch 7.x (se recomienda 7.17.x)

Instalación

Instalación mediante herrería

Para instalar Elasticsearch 7.x MCP Server para Claude Desktop automáticamente a través de Smithery :

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

Instalación manual

pip install -e .

Variables de entorno

El servidor requiere las siguientes variables de entorno:

  • ELASTIC_HOST : Dirección de host de Elasticsearch (por ejemplo, http://localhost:9200 )
  • ELASTIC_USERNAME : nombre de usuario de Elasticsearch
  • ELASTIC_PASSWORD : Contraseña de Elasticsearch
  • MCP_PORT : (opcional) Puerto de escucha del servidor MCP, predeterminado 9999

Uso de Docker Compose

  1. Cree un archivo .env y configure ELASTIC_PASSWORD :
ELASTIC_PASSWORD=your_secure_password
  1. Iniciar los servicios:
docker-compose up -d

Esto iniciará un clúster Elasticsearch 7.17.10 de tres nodos, Kibana y el servidor MCP.

Uso de un cliente MCP

Puede utilizar cualquier cliente MCP para conectarse al servidor MCP:

from mcp import MCPClient client = MCPClient("localhost:9999") response = client.call("es-ping") print(response) # {"success": true}

Documentación de la API

Métodos MCP admitidos actualmente:

  • es-ping : comprobar la conexión de Elasticsearch
  • es-info : Obtener información del clúster de Elasticsearch
  • es-search : Buscar documentos en el índice de Elasticsearch

Ejemplos de API de búsqueda

Búsqueda básica
# Basic search search_response = client.call("es-search", { "index": "my_index", "query": { "match": { "title": "search keywords" } }, "size": 10, "from": 0 })
Consulta de agregación
# Aggregation query agg_response = client.call("es-search", { "index": "my_index", "size": 0, # Only need aggregation results, no documents "aggs": { "categories": { "terms": { "field": "category.keyword", "size": 10 } }, "avg_price": { "avg": { "field": "price" } } } })
Búsqueda avanzada
# Advanced search with highlighting, sorting, and filtering advanced_response = client.call("es-search", { "index": "my_index", "query": { "bool": { "must": [ {"match": {"content": "search term"}} ], "filter": [ {"range": {"price": {"gte": 100, "lte": 200}}} ] } }, "sort": [ {"date": {"order": "desc"}}, "_score" ], "highlight": { "fields": { "content": {} } }, "_source": ["title", "date", "price"] })

Desarrollo

  1. Clonar el repositorio
  2. Instalar dependencias de desarrollo
  3. Ejecute el servidor: elasticsearch7-mcp-server

Licencia

[Licencia en archivo LICENSE]

Lengua china

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.

Proporciona una interfaz de protocolo MCP para interactuar con bases de datos Elasticsearch 7.x, admitiendo una funcionalidad de búsqueda integral que incluye agregaciones, resaltado y clasificación.

  1. Características
    1. Requisitos
      1. Instalación
        1. Instalación mediante herrería
        2. Instalación manual
      2. Variables de entorno
        1. Uso de Docker Compose
          1. Uso de un cliente MCP
            1. Documentación de la API
              1. Ejemplos de API de búsqueda
            2. Desarrollo
              1. Licencia

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  Facilitates interaction with Elasticsearch clusters by allowing users to perform index operations, document searches, and cluster management via a Model Context Protocol server and natural language commands.
                  Last updated -
                  6
                  127
                  Python
                  Apache 2.0
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Python MCP server that enables semantic search through Search Labs blog posts indexed in Elasticsearch, allowing Claude to intelligently retrieve relevant information from the blog content.
                  Last updated -
                  Python
                • 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
                • A
                  security
                  A
                  license
                  A
                  quality
                  Connects agents to Elasticsearch data using the Model Context Protocol, allowing natural language interaction with Elasticsearch indices through MCP Clients like Claude Desktop and Cursor.
                  Last updated -
                  11
                  105
                  7
                  TypeScript
                  MIT License
                  • Apple
                  • Linux

                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/imlewc/elasticsearch7-mcp-server'

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