# elasticsearch-mcp-server

> MCP Server

This repository provides an Elasticsearch Model Context Protocol (MCP) server implementation, enabling document searching, index analysis, and cluster management through a set of tools. It offers functionalities like listing indices

## Overview

- **Category:** Search & Knowledge
- **Language:** Python
- **Stars:** 303
- **Forks:** 8
- **Owner:** cr7258
- **GitHub:** https://github.com/cr7258/elasticsearch-mcp-server
- **Created:** 2025-01-09T04:20:03+00:00
- **Updated:** 2025-03-28T13:46:00+00:00
- **Source:** https://model-context-protocol.com/servers/elasticsearch-mcp-server-model-context-protocol

## Setup

## Setup

1.  Start the Elasticsearch cluster using Docker Compose: `docker-compose up -d` (This starts a 3-node Elasticsearch cluster and Kibana, accessible at http://localhost:5601 with default username `elastic` and password `test123`).
2.  **Option 1: Installing via Smithery:** `npx -y @smithery/cli install elasticsearch-mcp-server --client claude`
3.  **Option 2: Using uvx:** Add the provided configuration to Claude Desktop's config file `claude_desktop_config.json` with `command: uvx`, `args: ["elasticsearch-mcp-server"]`, and environment variables for Elasticsearch connection.
4.  **Option 3: Using uv with local development:** Clone the repository locally, then add the provided configuration to Claude Desktop's config file `claude_desktop_config.json` with `command: uv`, `args` pointing to the local source code, and environment variables for Elasticsearch connection.
5.  Restart Claude Desktop to load the new MCP server.

## Tools

## Available Tools

1.  `list_indices` (List all indices in the Elasticsearch cluster.)
2.  `get_mapping` (Retrieve the mapping configuration for a specific index.)
3.  `get_settings` (Get the settings configuration for a specific index.)
4.  `search_documents` (Search documents in an index using Elasticsearch Query DSL.)
5.  `get_cluster_health` (Get health status of the cluster.)
6.  `get_cluster_stats` (Get statistical information about the cluster.)
