home / mcp / elasticsearch mcp server

Elasticsearch MCP Server

This read-only MCP Server allows you to connect to Elasticsearch data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out the first managed MCP platform: CData Connect AI (https://www.cdata.com/ai/).

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cdatasoftware-elasticsearch-mcp-server-by-cdata": {
      "command": "PATH\\TO\\java.exe",
      "args": [
        "-jar",
        "PATH\\TO\\CDataMCP-jar-with-dependencies.jar",
        "PATH\\TO/elasticsearch.prp"
      ]
    }
  }
}

You can run a local, read-only MCP server that exposes live Elasticsearch data to large language models. By wrapping the CData JDBC Driver for Elasticsearch, this server lets you ask natural-language questions and receive up-to-date results without writing SQL. This makes it easy to query Elasticsearch data from AI assistants while keeping data access simple and secure on your own machine.

How to use

Once the MCP server is up, you use an MCP-enabled client to query live Elasticsearch data. You don’t run SQL directly; instead you rely on natural-language prompts. The client will discover available tables, inspect their columns, and run read-only queries against Elasticsearch through the exposed MCP tools. Typical usage patterns include asking for data summaries, counts, or relationships such as the number of open tickets by project, or the correlation between opportunities and account industries.

How to install

Prerequisites you need on your machine: Java Runtime Environment (JRE 8 or newer) and a Java toolchain to run JARs. You should also have a working network connection to Elasticsearch and a licensed or trial CData JDBC Driver for Elasticsearch if you plan to configure the JDBC connection for local access.

Step 1: Clone the MCP server repository and navigate into it.

Step 2: Build the server to produce the runnable JAR.

Step 3: Install the CData JDBC Driver for Elasticsearch following the vendor’s installer instructions, and license it using the provided command.

Step 4: Create your JDBC connection properties file for Elasticsearch. Include the required properties such as Prefix, ServerName, ServerVersion, DriverPath, DriverClass, JdbcUrl, and Tables. This file is used to connect the MCP server to your Elasticsearch data.

Step 5: Run the MCP server locally using the Java command and point it at your .prp file.

Step 6: Start your MCP client (for example, Claude Desktop) and ensure it can discover and communicate with the local MCP server. If the client doesn’t immediately show the server, fully quit and re-open the client so it re-scans available MCP servers.

Run the MCP server locally (examples)

java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/elasticsearch.prp

Run the MCP server on Windows (alternate form)

java -jar PATH\TO\CDataMCP-jar-with-dependencies.jar PATH\TO\elasticsearch.prp

Notes on running and configuration

The server operates in stdio mode, meaning it runs as a local process on the same machine as your MCP client. The MCP server uses the JDBC driver to connect to Elasticsearch and exposes read-only access through the MCP interface. If you need to adjust which Elasticsearch data is exposed, edit the .prp file to specify the Tables property or leave it blank to expose all data.

Available tools

elasticsearch_get_tables

Retrieves a list of tables (data sources) available in Elasticsearch through the MCP server. The output is returned in CSV format with a header row defining column names.

elasticsearch_get_columns

Retrieves a list of columns for a selected table. The output is returned in CSV format with the first line containing column headers.

elasticsearch_run_query

Executes a SQL SELECT query against the exposed Elasticsearch data through the MCP server.