Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyData and databases

Elasticsearch MCP Server

Lets your AI agent search, analyze and manage Elasticsearch and OpenSearch indices, documents and cluster health.

315 stars on GitHubby cr7258License Apache-2.0Updated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add elasticsearch -- uvx elasticsearch-mcp-server

What to fill in

NameWhat it isRequired
ELASTICSEARCH_HOSTSComma-separated list of Elasticsearch hosts (e.g., https://localhost:9200)No
ELASTICSEARCH_API_KEYAPI key for Elasticsearch or Elastic Cloud authentication (recommended)No
ELASTICSEARCH_USERNAMEUsername for basic authentication (alternative to API key)No
ELASTICSEARCH_PASSWORDPassword for basic authentication (used with ELASTICSEARCH_USERNAME)No
ELASTICSEARCH_VERIFY_CERTSWhether to verify SSL certificates (true/false)No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

List all indices and tell me which are largest.
Search the logs-* index for errors in the last hour.

What it is

This server connects your agent to an Elasticsearch or OpenSearch cluster. It can search documents, list and manage indices, aliases and data streams, check cluster health and analyze how text is tokenized. You can switch off all write operations for safety.

What it can do

  • search_documents: search for documents
  • list_indices and get_index: see indices, mappings and settings
  • index_document, get_document and delete_document: work with documents
  • get_cluster_health and get_cluster_stats: cluster status
  • list_aliases and put_alias: manage aliases
  • analyze_text: see how text is tokenized
  • general_api_request: call any other API

When to use

  • β€ΊWhen you want to explore what is in your search index in plain language
  • β€ΊWhen you need to check cluster health
  • β€ΊWhen you want to debug why a query does not match

What you need

An Elasticsearch or OpenSearch cluster, plus uvx (or uv). Set hosts and either username and password or an Elasticsearch API key in environment variables.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Does it work with OpenSearch?

Yes. It supports both Elasticsearch and OpenSearch.

How do I sign in?

Use username and password, or an API key for Elasticsearch, which the readme recommends.

Can I stop it from writing?

Yes. Set DISABLE_HIGH_RISK_OPERATIONS to true to hide all write tools, or list specific ones in DISABLE_OPERATIONS.

Can it use more than one cluster?

Yes. Set ELASTICSEARCH_CLUSTERS or a clusters file, and tools take an optional cluster parameter.

Should I protect the HTTP mode?

Yes. Set MCP_API_KEY for sse or streamable-http, or the server is open without authentication.

Is there a test cluster?

The readme includes docker-compose files to start Elasticsearch or OpenSearch with Kibana or Dashboards.

If it does not work

  • β€ΊCheck the hosts value and credentials; the default host is https://localhost:9200.
  • β€ΊIf you hit certificate errors, check VERIFY_CERTS, which defaults to false.
  • β€ΊCheck that uvx is installed.

5 new skills a week. 1 minute to read.