
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server, described as an enhanced version of the Official Elastic MCP Server, that connects AI assistants such as Claude Desktop to Elasticsearch clusters.
Unofficial Elasticsearch MCP Server is cataloged as an MCP server attributed to zx8086. A Model Context Protocol server, described as an enhanced version of the Official Elastic MCP Server, that connects AI assistants such as Claude Desktop to Elasticsearch clusters. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Apache License 2.0. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Unofficial Elasticsearch MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
With read-only mode enabled, destructive operations are blocked in strict mode with error responses, while warning mode allows them but logs prominent warnings.
Strict mode blocks all destructive operations and is intended for production monitoring and analytics, while warning mode permits operations with warnings and is suited to testing and controlled environments.
README.md · c0ad12859eda · 采集于 2026-11-13 12:46:02 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
A production-ready Model Context Protocol (MCP) server that connects AI assistants like Claude Desktop to Elasticsearch clusters. This server provides comprehensive Elasticsearch operations through natural language interactions, featuring advanced configuration management, security controls, and extensive tooling.
This is a comprehensive enhancement of the Official Elastic MCP Server, expanding from 4 core tools to 170+ specialized operations covering the full Elasticsearch ecosystem.
This project uses Bun as the JavaScript runtime for optimal performance. Install Bun using one of these methods:
macOS/Linux:
curl -fsSL https://bun.sh/install | bash
Windows (PowerShell):
irm bun.sh/install.ps1 | iex
Package Managers:
# npm
npm install -g bun
# Homebrew (macOS)
brew install bun
# Scoop (Windows)
scoop install bun
Verify installation:
bun --version
The easiest way to use the Elasticsearch MCP Server:
npx @elastic/mcp-server-elasticsearch
Clone the repository:
git clone https://github.com/elastic/mcp-server-elasticsearch.git
cd mcp-server-elasticsearch
Install dependencies:
bun install
Build the project:
bun run build
Create a .env file from the template:
cp .env.example .env
Minimal Configuration:
# Required
ES_URL=http://localhost:9200
# Authentication (choose one)
ES_API_KEY=your_api_key_here
# OR
ES_USERNAME=elastic
ES_PASSWORD=changeme
# Optional: Enable read-only mode for safety
READ_ONLY_MODE=false
LOG_LEVEL=info
# Basic validation
bun run validate-config
# Full validation with connection test
bun run validate-config:full
Add to your MCP client configuration:
For Published Package:
{
"mcpServers": {
"elasticsearch-mcp-server": {
"command": "npx",
"args": ["-y", "@elastic/mcp-server-elasticsearch"],
"env": {
"ES_URL": "your-elasticsearch-url",
"ES_API_KEY": "your-api-key"
}
}
}
}
For Local Development:
{
"mcpServers": {
"elasticsearch-mcp-server-local": {
"command": "bun",
"args": ["run", "/path/to/your/project/src/index.ts"],
"env": {
"ES_URL": "your-elasticsearch-url",
"ES_API_KEY": "your-api-key"
}
}
}
}
Open your MCP client and start asking questions about your Elasticsearch data:
This server features a comprehensive configuration system with type-safe validation and environment variable support.
| Variable | Description | Example |
|---|---|---|
ES_URL | Elasticsearch server URL | http://localhost:9200 |
API Key Authentication (Recommended):
ES_API_KEY=your_api_key_here
Username/Password Authentication:
ES_USERNAME=your_username
ES_PASSWORD=your_password
| Variable | Default | Description |
|---|---|---|
MCP_SERVER_NAME | elasticsearch-mcp-server | Server identification |
MCP_SERVER_VERSION | 0.1.1 | Server version |
READ_ONLY_MODE | false | Enable read-only mode |
READ_ONLY_STRICT_MODE | true | Block vs warn for destructive operations |
MCP_MAX_QUERY_TIMEOUT | 30000 | Maximum query timeout (ms) |
MCP_MAX_RESULTS_PER_QUERY | 1000 | Maximum results per query |
MCP_TRANSPORT | stdio | Transport mode (stdio or sse) |
MCP_PORT | 8080 | Server port (for SSE mode) |
| Variable | Default | Description |
|---|---|---|
ES_CA_CERT | - | Path to CA certificate file |
ES_MAX_RETRIES | 3 | Maximum retry attempts |
ES_REQUEST_TIMEOUT | 30000 | Request timeout (ms) |
ES_COMPRESSION | true | Enable response compression |
ES_ENABLE_META_HEADER | true | Enable client meta headers |
ES_DISABLE_PROTOTYPE_POISONING_PROTECTION | true | Disable prototype protection |
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | info | Log level (debug, info, warn, error) |
LOG_FORMAT | json | Log format (json or text) |
LOG_INCLUDE_METADATA | true | Include metadata in logs |
ES_URL=http://localhost:9200
LOG_LEVEL=debug
READ_ONLY_MODE=false
ES_URL=https://your-cluster.es.cloud.aws.com:443
ES_API_KEY=your_production_api_key
READ_ONLY_MODE=true
READ_ONLY_STRICT_MODE=true
LOG_LEVEL=info
ES_MAX_RETRIES=5
ES_REQUEST_TIMEOUT=60000
ES_URL=https://your-deployment.es.us-central1.gcp.cloud.es.io:443
ES_API_KEY=your_cloud_api_key
READ_ONLY_MODE=true
LOG_LEVEL=info
ES_URL=https://elasticsearch.company.com:9200
ES_USERNAME=mcp_user
ES_PASSWORD=secure_password
ES_CA_CERT=/etc/ssl/certs/elasticsearch-ca.pem
READ_ONLY_MODE=true
LOG_LEVEL=warn
The server supports read-only mode for safe operations in production:
READ_ONLY_MODE=true
READ_ONLY_STRICT_MODE=true
READ_ONLY_MODE=true
READ_ONLY_STRICT_MODE=false
list_indices - List all available Elasticsearch indicesget_mappings - Get field mappings for indicessearch - Perform searches with automatic highlightingget_shards - Get shard information and distributionget_document - Retrieve documents by IDindex_document - Create or update documents (Write Operation)update_document - Update existing documents (Write Operation)delete_document - Delete documents (Destructive Operation)document_exists - Check if documents existbulk_operations - Efficient bulk create/update/delete (Write/Destructive Operation)multi_get - Retrieve multiple documentsexecute_sql_query - Execute SQL queriescount_documents - Count matching documentsscroll_search - Handle large result setsmulti_search - Execute multiple searchesupdate_by_query - Bulk document updates (Write Operation)delete_by_query - Bulk document deletion (Destructive Operation)clear_scroll - Clear scroll contexts to free resourcescreate_index - Create new indices (Write Operation)delete_index - Delete indices (Destructive Operation)index_exists - Check index existenceget_index - Get index informationget_index_settings - Get index settingsupdate_index_settings - Modify index settings (Write Operation)put_mapping - Update index mappings (Write Operation)refresh_index - Force index refresh (Write Operation)flush_index - Force index flush (Write Operation)reindex_documents - Copy/move data between indices (Write Operation)search_template - Execute stored search templatesmulti_search_template - Execute multiple search templatesget_index_template - Get index template definitionsput_index_template - Create or update index templates (Write Operation)delete_index_template - Delete index templates (Destructive Operation)get_term_vectors - Get term vectors for documentsget_multi_term_vectors - Get term vectors for multiple documentsget_aliases - Get index aliasesput_alias - Create index aliases (Write Operation)delete_alias - Delete index aliases (Destructive Operation)update_aliases - Update multiple aliases atomically (Write Operation)get_cluster_health - Cluster health statusget_cluster_stats - Cluster statisticsget_nodes_info - Node informationget_nodes_stats - Node statisticsget_field_mapping - Get specific field mappingsclear_sql_cursor - Clear SQL cursorstranslate_sql_query - Convert SQL to Elasticsearch DSLilm_get_lifecycle - Get lifecycle policiesilm_put_lifecycle - Create or update lifecycle policies (Write Operation)ilm_delete_lifecycle - Delete lifecycle policies (Destructive Operation)ilm_explain_lifecycle - Explain lifecycle state of indicesilm_get_status - Get ILM statusilm_start - Start ILM plugin (Write Operation)ilm_stop - Stop ILM plugin (Write Operation)ilm_retry - Retry failed lifecycle steps (Write Operation)ilm_remove_policy - Remove policies from indices (Write Operation)ilm_move_to_step - Manually move index to lifecycle step (Destructive Operation)ilm_migrate_to_data_tiers - Migrate to data tiers (Destructive Operation)enrich_get_policy - Get enrich policy informationenrich_put_policy - Create enrich policies (Write Operation)enrich_delete_policy - Delete enrich policies (Destructive Operation)enrich_execute_policy - Execute enrich policies (Write Operation)enrich_stats - Get enrich statisticswatcher_put_watch - Create or update watch (Write Operation)watcher_get_watch - Get watch definitionwatcher_delete_watch - Delete watch (Destructive Operation)watcher_execute_watch - Execute watch (Write Operation)watcher_ack_watch - Acknowledge watch (Write Operation)watcher_activate_watch - Activate watch (Write Operation)watcher_deactivate_watch - Deactivate watch (Write Operation)watcher_stats - Get watcher statisticswatcher_start - Start watcher service (Write Operation)watcher_stop - Stop watcher service (Write Operation)autoscaling_get_policy - Get autoscaling policiesautoscaling_put_policy - Create autoscaling policies (Write Operation)autoscaling_delete_policy - Delete autoscaling policies (Destructive Operation)autoscaling_get_capacity - Get autoscaling capacityreindex_with_notifications - Reindex with progress notifications (Write Operation)bulk_index_with_progress - Bulk index with progress tracking (Write Operation)elasticsearch_diagnostics - Comprehensive cluster diagnosticsanalyze_timestamps - Analyze timestamp fields for data quality issues"What indices do I have in my cluster?"
"Show me the field mappings for the 'products' index"
"Count how many documents are in the logs index"
"What's the health status of my cluster?"
"Search for users with email containing 'gmail' in the users index"
"Find all error logs from the last 24 hours with severity high"
"Show me products with price between 100 and 500 sorted by popularity"
"Get aggregated sales data grouped by region and month"
"Create a new index called 'user-analytics' with timestamp mapping"
"Show me the cluster health and node information"
"List all indices that haven't been accessed in the last week"
"Update the refresh interval for the logs index to 30 seconds"
# Development
bun run dev # Start in development mode
bun run build # Build for production
bun run start # Start built server
# Configuration Management
bun run validate-config # Validate configuration
bun run validate-config:full # Full validation + connection test
bun run test-connection # Test Elasticsearch connection
# Quality & Testing
bun run test # Run tests
bun run lint # Lint code
bun run format # Format code
# Debugging
bun run inspector # Start MCP inspector for debugging
Clone and setup:
git clone <repository>
cd mcp-server-elasticsearch
bun install
Create development environment:
cp .env.example .env.dev
# Edit .env.dev with your local settings
Start development server:
bun run dev
Debug with MCP Inspector:
ES_URL=your-url ES_API_KEY=your-key bun run inspector
Open http://localhost:5173 for the inspector interface.
# Test configuration validity
bun run validate-config
# Test with connection verification
bun run validate-config:full --check-connection
# Show all configuration details
bun run validate-config --show-all
src/
config.ts # Centralized configuration system
index.ts # Entry point and server startup
server.ts # MCP server creation and setup
validation.ts # Environment and connection validation
tools/ # Tool implementations
index.ts # Tool registration
core/ # Core operations (search, list, mappings)
document/ # Document operations
search/ # Advanced search operations
index_management/ # Index management tools
cluster/ # Cluster monitoring tools
bulk/ # Bulk operations
analytics/ # Analytics and term vectors
alias/ # Index alias management
template/ # Template management
advanced/ # Advanced operations
mapping/ # Field mapping tools
ilm/ # Index Lifecycle Management
enrich/ # Enrich policies
utils/
logger.ts # MCP-compatible logging system
readOnlyMode.ts # Read-only mode management
The server uses a sophisticated configuration system:
POST /_security/api_key
{
"name": "es-mcp-server-access",
"role_descriptors": {
"mcp_server_role": {
"cluster": ["monitor"],
"indices": [
{
"names": ["index-1", "index-2", "index-pattern-*"],
"privileges": ["read", "view_index_metadata"]
}
]
}
}
}
Always Protected (Destructive):
delete_document, delete_index, delete_by_querydelete_alias, delete_index_templateProtected (Write/Modify):
index_document, update_document, bulk_operationscreate_index, update_index_settings, put_mappingAlways Allowed (Read-Only):
search, get_document, list_indicesget_mappings, count_documents, get_cluster_healthInvalid URL Format:
Error: ES_URL is not a valid URL format
**Solution:**Ensure URL includes protocol: http:// or https://
Missing Authentication:
Error: Either ES_API_KEY or both ES_USERNAME and ES_PASSWORD must be provided
**Solution:**Provide complete authentication credentials
Connection Refused:
Error: ECONNREFUSED
**Solution:**Verify Elasticsearch is running and URL is correct
SSL/TLS Issues:
Error: certificate verify failed
**Solution:**Use ES_CA_CERT or verify certificate configuration
Authentication Failed:
Error: 401 Unauthorized
**Solution:**Verify API key or username/password are correct
Operations Blocked:
READ-ONLY MODE: DESTRUCTIVE DELETE operation blocked
**Solution:**Set READ_ONLY_MODE=false or use read-only operations only
Enable debug logging for detailed troubleshooting:
LOG_LEVEL=debug bun run dev
# Check configuration
bun run validate-config
# Test connection
bun run validate-config:full
# Test specific operations
bun run test-connection
For debugging MCP protocol issues:
bun run inspector
Open http://localhost:6274 to inspect MCP communication.
mainbun run lint
bun run format
bun run test
bun run validate-config
This project is licensed under the Apache License 2.0. See LICENSE for details.
Built on Bun runtime for optimal performance:
**Need Help?**Check our troubleshooting guide for common solutions.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Unofficial Elasticsearch MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-server-elasticsearch-zx8086)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.