
Elasticsearch MCP 服务器,提供包括映射管理、搜索与索引、索引管理等功能。
概览
MCP 服务器,可以直接从任何 MCP 客户端(如 Claude Desktop、光标)连接到你的 Elasticsearch 集群。 该服务器通过模型上下文协议将代理连接到您的 Elasticsearch 数据。它允许您通过自然语言对话与 Elasticsearch 索引交互。 * elasticsearch_health:获取Elasticsearch集群健康状态,可选地包含索引级详细信息 * list_indices:列出可用的Elasticsearch索引,支持正则表达式 * create_index:创建带可选设置和映射的Elasticsearch索引* 重新索引:将数据从源索引重新索引到目标索引,可选择查询和脚本 * get_mappings:获取特定Elasticsearch索引的场映射 * create_mapping:创建或更新Elasticsearch索引的映射结构 * 搜索:使用提供的DSL查询执行Elasticsearch搜索* bulk:将大批量数据转换为Elasticsearch索引 * create_index_template:创建或更新索引模板 *...
概述(AI 翻译)
英文 |中文
MCP 服务器,可以直接从任何 MCP 客户端(如 Claude Desktop、光标)连接到你的 Elasticsearch 集群。
该服务器通过模型上下文协议将代理连接到您的 Elasticsearch 数据。它允许您通过自然语言对话与 Elasticsearch 索引交互。
演示
功能概述
可用功能
集群管理
elasticsearch_health:获取Elasticsearch集群健康状态,可选地包含索引级信息
索引操作
list_indices:列出可用的弹性搜索索引,支持正则表达式create_index:创建带有可选设置和映射的弹性搜索索引reindex:将数据从源索引重新索引到目标索引,可选择查询和脚本
地图管理
get_mappings:获取特定弹性搜索索引的场映射create_mapping:创建或更新Elasticsearch索引的映射结构
搜索与数据操作
search:使用提供的DSL查询执行Elasticsearch搜索bulk:将批量数据转换为弹性搜索索引
模板管理
create_index_template:创建或更新索引模板
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Elasticsearch MCP Server
MCP Server for connecting to your Elasticsearch cluster directly from any MCP Client (like Claude Desktop, Cursor).
This server connects agents to your Elasticsearch data using the Model Context Protocol. It allows you to interact with your Elasticsearch indices through natural language conversations.
Demo
Feature Overview
Available Features
Cluster Management
elasticsearch_health: Get Elasticsearch cluster health status, optionally including index-level details
Index Operations
list_indices: List available Elasticsearch indices, support regexcreate_index: Create Elasticsearch index with optional settings and mappingsreindex: Reindex data from a source index to a target index with optional query and script
Mapping Management
get_mappings: Get field mappings for a specific Elasticsearch indexcreate_mapping: Create or update mapping structure for an Elasticsearch index
Search & Data Operations
search: Perform an Elasticsearch search with the provided query DSLbulk: Bulk data into an Elasticsearch index
Template Management
create_index_template: Create or update an index templateget_index_template: Get information about index templatesdelete_index_template: Delete an index template
How It Works
- The MCP Client analyzes your request and determines which Elasticsearch operations are needed.
- The MCP server carries out these operations (listing indices, fetching mappings, performing searches).
- The MCP Client processes the results and presents them in a user-friendly format.
Getting Started
Prerequisites
- Elasticsearch 8.x (recommended; this is the current primary compatibility target)
- An Elasticsearch instance
- Elasticsearch authentication credentials (API key or username/password)
- MCP Client (e.g. Claude Desktop, Cursor)
[!NOTE] This project depends on the Node.js client
@elastic/elasticsearch@^8.17.1. That client dependency is not a minimum Elasticsearch server version. Elastic’s official compatibility matrix aligns client and server major versions and describes forward compatibility with higher minor versions within the same major version. This repository does not claim that every Elasticsearch 8.x minor or patch release has been validated;npm testcurrently runs TypeScript compilation only and does not establish Elasticsearch server compatibility. Elasticsearch 7.x, 9.x, and other major versions have not been validated.
Installation & Setup
Using the Published NPM Package
[!TIP]
安装
npx -y @awesome-ai/elasticsearch-mcp配置
{
"mcpServers": {
"elasticsearch-mcp": {
"command": "npx",
"args": [
"-y",
"@awesome-ai/elasticsearch-mcp"
],
"env": {
"ES_HOST": "your-elasticsearch-host",
"ES_API_KEY": "your-api-key"
}
}
}
}