MCP Elasticsearch 20889a2d

MCP搜索检索

提供方 AeaZer

搜索检索 stdio · 本地进程 无需鉴权 社区 / 第三方 Claude DesktopClaudeCursor
查看接入方式

一个基于Elasticsearch的MCP服务器,提供与Elasticsearch 7、8和9版本的无缝集成,支持多种协议和丰富的操作工具。

一句话选型结论

按资料字段整理

MCP Elasticsearch 20889a2d 属于搜索检索类 MCP 服务器,stdio · 本地进程,无需鉴权,可直接接入 Claude Desktop、Claude、Cursor,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类搜索检索 传输方式stdio · 本地进程 鉴权无需鉴权 部署方式本地部署
GitHub 星标 9 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

搜索检索
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

Elasticsearch集成Go本地部署多协议支持集群管理索引操作文档操作搜索功能

安装与配置

stdio · 本地进程 无需鉴权
客户端在本机拉起子进程,数据不出本机
docker run --rm \

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Docker,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
联网搜索取证

让模型查最新资料并给出出处。

资料聚合

把一个主题的网页、文档集中抓回来整理。

情报与竞品检索

按关键词持续检索行业动态和竞品信息。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Elasticsearch 20889a2d当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Brave Search 433812ff 2 未标注 未标注 无 2026-05-17
Sequentialthinking 1 SSE · 服务端推送 远程部署 有 2026-05-18
Baidu Netdisk 未标注 未标注 未标注 无 2026-05-17
ragflow 未标注 stdio · 本地进程 本地部署 有 2026-04-11
mindsdb (430e18) 未标注 未标注 未标注 有 2026-05-17

服务器档案

搜索检索
字段来自项目仓库与公开索引,中文说明由本站标注
提供方AeaZer上游标注的维护方 AeaZer
分类搜索检索本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Docker本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

14.4 KB
来自项目仓库与上游目录的原文,未做删改

Elasticsearch MCP Server

Read this in other languages: English, 中文

Overview

An Elasticsearch MCP (Model Context Protocol) server built on github.com/modelcontextprotocol/go-sdk, providing seamless integration with Elasticsearch 7, 8, and 9 versions.

Features

  • 🔗 Multi-Protocol Support: Supports stdio, Streamable HTTP, and SSE protocols (SSE deprecated)
  • 📊 Multi-Version Compatibility: Compatible with Elasticsearch 7, 8, and 9
  • ⚙️ Environment Configuration: Configure via environment variables
  • 🔧 Rich Toolset: Complete set of Elasticsearch operation tools
  • 🌐 Production Ready: Docker support with optimized builds
  • 🐳 Container Ready: Pre-built Docker images available

Supported Tools

Cluster Operations

  • es_cluster_info: Get cluster information and version details
  • es_cluster_health: Get cluster health status and metrics

Index Management

  • es_index_create: Create new indices with settings and mappings
  • es_index_delete: Delete existing indices
  • es_index_exists: Check if an index exists
  • es_index_list: List all indices with metadata

Document Operations

  • es_document_index: Index documents with optional ID
  • es_document_get: Retrieve documents by ID
  • es_document_update: Update existing documents
  • es_document_delete: Delete documents by ID

Search Operations

  • es_search: Execute search queries with filters, sorting, and field selection
  • Supports: index, query, size, from, sort, _source
  • Full Elasticsearch Query DSL support

Bulk Operations

  • es_bulk: Execute multiple operations in a single request

Quick Start

Choose one of the following methods to run the Elasticsearch MCP server:

Method 1: Use Pre-built Docker Image (Recommended)```bash

Basic usage with local Elasticsearch

docker run --rm \
-e ES_ADDRESSES=http://localhost:9200 \
ghcr.io/aeazer/mcp-elasticsearch:latest

HTTP mode for remote access

docker run -d -p 8080:8080 \
-e MCP_PROTOCOL=http \
-e ES_ADDRESSES=http://your-elasticsearch:9200 \
ghcr.io/aeazer/mcp-elasticsearch:latest

With authentication

docker run -d -p 8080:8080 \
-e MCP_PROTOCOL=http \
-e ES_ADDRESSES=https://your-elasticsearch:9200 \
-e ES_USERNAME=elastic \
-e ES_PASSWORD=your-password \
-e ES_SSL=true \
ghcr.io/aeazer/mcp-elasticsearch:latest


### Method 2: Build Docker Image```bash
# Clone the repository
git clone https://github.com/AeaZer/mcp-elasticsearch.git
cd mcp-elasticsearch

