Skip to main content
MCP server CX Codex

Elasticsearch · elastic — Claude Code MCP server: query indices

This MCP server lets AI agents query Elasticsearch indices in natural language. It is deprecated and will receive critical security updates only.

no license updated 2026-10-29

Open on GitHub

What Elasticsearch does

The server connects an AI agent to Elasticsearch through the Model Context Protocol. An agent can query indices and retrieve records from a natural-language request, without a custom API for each task. Choose stdio for a direct client connection or streamable-HTTP for web integrations and concurrent clients.

You need an Elasticsearch 8.x or 9.x cluster reachable from AWS, Docker, network access to the cluster, and valid credentials. Set ES_URL and authenticate with either ES_API_KEY or ES_USERNAME plus ES_PASSWORD. For stdio, start the container with docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio; HTTP mode uses http and port 8080. The connection will fail if the cluster cannot be reached or the credentials are invalid.

Elastic has deprecated this server and plans to provide critical security updates only. Its suggested replacement is the MCP endpoint in Elastic Agent Builder, available in Elastic 9.2.0+ and Elasticsearch Serverless projects. That status matters when choosing a server for a new deployment.

What it helps with

  • query Elasticsearch indices with natural-language requests
  • retrieve cluster records without creating a separate API for each task
  • connect concurrent clients through streamable-HTTP
  • check whether an agent can access Elasticsearch indices

Example prompts for the agent

  • Search my Elasticsearch indices for records related to …
  • Analyze the data in my Elasticsearch cluster and return matching documents.
  • Check whether you can retrieve records from the Elasticsearch indices.

How to install Elasticsearch

Install

The MCP registry has no launch command for it: see the repository README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Elasticsearch

How do I install Elasticsearch MCP server for Claude Code?

Have an Elasticsearch 8.x or 9.x cluster reachable from AWS, Docker, and valid credentials ready. Set ES_URL and ES_API_KEY, then run docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio. You can use ES_USERNAME and ES_PASSWORD instead of an API key.

What does Elasticsearch MCP server do?

It connects an AI agent to Elasticsearch indices over MCP, so the agent can query and retrieve data from natural-language requests.

Which protocols does Elasticsearch MCP server support?

It supports stdio for direct client connections and streamable-HTTP for web integrations or concurrent clients. SSE is deprecated; the documentation recommends streamable-HTTP.

Similar MCP servers

All MCP servers for Data and databases →

Elasticsearch by other authors comes first.

Elasticsearch TocharianOU Connects an Elasticsearch cluster to an AI agent for data queries, field checks, and security event analysis. CX Codex +1 ★ 8repo stars elasticsearch-best-practices Mindrally elasticsearch-best-practices provides rules and code patterns for Elasticsearch index mappings, shard planning, and search query optimization directly to your agent. CX Codex +1 1,000installs elasticsearch-onboarding elastic elasticsearch-onboarding is a Claude Code skill that guides Elasticsearch search design, from data mapping to a working search flow. It activates for search tasks and questions about getting started with Elasticsearch. CX Codex +1 4,900installs elasticsearch-esql elastic Runs ES|QL queries against Elasticsearch from your code editor. Works across Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode; search logs, compute metrics, and explore data without leaving the IDE. CX Codex +1 5,300installs elasticsearch-expert personamanagmentlayer elasticsearch-expert is a Claude Code skill that helps design Elasticsearch mappings, build search queries and aggregations, and optimize ELK stacks. CX Codex +1 205installs elasticsearch-mcp-server cr7258 Connects an agent to Elasticsearch and OpenSearch tools for document search, index inspection, and cluster management. Useful when coding tasks depend on search data. CX Codex +1 ★ 320repo stars alibabacloud-elasticsearch-instance-diagnose aliyun alibabacloud-elasticsearch-instance-diagnose — a skill for analyzing Elasticsearch cluster health on Alibaba Cloud. Collects data from OpenAPI and REST API, identifies root causes of failures, and suggests remediation steps. CX Codex +1 127installs

Project sponsors

Companies that keep this analytics open