Easysearch MCP Server
Provides 121 tools for managing Elasticsearch clusters, including operations for indices, documents, search queries, aggregations, snapshots, templates, aliases, and cluster administration.
Provides 121 tools for managing OpenSearch clusters, including operations for indices, documents, search queries, aggregations, snapshots, templates, aliases, and cluster administration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Easysearch MCP Server search for products with price over 100"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Easysearch MCP Server
让 AI Agent 能够操作 INFINI Easysearch(兼容 Elasticsearch/OpenSearch API)的 MCP 服务器。
特性
🔧 121 个工具 - 覆盖集群、索引、文档、搜索、监控等全部功能
🔌 即插即用 - 支持 Kiro、Claude Desktop 等 MCP 客户端
🔒 安全连接 - 支持 HTTPS 和基础认证
⚡ 高性能 - 基于 httpx 异步 HTTP 客户端
Related MCP server: OpenSearch MCP Server
安装
# 克隆仓库
git clone https://github.com/cloudsmithy/easysearch-mcp-server.git
cd easysearch-mcp-server
# 安装依赖
pip install -e .快速开始
1. 配置 MCP 客户端
Kiro (.kiro/settings/mcp.json):
{
"mcpServers": {
"easysearch": {
"command": "python3",
"args": ["-m", "easysearch_mcp.server"],
"cwd": "/path/to/easysearch-mcp-server/src",
"env": {
"EASYSEARCH_URL": "https://localhost:9200",
"EASYSEARCH_USER": "admin",
"EASYSEARCH_PASSWORD": "your-password",
"PYTHONPATH": "/path/to/easysearch-mcp-server/src"
}
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"easysearch": {
"command": "python3",
"args": ["-m", "easysearch_mcp.server"],
"cwd": "/path/to/easysearch-mcp-server/src",
"env": {
"EASYSEARCH_URL": "https://localhost:9200",
"EASYSEARCH_USER": "admin",
"EASYSEARCH_PASSWORD": "your-password",
"PYTHONPATH": "/path/to/easysearch-mcp-server/src"
}
}
}
}注意:将
/path/to/easysearch-mcp-server替换为实际的项目路径
2. 开始使用
配置完成后,AI Agent 就可以直接操作 Easysearch 了:
"查看集群健康状态"
"创建一个 products 索引"
"搜索价格大于 100 的商品"
"统计每个分类的订单数量"
工具列表
集群管理 (8)
工具 | 说明 |
| 集群健康状态 |
| 集群统计信息 |
| 集群状态详情 |
| 获取集群设置 |
| 更新集群设置 |
| 待处理任务 |
| 分片分配解释 |
| 手动路由分片 |
索引管理 (25)
工具 | 说明 |
| 创建索引 |
| 删除索引 |
| 检查索引是否存在 |
| 获取索引详情 |
| 获取映射 |
| 更新映射 |
| 获取设置 |
| 更新设置 |
| 打开索引 |
| 关闭索引 |
| 刷新索引 |
| 刷盘 |
| 强制合并段 |
| 清除缓存 |
| 索引统计 |
| 段信息 |
| 恢复状态 |
| 分片存储信息 |
| 设置只读(clone/split/shrink 前置条件) |
| 准备收缩(shrink 前置条件) |
| 创建带可写别名的索引(rollover 前置条件) |
| 克隆索引 |
| 拆分索引 |
| 收缩索引 |
| 滚动索引 |
别名管理 (4)
工具 | 说明 |
| 获取别名 |
| 创建别名 |
| 删除别名 |
| 批量别名操作 |
模板管理 (3)
工具 | 说明 |
| 获取模板 |
| 创建模板 |
| 删除模板 |
文档操作 (11)
工具 | 说明 |
| 写入文档 |
| 获取文档 |
| 检查文档是否存在 |
| 删除文档 |
| 更新文档 |
| 批量操作 |
| 简化批量写入 |
| 批量获取 |
| 获取文档源 |
| 按查询删除 |
| 按查询更新 |
搜索功能 (15)
工具 | 说明 |
| DSL 搜索 |
| 简单关键词搜索 |
| 模板搜索 |
| 多重搜索 |
| 文档计数 |
| 验证查询 |
| 解释评分 |
| 聚合查询 |
| 简化聚合 |
| 开始滚动搜索 |
| 获取下一批 |
| 清除滚动上下文 |
| 字段能力 |
| 向量搜索 |
| SQL 查询 |
CAT API (19)
工具 | 说明 |
| 集群健康 |
| 节点列表 |
| 索引列表 |
| 分片分布 |
| 磁盘分配 |
| 线程池状态 |
| 主节点信息 |
| 段信息 |
| 文档计数 |
| 恢复状态 |
| 待处理任务 |
| 别名列表 |
| 模板列表 |
| 插件列表 |
| Fielddata 使用 |
| 节点属性 |
| 快照仓库 |
| 快照列表 |
| 任务列表 |
节点管理 (5)
工具 | 说明 |
| 节点信息 |
| 节点统计 |
| 热点线程 |
| 功能使用统计 |
| 重载安全设置 |
快照管理 (10)
工具 | 说明 |
| 创建仓库 |
| 获取仓库 |
| 删除仓库 |
| 验证仓库 |
| 创建快照 |
| 获取快照 |
| 快照状态 |
| 删除快照 |
| 恢复快照 |
| 克隆快照 |
快照生命周期管理 SLM (6)
工具 | 说明 |
| 创建策略 |
| 获取策略 |
| 删除策略 |
| 解释策略 |
| 启动策略 |
| 停止策略 |
任务管理 (3)
工具 | 说明 |
| 任务列表 |
| 任务详情 |
| 取消任务 |
Ingest Pipeline (6)
工具 | 说明 |
| 获取 Pipeline |
| 创建 Pipeline |
| 删除 Pipeline |
| 模拟 Pipeline |
| Ingest 统计 |
| Grok 模式列表 |
ILM 索引生命周期管理 (5)
工具 | 说明 |
| 获取 ILM 策略 |
| 创建 ILM 策略 |
| 删除 ILM 策略 |
| 给索引绑定 ILM 策略 |
| 从索引移除 ILM 策略 |
其他 (1)
工具 | 说明 |
| 重建索引 |
使用示例
集群监控
查看集群健康状态
→ cluster_health()
查看所有节点
→ cat_nodes()
查看线程池状态
→ cat_thread_pool()
按大小排序查看索引
→ cat_indices(sort_by="store.size", order="desc")索引操作
创建索引
→ index_create("products",
mappings={"properties": {"name": {"type": "text"}, "price": {"type": "float"}}},
settings={"number_of_shards": 3})
写入文档
→ doc_index("products", {"name": "iPhone", "price": 999})
批量写入
→ doc_bulk_simple("products", [
{"name": "iPad", "price": 799},
{"name": "MacBook", "price": 1299}
])搜索查询
简单搜索
→ search_simple("products", "iPhone")
DSL 搜索
→ search("products", query={
"bool": {
"must": [{"match": {"name": "phone"}}],
"filter": [{"range": {"price": {"lte": 1000}}}]
}
})
聚合统计
→ aggregate("orders", aggs={
"by_status": {"terms": {"field": "status"}},
"avg_amount": {"avg": {"field": "amount"}}
})
SQL 查询
→ sql_query("SELECT * FROM products WHERE price > 500 ORDER BY price DESC")索引克隆/拆分/收缩
# 克隆索引(需要先设置只读)
→ index_set_readonly("my-index", True)
→ index_clone("my-index", "my-index-clone")
→ index_set_readonly("my-index", False)
# 收缩索引(需要准备)
→ index_prepare_for_shrink("my-index")
→ index_shrink("my-index", "my-index-shrunk", {"index.number_of_shards": 1})
# 滚动索引(需要可写别名)
→ index_create_with_write_alias("logs-000001", "logs")
→ index_rollover("logs", conditions={"max_docs": 1000000})环境变量
变量 | 说明 | 默认值 |
| Easysearch 地址 |
|
| 用户名 |
|
| 密码 | - |
开发
# 克隆仓库
git clone https://github.com/cloudsmithy/easysearch-mcp-server.git
cd easysearch-mcp-server
# 安装依赖
pip install -e .
# 运行测试
pytest
# 代码格式化
black src/
ruff check src/兼容性测试
所有 121 个工具已在 INFINI Easysearch 上完成测试验证:
分类 | 工具数 | 状态 |
集群管理 | 8 | ✅ 全部通过 |
索引管理 | 25 | ✅ 全部通过 |
别名管理 | 4 | ✅ 全部通过 |
模板管理 | 3 | ✅ 全部通过 |
文档操作 | 11 | ✅ 全部通过 |
搜索功能 | 15 | ✅ 全部通过 |
CAT API | 19 | ✅ 全部通过 |
节点管理 | 5 | ✅ 全部通过 |
快照管理 | 10 | ✅ 全部通过 |
SLM | 6 | ✅ 全部通过 |
任务管理 | 3 | ✅ 全部通过 |
Ingest Pipeline | 6 | ✅ 全部通过 |
ILM | 5 | ✅ 全部通过 |
其他 | 1 | ✅ 全部通过 |
注意:快照和 SLM 功能需要服务器配置 path.repo 才能创建仓库。
许可证
MIT License
Available Tools
121 toolsaggregateA
执行聚合查询
参数:
index: 索引名称
aggs: 聚合定义
query: 过滤条件(可选)
size: 返回文档数(默认 0,仅返回聚合结果)
示例 - 分组统计:
aggregate("orders", aggs={
"by_status": {"terms": {"field": "status"}}
})
示例 - 多级聚合:
aggregate("orders", aggs={
"by_category": {
"terms": {"field": "category"},
"aggs": {
"avg_price": {"avg": {"field": "price"}}
}
}
})
示例 - 日期直方图:
aggregate("logs", aggs={
"by_day": {
"date_histogram": {
"field": "@timestamp",
"calendar_interval": "day"
}
}
})
Inputs: index (required), aggs (required), query, size.
aggregate_simpleB
简化的聚合查询
参数:
index: 索引名称
field: 聚合字段
agg_type: 聚合类型 terms/avg/sum/min/max/cardinality/stats/extended_stats
size: 返回桶数量(仅 terms 有效)
示例:
aggregate_simple("orders", "status", "terms")
aggregate_simple("orders", "amount", "avg")
aggregate_simple("users", "email", "cardinality") # 去重计数
Inputs: index (required), field (required), agg_type, size.
alias_actionsC
批量操作别名
参数:
actions: 操作列表
示例 - 原子切换别名:
alias_actions([
{"remove": {"index": "logs-old", "alias": "logs"}},
{"add": {"index": "logs-new", "alias": "logs"}}
])
Inputs: actions (required).
alias_createC
创建别名
参数:
index: 索引名称
name: 别名名称
filter: 过滤条件
routing: 路由值
示例:
alias_create("logs-2024.01", "logs-current")
alias_create("users", "active-users", filter={"term": {"status": "active"}})
Inputs: index (required), name (required), filter, routing.
alias_deleteD
删除别名
参数:
index: 索引名称
name: 别名名称
Inputs: index (required), name (required).
alias_getD
获取别名
参数:
name: 别名名称(可选)
index: 索引名称(可选)
Inputs: name, index.
cat_aliasesC
获取别名列表
参数:
name: 别名名称(可选)
Inputs: name.
cat_allocationB
获取节点磁盘分配信息
参数:
node_id: 节点 ID(可选)
返回每个节点的分片数、磁盘使用情况
Inputs: node_id.
cat_countC
获取文档计数
参数:
index: 索引名称(可选)
Inputs: index.
cat_fielddataC
获取 fielddata 内存使用
参数:
fields: 字段名(可选,逗号分隔)
Inputs: fields.
cat_healthC
获取集群健康状态(简洁格式)
参数:
ts: 是否显示时间戳
Inputs: ts.
cat_indicesB
获取索引列表
参数:
index: 索引名称/模式(可选)
health: 健康状态过滤 green/yellow/red
pri: 仅显示主分片统计
sort_by: 排序字段 如 store.size/docs.count
order: 排序方向 asc/desc
返回索引名称、健康状态、文档数、存储大小等
Inputs: index, health, pri, sort_by, +1 more.
cat_masterB
获取当前主节点信息
Inputs: no named parameters.
cat_nodeattrsC
获取节点属性
Inputs: no named parameters.
cat_nodesC
获取节点信息
参数:
full_id: 是否显示完整节点 ID
返回节点名称、IP、角色、负载、内存使用等
Inputs: full_id.
cat_pending_tasksB
获取待处理的集群任务
Inputs: no named parameters.
cat_pluginsB
获取已安装的插件列表
Inputs: no named parameters.
cat_recoveryB
获取分片恢复状态
参数:
index: 索引名称(可选)
active_only: 仅显示进行中的恢复
Inputs: index, active_only.
cat_repositoriesC
获取快照仓库列表
Inputs: no named parameters.
cat_segmentsC
获取段信息
参数:
index: 索引名称(可选)
返回每个分片的段数量、大小、文档数等
Inputs: index.
cat_shardsC
获取分片分布信息
参数:
index: 索引名称(可选)
返回分片状态、大小、所在节点等
Inputs: index.
cat_snapshotsC
获取快照列表
参数:
repository: 仓库名称
Inputs: repository (required).
cat_tasksC
获取正在执行的任务
参数:
detailed: 是否显示详细信息
parent_task_id: 父任务 ID
Inputs: detailed, parent_task_id.
cat_templatesC
获取索引模板列表
参数:
name: 模板名称(可选)
Inputs: name.
cat_thread_poolB
获取线程池状态
参数:
thread_pool: 线程池名称(可选)如 search/write/get
返回各线程池的活跃线程数、队列大小、拒绝数
Inputs: thread_pool.
cluster_allocation_explainB
解释分片分配决策
参数:
index: 索引名称(可选,不传则解释第一个未分配分片)
shard: 分片编号
primary: 是否主分片
用于诊断分片为什么未分配或分配到特定节点
Inputs: index, shard, primary.
cluster_healthC
获取集群健康状态
参数:
index: 指定索引(可选)
level: 详细级别 cluster/indices/shards(可选)
返回集群名称、状态(green/yellow/red)、节点数、分片数等
Inputs: index, level.
cluster_pending_tasksB
获取集群待处理任务列表
Inputs: no named parameters.
cluster_rerouteB
手动重新路由分片
参数:
commands: 路由命令列表
dry_run: 是否仅模拟执行
示例 - 移动分片:
cluster_reroute(commands=[{
"move": {
"index": "test", "shard": 0,
"from_node": "node1", "to_node": "node2"
}
}])
示例 - 取消分片:
cluster_reroute(commands=[{
"cancel": {"index": "test", "shard": 0, "node": "node1"}
}])
Inputs: commands, dry_run.
cluster_settingsC
获取集群设置
参数:
include_defaults: 是否包含默认设置
flat_settings: 是否扁平化显示
Inputs: include_defaults, flat_settings.
cluster_stateC
获取集群状态
参数:
metric: 指标类型 version/master_node/nodes/routing_table/metadata/blocks(可选)
index: 指定索引(可选)
返回集群完整状态信息
Inputs: metric, index.
cluster_statsC
获取集群统计信息
参数:
node_id: 指定节点 ID(可选)
返回文档数、存储大小、索引数量、节点信息等
Inputs: node_id.
cluster_update_settingsC
更新集群设置
参数:
persistent: 持久化设置(重启后保留)
transient: 临时设置(重启后丢失)
示例:
cluster_update_settings(
persistent={"cluster.routing.allocation.enable": "all"}
)
Inputs: persistent, transient.
countC
统计文档数量
参数:
index: 索引名称
query: 查询条件(可选)
示例:
count("products")
count("products", query={"term": {"status": "active"}})
Inputs: index (required), query.
doc_bulkC
批量操作文档
参数:
operations: 操作列表,每个操作是 {"action": {...}, "doc": {...}} 格式
refresh: 刷新策略
示例:
doc_bulk([
{"index": {"_index": "products", "_id": "1"}, "doc": {"name": "A"}},
{"index": {"_index": "products", "_id": "2"}, "doc": {"name": "B"}},
{"delete": {"_index": "products", "_id": "3"}}
])
Inputs: operations (required), refresh.
doc_bulk_simpleB
简化的批量写入(仅支持 index 操作)
参数:
index: 索引名称
documents: 文档列表
refresh: 刷新策略
示例:
doc_bulk_simple("products", [
{"name": "A", "price": 100},
{"name": "B", "price": 200}
])
Inputs: index (required), documents (required), refresh.
doc_deleteC
删除文档
参数:
index: 索引名称
id: 文档 ID
refresh: 刷新策略
routing: 路由值
Inputs: index (required), id (required), refresh, routing.
doc_delete_by_queryC
按查询删除文档
参数:
index: 索引名称
query: 查询条件
refresh: 是否刷新
conflicts: 冲突处理 abort/proceed
示例:
doc_delete_by_query("logs", {"range": {"@timestamp": {"lt": "2024-01-01"}}})
Inputs: index (required), query (required), refresh, conflicts.
doc_existsC
检查文档是否存在
参数:
index: 索引名称
id: 文档 ID
routing: 路由值
Inputs: index (required), id (required), routing. Returns: result
doc_getC
获取文档
参数:
index: 索引名称
id: 文档 ID
source: 返回的字段列表
source_excludes: 排除的字段列表
routing: 路由值
Inputs: index (required), id (required), source, source_excludes, +1 more.
doc_indexB
写入文档
参数:
index: 索引名称
document: 文档内容
id: 文档 ID(可选,不传则自动生成)
refresh: 刷新策略 true/false/wait_for
routing: 路由值
示例:
doc_index("products", {"name": "iPhone", "price": 999})
doc_index("products", {"name": "iPad", "price": 799}, id="ipad-001")
Inputs: index (required), document (required), id, refresh, +1 more.
doc_mgetB
批量获取文档
参数:
docs: 文档列表 [{"_index": "idx", "_id": "1"}, ...]
index: 默认索引(与 ids 配合使用)
ids: ID 列表(与 index 配合使用)
source: 返回的字段列表
示例:
doc_mget(docs=[
{"_index": "products", "_id": "1"},
{"_index": "products", "_id": "2"}
])
doc_mget(index="products", ids=["1", "2", "3"])
Inputs: docs, index, ids, source.
doc_sourceC
仅获取文档 _source(不含元数据)
参数:
index: 索引名称
id: 文档 ID
source: 返回的字段列表
Inputs: index (required), id (required), source.
doc_updateB
更新文档
参数:
index: 索引名称
id: 文档 ID
doc: 部分更新的字段
script: 脚本更新
upsert: 文档不存在时插入的内容
refresh: 刷新策略
示例 - 部分更新:
doc_update("products", "1", doc={"price": 899})
示例 - 脚本更新:
doc_update("products", "1", script={
"source": "ctx._source.price -= params.discount",
"params": {"discount": 100}
})
Inputs: index (required), id (required), doc, script, +2 more.
doc_update_by_queryC
按查询更新文档
参数:
index: 索引名称
query: 查询条件(可选,不传则匹配所有)
script: 更新脚本
refresh: 是否刷新
示例:
doc_update_by_query("products",
query={"term": {"category": "electronics"}},
script={"source": "ctx._source.on_sale = true"}
)
Inputs: index (required), query, script, refresh.
explainC
解释文档评分
参数:
index: 索引名称
id: 文档 ID
query: 查询条件
返回文档为什么匹配/不匹配查询,以及评分计算过程
Inputs: index (required), id (required), query (required).
field_capsC
获取字段能力信息
参数:
index: 索引名称
fields: 字段列表
返回字段在各索引中的类型和能力
Inputs: index (required), fields (required).
ilm_add_policyB
给索引绑定 ILM 策略
参数:
index: 索引名称
policy_id: ILM 策略 ID
示例:
ilm_add_policy("logs-000001", "logs-policy")
Inputs: index (required), policy_id (required).
ilm_policy_createA
创建 ILM 策略
参数:
policy_id: 策略 ID
hot: 热阶段配置
warm: 温阶段配置
cold: 冷阶段配置
delete: 删除阶段配置
description: 策略描述
示例 - 基本策略:
ilm_policy_create("logs-policy",
hot={
"min_age": "0ms",
"actions": {
"rollover": {"max_size": "50gb", "max_age": "30d"}
}
},
delete={
"min_age": "90d",
"actions": {"delete": {}}
}
)
示例 - 完整生命周期:
ilm_policy_create("full-lifecycle",
hot={
"min_age": "0ms",
"actions": {
"rollover": {"max_size": "50gb", "max_age": "7d"},
"set_priority": {"priority": 100}
}
},
warm={
"min_age": "30d",
"actions": {
"shrink": {"number_of_shards": 1},
"forcemerge": {"max_num_segments": 1},
"set_priority": {"priority": 50}
}
},
cold={
"min_age": "60d",
"actions": {
"set_priority": {"priority": 0}
}
},
delete={
"min_age": "90d",
"actions": {"delete": {}}
}
)
常用 actions:
- rollover: 滚动索引 (max_size, max_age, max_docs)
- shrink: 收缩分片数
- forcemerge: 合并段
- set_priority: 设置恢复优先级
- allocate: 分配到特定节点
- readonly: 设为只读
- delete: 删除索引
Inputs: policy_id (required), hot, warm, cold, +2 more.
ilm_policy_deleteC
删除 ILM 策略
参数:
policy_id: 策略 ID
Inputs: policy_id (required).
ilm_policy_getC
获取 ILM 策略
参数:
policy_id: 策略 ID(可选,不传则获取所有策略)
Inputs: policy_id.
ilm_remove_policyC
从索引移除 ILM 策略
参数:
index: 索引名称
Inputs: index (required).
index_clear_cacheC
清除索引缓存
参数:
index: 索引名称(可选)
fielddata: 清除 fielddata 缓存
query: 清除查询缓存
request: 清除请求缓存
Inputs: index, fielddata, query, request.
index_cloneB
克隆索引
参数:
source: 源索引名称
target: 目标索引名称
settings: 目标索引设置
注意:源索引必须是只读的
Inputs: source (required), target (required), settings.
index_closeA
关闭索引(关闭后无法读写,但保留数据)
参数:
index: 索引名称
Inputs: index (required).
index_createB
创建索引
参数:
index: 索引名称
mappings: 字段映射定义
settings: 索引设置(分片数、副本数等)
aliases: 别名定义
示例:
index_create("products",
mappings={"properties": {"name": {"type": "text"}, "price": {"type": "float"}}},
settings={"number_of_shards": 3, "number_of_replicas": 1}
)
Inputs: index (required), mappings, settings, aliases.
index_create_with_write_aliasA
创建带可写别名的索引(rollover 的前置条件)
参数:
index: 索引名称(建议使用 name-000001 格式)
alias: 别名名称
mappings: 字段映射
settings: 索引设置
示例:
index_create_with_write_alias("logs-000001", "logs",
mappings={"properties": {"@timestamp": {"type": "date"}}})
Inputs: index (required), alias (required), mappings, settings.
index_deleteB
删除索引(危险操作)
参数:
index: 索引名称,支持通配符如 logs-*
Inputs: index (required).
index_existsC
检查索引是否存在
参数:
index: 索引名称
Inputs: index (required). Returns: result
index_flushC
刷新索引到磁盘
参数:
index: 索引名称(可选)
force: 是否强制刷新
Inputs: index, force.
index_forcemergeA
强制合并索引段
参数:
index: 索引名称(可选)
max_num_segments: 合并到的最大段数
only_expunge_deletes: 仅清除已删除文档
注意:这是资源密集型操作,建议在低峰期执行
Inputs: index, max_num_segments, only_expunge_deletes.
index_getB
获取索引详情(mappings、settings、aliases)
参数:
index: 索引名称,支持通配符
Inputs: index (required).
index_get_mappingD
获取索引映射
参数:
index: 索引名称
Inputs: index (required).
index_get_settingsC
获取索引设置
参数:
index: 索引名称
include_defaults: 是否包含默认设置
Inputs: index (required), include_defaults.
index_openD
打开索引
参数:
index: 索引名称
Inputs: index (required).
index_prepare_for_shrinkA
准备索引用于收缩(shrink 的前置条件)
将索引设为只读,并将所有分片迁移到同一节点
参数:
index: 索引名称
target_node: 目标节点名称(可选,不传则使用第一个数据节点)
Inputs: index (required), target_node.
index_put_mappingA
更新索引映射(只能添加字段,不能修改已有字段)
参数:
index: 索引名称
properties: 字段定义
dynamic: 动态映射策略 true/false/strict
示例:
index_put_mapping("products",
properties={"category": {"type": "keyword"}}
)
Inputs: index (required), properties (required), dynamic.
index_put_settingsC
更新索引设置
参数:
index: 索引名称
settings: 设置项
示例:
index_put_settings("products", {"index.refresh_interval": "30s"})
Inputs: index (required), settings (required).
index_recoveryC
获取索引恢复状态
参数:
index: 索引名称(可选)
active_only: 仅显示进行中的恢复
Inputs: index, active_only.
index_refreshB
刷新索引(使最近写入的文档可搜索)
参数:
index: 索引名称(可选,不传则刷新所有)
Inputs: index.
index_rolloverC
滚动索引
参数:
alias: 别名名称
conditions: 滚动条件
settings: 新索引设置
mappings: 新索引映射
示例:
index_rollover("logs", conditions={
"max_age": "7d",
"max_docs": 1000000,
"max_size": "5gb"
})
Inputs: alias (required), conditions, settings, mappings.
index_segmentsD
获取索引段信息
参数:
index: 索引名称(可选)
Inputs: index.
index_set_readonlyA
设置索引为只读(clone/split/shrink 的前置条件)
参数:
index: 索引名称
readonly: True 设为只读,False 取消只读
示例:
index_set_readonly("my-index", True) # 设为只读
index_set_readonly("my-index", False) # 取消只读
Inputs: index (required), readonly.
index_shard_storesC
获取分片存储信息
参数:
index: 索引名称(可选)
status: 状态过滤 green/yellow/red/all
Inputs: index, status.
index_shrinkA
收缩索引(减少分片数)
参数:
source: 源索引名称
target: 目标索引名称
settings: 目标索引设置
注意:源索引必须是只读的,且所有分片在同一节点
Inputs: source (required), target (required), settings.
index_splitB
拆分索引(增加分片数)
参数:
source: 源索引名称
target: 目标索引名称
settings: 目标索引设置(必须包含 number_of_shards)
注意:新分片数必须是原分片数的倍数
Inputs: source (required), target (required), settings.
index_statsB
获取索引统计信息
参数:
index: 索引名称(可选)
metric: 指标类型 docs/store/indexing/get/search/merge/refresh/flush/warmer/query_cache/fielddata/completion/segments/translog
Inputs: index, metric.
ingest_processor_grokB
获取内置的 Grok 模式列表
Inputs: no named parameters.
ingest_statsC
获取 Ingest 统计信息
参数:
node_id: 节点 ID(可选)
Inputs: node_id.
knn_searchC
K近邻向量搜索
参数:
index: 索引名称
field: 向量字段名
query_vector: 查询向量
k: 返回最近邻数量
num_candidates: 候选数量
filter: 过滤条件
示例:
knn_search("products", "embedding", [0.1, 0.2, 0.3, ...], k=10)
Inputs: index (required), field (required), query_vector (required), k, +2 more.
msearchC
多重搜索(一次请求执行多个搜索)
参数:
searches: 搜索列表,每项包含 header 和 body
示例:
msearch([
{"header": {"index": "products"}, "body": {"query": {"match": {"name": "iPhone"}}}},
{"header": {"index": "products"}, "body": {"query": {"match": {"name": "iPad"}}}}
])
Inputs: searches (required).
nodes_hot_threadsA
获取节点热点线程
参数:
node_id: 节点 ID(可选)
threads: 每个节点显示的线程数
interval: 采样间隔
type: 线程类型 cpu/wait/block
用于诊断 CPU 高占用问题
Inputs: node_id, threads, interval, type. Returns: result
nodes_infoC
获取节点信息
参数:
node_id: 节点 ID(可选,逗号分隔多个)
metric: 信息类型 settings/os/process/jvm/thread_pool/transport/http/plugins/ingest
返回节点配置、JVM 信息、线程池配置等
Inputs: node_id, metric.
nodes_reload_secure_settingsC
重新加载安全设置
参数:
node_id: 节点 ID(可选)
secure_settings_password: keystore 密码
Inputs: node_id, secure_settings_password.
nodes_statsA
获取节点统计信息
参数:
node_id: 节点 ID(可选)
metric: 统计类型 indices/os/process/jvm/thread_pool/fs/transport/http/breaker/script/discovery/ingest
index_metric: 索引统计类型 docs/store/indexing/get/search/merge/refresh/flush/warmer/query_cache/fielddata/completion/segments/translog
示例:
nodes_stats() # 所有统计
nodes_stats(metric="jvm,fs") # JVM 和文件系统
nodes_stats(metric="indices", index_metric="search,indexing") # 搜索和索引统计
Inputs: node_id, metric, index_metric.
nodes_usageC
获取节点功能使用统计
参数:
node_id: 节点 ID(可选)
metric: 统计类型 rest_actions/aggregations
返回各 API 和聚合的使用次数
Inputs: node_id, metric.
pipeline_createB
创建 Ingest Pipeline
参数:
id: Pipeline ID
description: 描述
processors: 处理器列表
on_failure: 失败处理器列表
示例:
pipeline_create("my-pipeline", "Add timestamp", processors=[
{"set": {"field": "@timestamp", "value": "{{_ingest.timestamp}}"}}
])
常用处理器:
- set: 设置字段值
- remove: 删除字段
- rename: 重命名字段
- convert: 类型转换
- grok: 正则解析
- date: 日期解析
- json: JSON 解析
- split: 字符串分割
- trim: 去除空白
- lowercase/uppercase: 大小写转换
- script: 脚本处理
Inputs: id (required), description (required), processors (required), on_failure.
pipeline_deleteC
删除 Ingest Pipeline
参数:
id: Pipeline ID
Inputs: id (required).
pipeline_getC
获取 Ingest Pipeline
参数:
id: Pipeline ID(可选,支持通配符)
Inputs: id.
pipeline_simulateC
模拟 Pipeline 执行
参数:
id: 已存在的 Pipeline ID
pipeline: 内联 Pipeline 定义
docs: 测试文档列表
verbose: 是否显示每个处理器的输出
示例:
pipeline_simulate(
pipeline={"processors": [{"set": {"field": "foo", "value": "bar"}}]},
docs=[{"_source": {"name": "test"}}]
)
Inputs: id, pipeline, docs, verbose.
reindexC
重建索引
参数:
source: 源配置 {"index": "old-index", "query": {...}}
dest: 目标配置 {"index": "new-index"}
script: 转换脚本
max_docs: 最大文档数
示例:
reindex(
source={"index": "old-index"},
dest={"index": "new-index"}
)
Inputs: source (required), dest (required), script, max_docs.
scroll_clearC
清除滚动上下文
参数:
scroll_id: 滚动 ID
all: 是否清除所有滚动上下文
Inputs: scroll_id, all.
scroll_nextC
获取下一批滚动结果
参数:
scroll_id: 滚动 ID
scroll: 滚动上下文保持时间
Inputs: scroll_id (required), scroll.
scroll_startB
开始滚动搜索(用于遍历大量数据)
参数:
index: 索引名称
query: 查询条件
size: 每批数量
scroll: 滚动上下文保持时间
sort: 排序规则
返回 scroll_id 用于后续获取
Inputs: index (required), query, size, scroll, +1 more.
searchB
执行搜索查询
参数:
index: 索引名称(支持通配符和逗号分隔多个索引)
query: DSL 查询条件
size: 返回数量
from_: 起始位置(分页)
sort: 排序规则
source: 返回的字段列表
aggs: 聚合定义
highlight: 高亮配置
track_total_hits: 是否精确统计总数
示例 - 全文搜索:
search("products", query={"match": {"name": "iPhone"}})
示例 - 复合查询:
search("products", query={
"bool": {
"must": [{"match": {"name": "phone"}}],
"filter": [{"range": {"price": {"lte": 1000}}}]
}
})
示例 - 带排序和分页:
search("products", query={"match_all": {}},
sort=[{"price": "desc"}], from_=10, size=10)
Inputs: index (required), query, size, from_, +5 more.
search_simpleB
简单关键词搜索
参数:
index: 索引名称
keyword: 搜索关键词
field: 搜索字段(可选,不传则全字段搜索)
size: 返回数量
示例:
search_simple("products", "iPhone")
search_simple("logs", "error", field="message")
Inputs: index (required), keyword (required), field, size.
search_templateC
使用搜索模板
参数:
index: 索引名称
id: 已存储的模板 ID
source: 内联模板
params: 模板参数
示例:
search_template("products", id="my-template", params={"query_string": "iPhone"})
Inputs: index (required), id, source, params.
slm_policy_createB
创建快照生命周期策略
参数:
name: 策略名称
description: 策略描述
repository: 快照仓库名称
indices: 要备份的索引(默认 *)
creation_schedule: 创建快照的 cron 表达式(默认每天 8:00)
creation_timezone: 创建时区
deletion_schedule: 删除快照的 cron 表达式(默认每天 1:00)
deletion_timezone: 删除时区
max_age: 快照最大保留时间
max_count: 最大快照数量
min_count: 最小快照数量
include_global_state: 是否包含全局状态
示例:
slm_policy_create("daily-backup", "每日备份", "my_backup",
creation_schedule="0 2 * * *",
max_age="30d", max_count=30
)
Inputs: name (required), description (required), repository (required), indices, +8 more.
slm_policy_deleteC
删除快照生命周期策略
参数:
name: 策略名称
Inputs: name (required).
slm_policy_explainB
解释快照生命周期策略
参数:
name: 策略名称(支持通配符如 daily*)
返回策略的详细解释,包括下次创建/删除快照的时间
Inputs: name (required).
slm_policy_getC
获取快照生命周期策略
参数:
name: 策略名称(可选,支持通配符如 daily*)
Inputs: name.
slm_policy_startC
启动快照生命周期策略
参数:
name: 策略名称
Inputs: name (required).
slm_policy_stopC
停止快照生命周期策略
参数:
name: 策略名称
Inputs: name (required).
snapshot_cloneC
克隆快照
参数:
repository: 仓库名称
source_snapshot: 源快照名称
target_snapshot: 目标快照名称
indices: 要克隆的索引(逗号分隔)
Inputs: repository (required), source_snapshot (required), target_snapshot (required), indices (required).
snapshot_createB
创建快照
参数:
repository: 仓库名称
snapshot: 快照名称
indices: 索引列表(可选,不传则备份所有)
ignore_unavailable: 忽略不存在的索引
include_global_state: 包含集群状态
wait_for_completion: 等待完成
示例:
snapshot_create("my_backup", "snapshot_1")
snapshot_create("my_backup", "snapshot_2", indices=["logs-*", "metrics-*"])
Inputs: repository (required), snapshot (required), indices, ignore_unavailable, +2 more.
snapshot_deleteC
删除快照
参数:
repository: 仓库名称
snapshot: 快照名称
Inputs: repository (required), snapshot (required).
snapshot_getC
获取快照信息
参数:
repository: 仓库名称
snapshot: 快照名称(可选,支持通配符,_all 获取所有)
verbose: 是否显示详细信息
Inputs: repository (required), snapshot, verbose.
snapshot_repo_createC
创建快照仓库
参数:
name: 仓库名称
type: 仓库类型 fs/s3/hdfs/azure/gcs
settings: 仓库设置
示例 - 文件系统仓库:
snapshot_repo_create("my_backup", "fs", {"location": "/mount/backups"})
示例 - S3 仓库:
snapshot_repo_create("s3_backup", "s3", {
"bucket": "my-bucket",
"region": "us-east-1"
})
Inputs: name (required), type (required), settings (required).
snapshot_repo_deleteC
删除快照仓库
参数:
name: 仓库名称
Inputs: name (required).
snapshot_repo_getC
获取快照仓库信息
参数:
name: 仓库名称(可选,支持通配符)
Inputs: name.
snapshot_repo_verifyC
验证快照仓库
参数:
name: 仓库名称
Inputs: name (required).
snapshot_restoreC
恢复快照
参数:
repository: 仓库名称
snapshot: 快照名称
indices: 要恢复的索引列表
ignore_unavailable: 忽略不存在的索引
include_global_state: 恢复集群状态
rename_pattern: 重命名模式(正则)
rename_replacement: 重命名替换
wait_for_completion: 等待完成
示例 - 恢复并重命名:
snapshot_restore("my_backup", "snapshot_1",
indices=["logs-*"],
rename_pattern="(.+)",
rename_replacement="restored_$1"
)
Inputs: repository (required), snapshot (required), indices, ignore_unavailable, +4 more.
snapshot_statusB
获取快照状态
参数:
repository: 仓库名称(可选)
snapshot: 快照名称(可选)
返回正在进行的快照的详细进度
Inputs: repository, snapshot.
sql_queryC
执行 SQL 查询
参数:
query: SQL 查询语句
format: 返回格式 json/csv/txt/yaml
fetch_size: 每次获取的行数
示例:
sql_query("SELECT * FROM products WHERE price > 100 LIMIT 10")
sql_query("SELECT category, COUNT(*) FROM products GROUP BY category")
Inputs: query (required), format, fetch_size.
tasks_cancelC
取消任务
参数:
task_id: 任务 ID(可选)
actions: 动作过滤
nodes: 节点过滤
parent_task_id: 父任务 ID
示例:
tasks_cancel(task_id="node1:12345")
tasks_cancel(actions="*reindex*")
Inputs: task_id, actions, nodes, parent_task_id.
tasks_getC
获取任务详情
参数:
task_id: 任务 ID(格式:node_id:task_number)
wait_for_completion: 等待任务完成
timeout: 等待超时时间
Inputs: task_id (required), wait_for_completion, timeout.
tasks_listB
获取正在执行的任务列表
参数:
actions: 动作过滤(支持通配符)如 cluster:* 或 indices:data/write/*
detailed: 是否显示详细信息
parent_task_id: 父任务 ID
nodes: 节点过滤
group_by: 分组方式 nodes/parents/none
Inputs: actions, detailed, parent_task_id, nodes, +1 more.
template_createB
创建索引模板
参数:
name: 模板名称
index_patterns: 匹配的索引模式列表
template: 模板内容(mappings、settings、aliases)
priority: 优先级
composed_of: 组件模板列表
示例:
template_create("logs-template",
index_patterns=["logs-*"],
template={
"settings": {"number_of_shards": 3},
"mappings": {"properties": {"@timestamp": {"type": "date"}}}
},
priority=100
)
Inputs: name (required), index_patterns (required), template (required), priority, +1 more.
template_deleteC
删除索引模板
参数:
name: 模板名称
Inputs: name (required).
template_getC
获取索引模板
参数:
name: 模板名称(可选,支持通配符)
Inputs: name.
validate_queryC
验证查询语法
参数:
index: 索引名称
query: 查询条件
explain: 是否返回详细解释
rewrite: 是否返回重写后的查询
Inputs: index (required), query (required), explain, rewrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 121 tools
Many tools have overlapping purposes, causing significant ambiguity. For example, 'aggregate' and 'aggregate_simple' are very similar, as are 'doc_bulk' and 'doc_bulk_simple', 'search' and 'search_simple', and multiple 'cat_' tools that could be confused (e.g., 'cat_health' vs. 'cluster_health'). While descriptions help, the sheer number of similar tools makes it difficult for an agent to reliably choose the right one without deep domain knowledge.
The naming is mostly consistent with a clear pattern: most tools use snake_case and follow a verb_noun or noun_verb structure (e.g., 'index_create', 'doc_delete', 'cluster_health'). However, there are minor deviations like 'knn_search' (abbreviation mixed in) and some tools with slightly inconsistent prefixes (e.g., 'alias_actions' vs. 'ilm_add_policy'), but overall the naming is predictable and readable.
With 121 tools, this is an extreme mismatch for an MCP server. The count is far too high for typical agent use, making it overwhelming and difficult to navigate. Even for an Elasticsearch interface, this level of granularity is excessive and likely includes many low-level or administrative tools that agents rarely need, leading to confusion and inefficiency.
The tool set is extremely complete for Elasticsearch operations, covering CRUD, search, aggregation, indexing, cluster management, ILM, snapshots, and more. There are no obvious gaps; every major Elasticsearch API endpoint appears to be represented, providing comprehensive coverage for the domain. Agents can perform complex workflows without dead ends.
Maintenance
Related MCP Connectors
Astra DB tools for agents: schema, find, vector search, guarded writes, and interactive views.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Complete SEO and AI Search stack for your AI agents
87 public tools: agent workflows, audio data transfer, semantic search, queues and webhooks.
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceProvides comprehensive tools for managing Elasticsearch clusters, including security management, search operations, and index administration. It enables users to monitor cluster health, handle InfoSec tasks, and execute complex queries using Elasticsearch Query DSL and ES|QL.37-
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with OpenSearch clusters to monitor cluster health, manage indices, and perform data searches. It provides a standardized interface for real-time OpenSearch operations within MCP-compatible environments like Open WebUI.-
- AlicenseBqualityFmaintenanceEnables interaction with OpenSearch clusters, providing tools to list indices, retrieve mappings, search using query DSL, and get shard information.41Apache 2.0
- AlicenseBqualityDmaintenanceEnables interaction with Elasticsearch clusters for health checks, index management, document CRUD operations, and search via natural language.1017 npmMIT