# Build Docker image
docker build -t mcp-elasticsearch .

# Run the container
docker run -e ES_ADDRESSES=http://localhost:9200 -e ES_VERSION=8 mcp-elasticsearch

Method 3: Compile from Source```bash

Clone the repository

git clone https://github.com/AeaZer/mcp-elasticsearch.git
cd mcp-elasticsearch

Download dependencies and build

go mod download
go build -o mcp-elasticsearch main.go

Run with environment variables

export ES_ADDRESSES=http://localhost:9200
export ES_VERSION=8
export MCP_PROTOCOL=stdio
./mcp-elasticsearch


### Method 4: Desktop Application Integration (Cursor, Claude Desktop, etc.)

For integration with desktop applications that support MCP, you can configure the server through a configuration file:

#### Step 1: Build or Install the Executable

First, ensure you have the `mcp-elasticsearch` executable available:```bash
# Option A: Install directly from GitHub (Recommended)
go install github.com/AeaZer/mcp-elasticsearch@latest

# Option B: Build from source
git clone https://github.com/AeaZer/mcp-elasticsearch.git
cd mcp-elasticsearch
go mod download
go build -o mcp-elasticsearch main.go

# Option C: Download pre-built binary (Windows only)
# Download mcp-elasticsearch.exe from GitHub Releases
# macOS and Linux users should use Option A or B

> Note: Docker is not suitable for desktop application integration as it doesn't support stdio mode properly in this context. Use native executables instead.

Step 2: Make Executable Available

If you used go install (Option A), the executable is automatically placed in $GOPATH/bin or $GOBIN, which is typically already in your PATH environment variable.

If you built from source (Option B) or downloaded the pre-built binary (Option C), ensure the mcp-elasticsearch executable is in your system PATH environment variable, or use the full path in your configuration.

Step 3: Create MCP Configuration

Create or modify the MCP configuration file for your desktop application:

Cursor: Create or edit ~/.cursor/mcp.json (Linux/Mac) or %APPDATA%\Cursor\User\mcp.json (Windows)

Claude Desktop: Create or edit configuration in the appropriate location for your platform.

Configuration Examples

Basic Configuration:```json
{
"mcpServers": {
"elasticsearch": {
"command": "mcp-elasticsearch",
"env": {
"ES_ADDRESSES": "http://localhost:9200",
"ES_VERSION": "8"
}
}
}
}


**With Authentication:**```json
{
  "mcpServers": {
    "elasticsearch": {
      "command": "mcp-elasticsearch",
      "env": {
        "ES_ADDRESSES": "https://your-elasticsearch.com:9200",
        "ES_USERNAME": "elastic",
        "ES_PASSWORD": "your-password",
        "ES_VERSION": "8",
        "ES_SSL": "true"
      }
    }
  }
}

With API Key:```json
{
"mcpServers": {
"elasticsearch": {
"command": "mcp-elasticsearch",
"env": {
"ES_ADDRESSES": "https://your-elasticsearch.com:9200",
"ES_API_KEY": "your-api-key",
"ES_VERSION": "8"
}
}
}
}


**Elastic Cloud Configuration:**```json
{
  "mcpServers": {
    "elasticsearch": {
      "command": "mcp-elasticsearch",
      "env": {
        "ES_CLOUD_ID": "your-cloud-id",
        "ES_USERNAME": "elastic",
        "ES_PASSWORD": "your-password",
        "ES_VERSION": "8"
      }
    }
  }
}

Using Full Path (if not in PATH):```json
{
"mcpServers": {
"elasticsearch": {
"command": "/full/path/to/mcp-elasticsearch",
"env": {
"ES_ADDRESSES": "http://localhost:9200",
"ES_VERSION": "8"
}
}
}
}


#### Step 4: Restart Desktop Application

After creating or modifying the configuration file, restart your desktop application to load the new MCP server configuration.

#### Verification

Once configured, you should see Elasticsearch tools and resources available in your desktop application. The available tools include cluster operations, index management, document operations, search capabilities, and bulk operations as listed in the "Supported Tools" section above.

## Docker Usage Examples

### HTTP Server Mode (Recommended)```bash
docker run -d -p 8080:8080 \
  --name mcp-elasticsearch \
  -e MCP_PROTOCOL=http \
  -e ES_ADDRESSES=http://host.docker.internal:9200 \
  ghcr.io/aeazer/mcp-elasticsearch:latest

