esmole
概览
作者提供的说明(英文原文)
Elasticsearch 7.x/8.x with connections managed at runtime by the agent, SSH tunnels, readonly.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新↓ 58/周 · ★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 数据库与数据集
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"esmole": {
"command": "npx",
"args": [
"-y",
"esmole-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add esmole -- npx -y esmole-mcp或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"esmole": {
"command": "npx",
"args": [
"-y",
"esmole-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"esmole": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"esmole-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 ed-smartass 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“数据库与数据集”中的其他服务器比较i
- 星标数多于此分类中其他 1147 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 1147 个服务器的 73% 更新
- 基础检查结果等于或优于此分类中其他 1147 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
esmole 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(0.2.0)于14天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
esmole-mcp
Elasticsearch 7.x and 8.x for AI agents that manage their own connections: add, edit and remove clusters through MCP tools at runtime, per project, hot-reloaded, through SSH.
esmole-mcp is a stdio MCP server for Elasticsearch. Tell your agent "connect to the logs cluster through bastion.example.com, readonly" and it calls add_connection. The connection lands in a per-project .esmole.json or in your global store, and both are re-read on every tool call, so a change made by the agent, by you in an editor, or by another session applies on the next call. No client config edits, no restarts.
- Elasticsearch 7.x and 8.x, any number of named clusters, API key or basic auth.
- SSH tunnels with password, key or agent auth; host keys verified against
known_hostsor a pinned fingerprint. readonlyconnections limited to an allowlist of read endpoints, absolute request timeouts, a 10 MB response cap, and results capped at 40 KB so a big aggregation cannot flood the context.
Need PostgreSQL or MySQL? dbmole-mcp is the same design for SQL databases.
Demo
Install
Requires Node.js 22 or newer. The server needs no configuration to start; connections are added later.
Claude Code
claude mcp add esmole -- npx -y esmole-mcp
Add --scope user to enable it in every project. Or install it as a plugin (Claude Code 2.1.275 or later):
/plugin install esmole --marketplace ed-smartass/esmole-mcp
Codex
codex mcp add esmole -- npx -y esmole-mcp
or in ~/.codex/config.toml:
[mcp_servers.esmole]
command = "npx" args = ["-y", "esmole-mcp"]
Cursor
VS Code
Claude Desktop
Download esmole-mcp- .mcpb from the latest release and open it, or add the JSON below to claude_desktop_config.json. Claude Desktop does not start servers inside a project, so keep connections in the global store (the default scope).
Any other MCP client
{
"mcpServers": { "esmole": { "command": "npx", "args": ["-y", "esmole-mcp"] } } }
Docker
The image is built from source:
git clone https://github.com/ed-smartass/esmole-mcp.git && cd esmole-mcp
docker build -t esmole-mcp .
{
"mcpServers": { "esmole": { "command": "docker", "args": [ "run", "-i", "--rm", "-v", "esmole-store:/home/node/.config/esmole", "-v", "/abs/path/to/project:/work", "-v", "/home/me/.ssh/known_hosts:/home/node/.ssh/known_hosts:ro", "esmole-mcp" ] } } }
The container runs as node with cwd /work: mount a project there to use its .esmole.json, and the named volume keeps the global store. Mount known_hosts for SSH connections (or pin ssh.hostKey), and any private key you reference by privateKeyPath, at the path the connection names; for ssh.agent: true, forward the agent socket (-v "$SSH_AUTH_SOCK:/ssh-agent" -e SSH_AUTH_SOCK=/ssh-agent). To reach hosts that only your machine can reach, add --add-host=host.docker.internal:host-gateway (Linux) and use host.docker.internal. The image has no git, so the "not ignored by git" check always warns.
A 0.1 setup that still sets ESMOLE_CONNECTIONS, ESMOLE_CONFIG or --config starts fine: the server prints one line on stderr saying they are ignored. See the changelog.
Quick start
Ask the agent, for example:
Add a readonly elasticsearch connection
logsto this project: https on 10.0.0.20, API key
VnVhQ2ZH…, through ssh as deploy@bastion.example.com with my ssh agent. Then show the five
biggest indices.
It calls add_connection with:
{
"name": "logs", "host": "10.0.0.20", "apiKey": "VnVhQ2ZH…", "readonly": true, "ssh": { "host": "bastion.example.com", "user": "deploy", "agent": true }, "scope": "project" }
then test_connection and es_list_indices. Credentials you type in chat pass through the model's context; for production secrets, write the entry into the file yourself.
Connections
Two layers
| Layer | File | Shape |
|---|---|---|
project | .esmole.json, found from the server's working directory | { "connections": [ ... ] } |
global | ~/.config/esmole/connections.json, or the path in ESMOLE_STORE | [ ... ] |
- Same name in both: the project entry wins.
list_connectionsreports each connection'ssource(projectorglobal) and, when it hides an entry of the same name in the other layer,shadows. - Hot reload. Both files are re-read on every tool call. Edit a file mid-session and the next call uses the new settings; a changed connection gets a fresh client, the old one is closed.
- Project file discovery. Starting from the server's working directory (Claude Code and Codex start it in the project directory), esmole walks up to the filesystem root and uses the first
.esmole.jsonit finds. In a linked git worktree with no file of its own, it falls back to the main checkout's.esmole.json, so every worktree of a repo shares one file. - Both files are plain JSON with mode
0600, written atomically. Writes keep entries they cannot parse verbatim, and refuse to overwrite a file that is not valid JSON.
Managing connections with tools
add_connectiontakes the connection fields plusscope:"global"(default) or"project". Withprojectand no file yet, the file is created at the main checkout root (or the git root, or the working directory outside git). If git does not ignore it, the response warns you; add.esmole.jsonto.gitignoreso credentials are not committed.add_connectionfails when the name already exists in the target layer. The same name in the other layer is allowed; the response says which entry now shadows which.update_connectionpatches the connection where it lives (the winning layer). Anullvalue removes an optional field. Ansshobject is merged into the stored one field by field, so{ "ssh": { "hostKey": "SHA256:..." } }keeps the stored SSH secrets.remove_connectiondeletes it from that layer and tells you if that uncovers a same-name entry in the other layer.- Credentials are never echoed back:
list_connectionsshows scheme, host, port, the auth kind,verifyTls,readonly,sourceand whether SSH is used.
Broken and invalid entries
- An entry that fails validation does not silently disappear: its name resolves to an error (
connection 'x' in is invalid: ...) instead of falling through to a same-name entry in the global store, andlist_connectionslists it as invalid. A name defined twice in one file is an error too.remove_connectioncan delete an invalid entry. - A file that exists but is unreadable, not JSON, or the wrong shape is reported in
list_connections(brokenLayers). A broken project file blocks every connection; a broken global store blocks only names the project file does not define. A missing file is just empty.
Connection fields
Unknown fields are rejected. Authentication is required: an apiKey, or both user and password.
| Field | Type | Notes | |
|---|---|---|---|
name | string | [a-zA-Z0-9_-]+ | |
type | elasticsearch | default elasticsearch | |
host | string | as seen from the SSH bastion when ssh is set | |
port | number | default 9200 | |
scheme | http \ | https | default https |
verifyTls | boolean | default true; false skips certificate verification | |
apiKey | string | API key (the base64 id:key form) | |
user, password | string | basic auth | |
readonly | boolean | default false, see Readonly | |
queryTimeoutMs | integer | milliseconds, default 60000, at most 2147483647; see Limits and timeouts | |
ssh | object | see SSH tunnels |
Example .esmole.json:
{
"connections": [ { "name": "local", "host": "localhost", "scheme": "http", "user": "elastic", "password": "changeme" }, { "name": "logs", "host": "10.0.0.20", "apiKey": "VnVhQ2ZHY0JDZGJrUW0t...", "readonly": true, "ssh": { "host": "bastion.example.com", "user": "deploy", "agent": true } } ] }
SSH tunnels
ssh field | Notes |
|---|---|
host, port | bastion; port defaults to 22 |
user | SSH user |
password | password auth |
privateKey / privateKeyPath | key contents, or a path (~ is expanded) |
passphrase | for an encrypted key |
agent | true to use the agent at SSH_AUTH_SOCK |
hostKey | pinned host key fingerprint, SHA256:... (OpenSSH format) |
{ "host": "bastion.example.com", "user": "deploy", "privateKeyPath": "~/.ssh/id_ed25519" }
{ "host": "bastion.example.com", "user": "deploy", "password": "…" } { "host": "bastion.example.com", "port": 2222, "user": "deploy", "agent": true } { "host": "bastion.example.com", "user": "deploy", "agent": true, "hostKey": "SHA256:EXAMPLEexampleEXAMPLEexampleEXAMPLEexample1" }
Host keys are verified. With hostKey set, the bastion's key must match it (trailing = padding is accepted) and known_hosts is not consulted. Otherwise the key must match an entry for the host in ~/.ssh/known_hosts (host on port 22, [host]:port otherwise):
- Plain and hashed host names match. Wildcard patterns never match, and a line with a negated wildcard (
!*.example.com) is ignored. - A key listed under
@revokedis rejected for every host, whatever the line's host pattern.@cert-authoritylines and unknown markers are skipped.
There is no trust-on-first-use: an unknown key fails the connection with an error that shows the presented fingerprint. Check it against a trusted source, then either add the host to known_hosts or pin it:
ssh-keyscan -p 22 bastion.example.com 2>/dev/null | ssh-keygen -lf -
256 SHA256:EXAMPLEexampleEXAMPLEexampleEXAMPLEexample1 bastion.example.com (ED25519)
and ask the agent to
只显示了开头部分;其余内容请在仓库中阅读