npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flinkhouse/mcp-server-elasticsearch

v0.1.1

Published

Elasticsearch MCP Server

Downloads

34

Readme

Elasticsearch MCP Server

Connect to your Elasticsearch data directly from any MCP Client (like Claude Desktop) using the Model Context Protocol (MCP).

This server connects agents to your Elasticsearch data using the Model Context Protocol (MCP). It allows you to interact with your Elasticsearch indices through natural language conversations.

Features

  • List Indices: View all available Elasticsearch indices
  • Get Mappings: Inspect field mappings for specific indices
  • Search: Execute Elasticsearch queries using full Query DSL capabilities with automatic highlighting

Prerequisites

  • Node.js (v22+)
  • An Elasticsearch instance
  • Elasticsearch API key with appropriate permissions
  • Claude Desktop App (free version is sufficient)

Installation & Setup

Using the Published NPM Package

The easiest way to use Elasticsearch MCP Server is through the published npm package:

  1. Configure Claude Desktop App
    • Open Claude Desktop App
    • Go to Settings > Developer > MCP Servers
    • Click Edit Config and add a new MCP Server with the following configuration to your claude_desktop_config.json:
{
  "mcpServers": {
    "elasticsearch-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@elastic/mcp-server-elasticsearch"
      ],
      "env": {
        "ES_URL": "your-elasticsearch-url",
        "ES_API_KEY": "your-api-key"
      }
    }
  }
}
  1. Start a Conversation
    • Open a new conversation in Claude Desktop App
    • The MCP server should connect automatically
    • You can now ask Claude questions about your Elasticsearch data

Developing Locally

If you want to develop or modify the server locally:

  1. Use the correct Node.js version
nvm use
  1. Install Dependencies
npm install
  1. Build the Project
npm run build
  1. Configure Claude Desktop for local development
    • Open Claude Desktop App
    • Go to Settings > Developer > MCP Servers
    • Click Edit Config and add a new MCP Server with the following configuration:
{
  "mcpServers": {
    "Elasticsearch MCP Server (Local)": {
      "command": "node",
      "args": [
        "/path/to/your/project/dist/index.js"
      ],
      "env": {
        "ES_URL": "your-elasticsearch-url",
        "ES_API_KEY": "your-api-key"
      }
    }
  }
}
  1. Debugging
npm run inspector

Example Questions

  • "What indices do I have in my Elasticsearch cluster?"
  • "Show me the field mappings for the 'products' index"
  • "Find all orders over $500 from last month"
  • "Which products received the most 5-star reviews?"

How It Works

When you ask Claude a question about your data:

  1. Claude analyzes your request and determines which Elasticsearch operations are needed
  2. The MCP server carries out these operations (listing indices, fetching mappings, performing searches)
  3. Claude processes the results and presents them in a user-friendly format

Security Best Practices

You can create a dedicated Elasticsearch API key with minimal permissions to control access to your data:

POST /_security/api_key
{
  "name": "es-mcp-server-access",
  "role_descriptors": {
    "claude_role": {
      "cluster": [
        "monitor"
      ],
      "indices": [
        {
          "names": [
            "index-1",
            "index-2",
            "index-pattern-*"
          ],
          "privileges": [
            "read",
            "view_index_metadata"
          ]
        }
      ]
    }
  }
}

Troubleshooting

  • If the server isn't connecting, check that your MCP configuration is correct
  • Ensure your Elasticsearch URL is accessible from your machine
  • Verify that your API key has the necessary permissions
  • Check the terminal output for any error messages