# Test the server endpoints
curl http://localhost:8080/health    # Health check
curl http://localhost:8080/mcp       # MCP endpoint (requires proper MCP client)

With Elastic Cloud```bash

docker run -d -p 8080:8080 \
-e MCP_PROTOCOL=http \
-e ES_CLOUD_ID="your-cloud-id" \
-e ES_USERNAME=elastic \
-e ES_PASSWORD="your-password" \
-e ES_VERSION=8 \
ghcr.io/aeazer/mcp-elasticsearch:latest


### SSE Server Mode (Not Recommended - Deprecated)
⚠️ **WARNING**: SSE protocol is deprecated and not recommended for production use. Use HTTP mode instead.```bash
docker run -d -p 8080:8080 \
  --name mcp-elasticsearch-sse \
  -e MCP_PROTOCOL=sse \
  -e ES_ADDRESSES=http://host.docker.internal:9200 \
  -e ES_VERSION=8 \
  ghcr.io/aeazer/mcp-elasticsearch:latest

# SSE endpoint (deprecated)
curl http://localhost:8080/sse

Using Docker Compose

Create a docker-compose.yml file:```yaml
version: '3.8'
services:
mcp-elasticsearch:
image: ghcr.io/aeazer/mcp-elasticsearch:latest
ports:
- "8080:8080"
environment:
- MCP_PROTOCOL=http
- ES_ADDRESSES=http://elasticsearch:9200
- ES_VERSION=8
depends_on:
- elasticsearch

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
ports:
- "9200:9200"


Run with: `docker-compose up -d`

## Configuration

All configuration is done via environment variables:

### Elasticsearch Configuration

| Variable | Description | Default |
|----------|-------------|---------|
| `ES_ADDRESSES` | Elasticsearch cluster addresses (comma-separated) | `http://localhost:9200` |
| `ES_USERNAME` | Username for basic authentication | - |
| `ES_PASSWORD` | Password for basic authentication | - |
| `ES_API_KEY` | API Key for authentication | - |
| `ES_CLOUD_ID` | Elastic Cloud ID | - |
| `ES_SSL` | Enable SSL/TLS | `false` |
| `ES_INSECURE_SKIP_VERIFY` | Skip SSL certificate verification | `false` |
| `ES_TIMEOUT` | Connection timeout | `30s` |
| `ES_MAX_RETRIES` | Maximum retry attempts | `3` |
| `ES_VERSION` | Target Elasticsearch version (7, 8, or 9) | `8` |

### MCP Server Configuration

| Variable | Description | Default |
|----------|-------------|---------|
| `MCP_SERVER_NAME` | Server name for MCP | `Elasticsearch MCP Server` |
| `MCP_SERVER_VERSION` | Server version | `1.0.0` |
| `MCP_PROTOCOL` | Protocol to use (`stdio`, `http`, or `sse` - deprecated) | `http` (in Docker), `stdio` (native) |
| `MCP_ADDRESS` | Streamable HTTP server address (HTTP mode only) | `0.0.0.0` (in Docker), `localhost` (native) |
| `MCP_PORT` | Streamable HTTP server port (HTTP mode only) | `8080` |

### Protocol Endpoints

Different protocols use different access methods:

#### Stdio Protocol
- **Access method**: Direct stdin/stdout communication
- **Use case**: LLM tool integration (Claude Desktop, etc.)
- **Endpoint**: N/A (direct process communication)

#### Streamable HTTP Protocol (Recommended)
- **MCP endpoint**: `http://host:port/mcp`
- **Health check**: `http://host:port/health`
- **Use case**: Remote access, n8n integration, API usage
- **Example**: `http://localhost:8080/mcp`

#### SSE Protocol (Deprecated)
- **MCP endpoint**: `http://host:port/sse`
- **Use case**: Legacy SSE clients (not recommended)
- **Example**: `http://localhost:8080/sse`
- ⚠️ **Warning**: Deprecated, use HTTP protocol instead

## Usage Examples

### Stdio Mode (Default for native builds)```bash
export ES_ADDRESSES=http://localhost:9200
export MCP_PROTOCOL=stdio
./mcp-elasticsearch

