This MCP server implementation facilitates interaction with Elasticsearch and OpenSearch, allowing users to search documents, analyze indices, and manage clusters through various tools.
From the registry: MCP server for interacting with Elasticsearch

$ pip install uvhttps://docs.astral.sh/uv/$ docker-compose -f docker-compose-elasticsearch.yml up -dPlease install the `elasticsearch-mcp-server` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install uv/uvx** — Requires uv (uvx) Python package runner to install and run elasticsearch-mcp-server from PyPI. Run: `pip install uv` (https://docs.astral.sh/uv/)
- **Elasticsearch or OpenSearch cluster** — A running Elasticsearch (7.x/8.x/9.x) or OpenSearch cluster. You can start one locally with the provided docker-compose files. Run: `docker-compose -f docker-compose-elasticsearch.yml up -d`
Canonical MCP server config (stdio transport):
- command: `uvx`
- args: ["elasticsearch-mcp-server"]
- required environment variables:
- `ELASTICSEARCH_HOSTS`: Comma-separated list of Elasticsearch hosts. (example: `<your-elasticsearch-url>`)
- optional environment variables:
- `ELASTICSEARCH_USERNAME`: Username for Elasticsearch basic auth. Required if not using API key. (example: `<your-elasticsearch-username>`)
- `ELASTICSEARCH_PASSWORD`: Password for Elasticsearch basic auth. Required if not using API key. (example: `<your-elasticsearch-password>`)
- `ELASTICSEARCH_API_KEY`: API key for Elasticsearch authentication (recommended alternative to username/password). (example: `<your-elasticsearch-api-key>`)
- `OPENSEARCH_HOSTS`: Comma-separated list of OpenSearch hosts (when using opensearch-mcp-server variant). (example: `<your-opensearch-url>`)
- `OPENSEARCH_USERNAME`: Username for OpenSearch basic auth. (example: `<your-opensearch-username>`)
- `OPENSEARCH_PASSWORD`: Password for OpenSearch basic auth. (example: `<your-opensearch-password>`)
- `VERIFY_CERTS`: Whether to verify SSL certificates. (example: `false`)
- `REQUEST_TIMEOUT`: Request timeout in seconds. (example: `30`)
- `MCP_API_KEY`: Bearer token for MCP server auth (HTTP transports only). (example: `<your-mcp-api-key>`)
- `DISABLE_HIGH_RISK_OPERATIONS`: Set to true to disable all write operations. (example: `false`)
- `DISABLE_OPERATIONS`: Comma-separated list of specific operations to disable. (example: `delete_index,delete_document`)
Note: Use elasticsearch-mcp-server-es7 or elasticsearch-mcp-server-es9 for Elasticsearch 7.x/9.x. Use opensearch-mcp-server for OpenSearch. Also supports SSE and streamable-http transports via --transport flag.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.ELASTICSEARCH_API_KEYrequiredAPI key for Elasticsearch authentication.ELASTICSEARCH_USERNAMErequiredUsername for basic authentication.ELASTICSEARCH_PASSWORDrequiredPassword for basic authentication.OPENSEARCH_USERNAMErequiredUsername for OpenSearch basic authentication.OPENSEARCH_PASSWORDrequiredPassword for OpenSearch basic authentication.MCP_API_KEYrequiredAPI key for MCP server authentication.Minimal, token-efficient Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB