
How to add Elasticsearch/OpenSearch MCP Server to Cursor
Search, analyze, and manage Elasticsearch & OpenSearch clusters through MCP tools. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 290★ · stdio · apikey
Cursor config for Elasticsearch/OpenSearch MCP Server
uvx elasticsearch-mcp-server{
"mcpServers": {
"elasticsearch-opensearch-mcp-server": {
"command": "uvx",
"args": [
"elasticsearch-mcp-server"
],
"env": {
"ELASTICSEARCH_HOSTS": "https://localhost:9200",
"ELASTICSEARCH_USERNAME": "elastic",
"ELASTICSEARCH_PASSWORD": "test123"
}
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Elasticsearch/OpenSearch MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Elasticsearch/OpenSearch MCP Server's tools to confirm it's connected.
Before you start
- uv / uvx (or Docker) to run the server
- A reachable Elasticsearch or OpenSearch cluster (e.g. via the provided docker-compose files)
- Credentials: basic auth (username/password) or an Elasticsearch API key
What Elasticsearch/OpenSearch MCP Server can do in Cursor
general_api_requestPerform a general HTTP API request for any Elasticsearch/OpenSearch API that does not have a dedicated tool.
list_indicesList all indices.
get_indexReturn information (mappings, settings, aliases) about one or more indices.
create_indexCreate a new index.
delete_indexDelete an index.
create_data_streamCreate a new data stream (requires a matching index template).
get_data_streamGet information about one or more data streams.
delete_data_streamDelete one or more data streams and their backing indices.
Security
For HTTP transports (SSE/Streamable HTTP) set MCP_API_KEY to require a Bearer token; if unset, the server is accessible without authentication, which is a network security risk. The stdio transport uses local process communication and needs no auth. VERIFY_CERTS defaults to false. Use DISABLE_HIGH_RISK_OPERATIONS=true (or DISABLE_OPERATIONS) to hide write/delete tools for read-only deployments. Credentials (passwords / API keys) are passed via environment variables.
Elasticsearch/OpenSearch MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Elasticsearch/OpenSearch MCP Server config there under the "mcpServers" key and restart the client.
Is Elasticsearch/OpenSearch MCP Server safe to use with Cursor?
For HTTP transports (SSE/Streamable HTTP) set MCP_API_KEY to require a Bearer token; if unset, the server is accessible without authentication, which is a network security risk. The stdio transport uses local process communication and needs no auth. VERIFY_CERTS defaults to false. Use DISABLE_HIGH_RISK_OPERATIONS=true (or DISABLE_OPERATIONS) to hide write/delete tools for read-only deployments. Credentials (passwords / API keys) are passed via environment variables.
Which Elasticsearch/OpenSearch versions are supported?
Elasticsearch 7.x, 8.x, and 9.x via package variants (elasticsearch-mcp-server-es7, elasticsearch-mcp-server for 8.x, elasticsearch-mcp-server-es9), and OpenSearch 1.x/2.x/3.x via opensearch-mcp-server.
What transports are supported?
stdio (default), SSE, and Streamable HTTP. Use the --transport flag (sse or streamable-http) with optional --host, --port, and --path.
How do I make a deployment read-only?
Set DISABLE_HIGH_RISK_OPERATIONS=true to completely hide all write/delete tools from the client, or set DISABLE_OPERATIONS to a comma-separated list of specific operations to disable.