Streamable HTTP Mode (Default for Docker)```bash

export ES_ADDRESSES=http://localhost:9200
export MCP_PROTOCOL=http
export MCP_PORT=8080
./mcp-elasticsearch


### SSE Mode (Deprecated - Not Recommended)
⚠️ **WARNING**: SSE protocol is deprecated and not recommended for production use. Use Streamable HTTP instead.```bash
export ES_ADDRESSES=http://localhost:9200
export MCP_PROTOCOL=sse
export MCP_PORT=8080
./mcp-elasticsearch

Using with Elastic Cloud```bash

export ES_CLOUD_ID=your_cloud_id
export ES_USERNAME=elastic
export ES_PASSWORD=your_password
export ES_VERSION=8
./mcp-elasticsearch


## Development

### Prerequisites
- Go 1.23 or higher
- Access to an Elasticsearch cluster
- Docker (optional, for containerized development)

### Building```bash
go mod download
go build -o mcp-elasticsearch main.go

Testing```bash

go test ./...


### Building Docker Image```bash
docker build -t mcp-elasticsearch .

Tool Usage Examples

Get Cluster Information```json

{
"tool": "es_cluster_info",
"arguments": {}
}


### Create an Index```json
{
  "tool": "es_index_create",
  "arguments": {
    "index": "my-index",
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 0
    },
    "mappings": {
      "properties": {
        "title": {"type": "text"},
        "timestamp": {"type": "date"}
      }
    }
  }
}

Index a Document```json

{
"tool": "es_document_index",
"arguments": {
"index": "my-index",
"id": "doc1",
"body": {
"title": "Hello World",
"content": "This is a test document",
"timestamp": "2024-01-01T00:00:00Z"
}
}
}


### Advanced Search with Sorting and Field Selection```json
{
  "tool": "es_search",
  "arguments": {
    "index": "my-index",
    "query": {
      "bool": {
        "must": [
          {"match": {"title": "Hello"}}
        ],
        "filter": [
          {"range": {"timestamp": {"gte": "2024-01-01"}}}
        ]
      }
    },
    "sort": [
      {"timestamp": {"order": "desc"}},
      {"_score": {"order": "desc"}}
    ],
    "_source": ["title", "content", "timestamp"],
    "size": 20,
    "from": 0
  }
}

Health Monitoring

When running in HTTP mode, the server provides multiple endpoints:

Health Check Endpoint```bash

Check server health (publicly accessible)

curl http://localhost:8080/health

Response

{"status":"healthy","server":"elasticsearch-mcp"}


### MCP Protocol Endpoint```bash
# MCP communication endpoint (requires MCP client)
# URL: http://localhost:8080/mcp
# This endpoint handles MCP protocol messages and tool calls
# Not directly accessible via simple HTTP GET requests

Important Notes

  • Health endpoint (/health): Simple HTTP GET for monitoring
  • MCP endpoint (/mcp): For MCP protocol communication only
  • SSE endpoint (/sse): Deprecated, avoid using

Error Handling

All errors are reported within the MCP tool results with isError: true, allowing LLMs to see and handle errors appropriately. Protocol-level errors are reserved for exceptional conditions like missing tools or server failures.

Troubleshooting

Container Issues

  • Container exits immediately: Ensure you're using HTTP protocol for Docker containers
  • Cannot connect to Elasticsearch: Use host.docker.internal:9200 instead of localhost:9200 in Docker
  • Permission denied: Check Docker daemon permissions and image access

Network Issues

  • Connection refused: Verify Elasticsearch is running and accessible
  • SSL errors: Set ES_INSECURE_SKIP_VERIFY=true for testing with self-signed certificates

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Official MCP Go SDK - Official MCP implementation for Go
  • Elastic - Official Elasticsearch Go client
  • Model Context Protocol - Protocol specification

Built with ❤️ for the Go community

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
MCP Elasticsearch 20889a2d 怎么安装?

在客户端按下面的安装命令接入:docker run --rm \。装完在客户端配置里引用同一个包或端点。

MCP Elasticsearch 20889a2d 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Elasticsearch 20889a2d 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Elasticsearch 20889a2d 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Elasticsearch 20889a2d 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Elasticsearch 20889a2d 能提供哪些能力?

资料显示能力标签包括 多协议支持、Go、Claude、集群管理。具体工具清单以官方文档为准。

MCP Elasticsearch 20889a2d 需要什么运行环境?

运行时为 Docker;属于本地进程,需要在本机装好运行环境。

MCP Elasticsearch 20889a2d 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。