# esmole

> esmole is an open-source MCP server for databases. Read-only Elasticsearch 7 and 8 access where the agent manages connections at runtime. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/ed-smartass/esmole-mcp
- **MCP Registry name:** io.github.ed-smartass/esmole-mcp
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-16

## About

esmole-mcp lets an agent add, edit and remove Elasticsearch clusters through tools during a session instead of editing client config. A request like connect to the logs cluster through a bastion, readonly, calls add_connection, and the entry is saved to a per-project .esmole.json or a global store that is re-read on every call, so no restart is needed.

It supports Elasticsearch 7.x and 8.x with API key or basic auth, any number of named clusters, and SSH tunnels using password, key or agent auth with host keys checked against known_hosts or a pinned fingerprint. Readonly connections allow only a list of read endpoints, with absolute timeouts, a 10 MB response cap and a 40 KB result cap so a large aggregation does not flood context.

Credentials are never echoed back and invalid entries are reported instead of silently skipped. It needs Node 22 or newer.

## Features

- **Runtime connections:** Add and remove clusters from the agent.
- **SSH tunnels:** Password, key or agent auth with host key checks.
- **Readonly mode:** Allowlist of read endpoints only.
- **Response caps:** 10 MB responses, 40 KB results.
- **Per-project config:** Project file or global store, hot-reloaded.
- **Hidden credentials:** Secrets are not echoed.

## Good for

- Query logs on a cluster behind a bastion host
- Explore index sizes without leaving the chat
- Switch between several clusters per project
- Avoid accidental writes with readonly mode

## Install

### Claude Code (Terminal)

```sh
claude mcp add esmole-mcp -- npx -y esmole-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "esmole-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "esmole-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "esmole-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "esmole-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "esmole-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "esmole-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "esmole-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "esmole-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "esmole-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "esmole-mcp"
      ]
    }
  }
}
```

## FAQ

### What versions are supported?

Elasticsearch 7.x and 8.x.

### Do I edit client config?

No, connections are managed by tools and reload on each call.

### What Node version?

22 or newer.

### Is there a SQL variant?

The README points to dbmole-mcp for PostgreSQL and MySQL.

### Is esmole free?

Yes. esmole is open source, so you can use and self-host it for free.

### How do I add esmole to Claude Code?

Run this command in your terminal: claude mcp add esmole-mcp -- npx -y esmole-mcp

### What are the best alternatives to esmole?

The closest alternatives to esmole are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/esmole
