Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3486426
实现prometheus数据获取mcp,包含一个tool
aice030 Aug 26, 2025
6c6551d
实现superset数据获取mcp,包含一个tool
aice030 Aug 26, 2025
561c2f9
实现elasticsearch数据获取mcp,包含三个tool
aice030 Aug 26, 2025
695f166
Merge remote-tracking branch 'qiniu/mvp' into prometheus
aice030 Aug 26, 2025
18af8d9
Merge remote-tracking branch 'qiniu/mvp' into superset
aice030 Aug 26, 2025
63f5ee2
Merge remote-tracking branch 'qiniu/mvp' into elasticsearch
aice030 Aug 26, 2025
62f450f
发布准备各部分功能,生成发布issue
aice030 Aug 26, 2025
8d49da8
Merge branch 'superset'
aice030 Aug 26, 2025
9d1e9db
Merge branch 'elasticsearch'
aice030 Aug 26, 2025
98105f3
Merge branch 'release-prepare'
aice030 Aug 26, 2025
ad545bf
为prometheus工具添加resource方法
aice030 Aug 27, 2025
ff746cc
为prometheus工具添加resource方法,有问题,能识别resource但是用不了
aice030 Aug 27, 2025
07ab57c
Merge branch 'prometheus'
aice030 Aug 27, 2025
602f184
更新了main.go,删除了无意义的main方法
aice030 Aug 27, 2025
787331c
Merge branch 'elasticsearch'
aice030 Aug 27, 2025
49cdba3
修改了mcp服务名,统一了host_id与host_ip的命名
aice030 Aug 28, 2025
723aca5
统一了发布hosts的字段命名
aice030 Aug 28, 2025
76d74e4
修改了superset的mcp服务名
aice030 Aug 28, 2025
faf9f65
mcp设计文档
aice030 Aug 29, 2025
951c657
发布准备设计文档
aice030 Aug 29, 2025
21e4fc3
完善发布准备功能模块的输出格式
aice030 Aug 29, 2025
53aaac9
Merge remote-tracking branch 'qiniu/mvp'
aice030 Aug 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions docs/mcp设计.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Prometheus MCP Server

## prometheus\_query

**描述:**执行指定的 PromQL 查询语句,并获取对应地区的 Prometheus 监控指标数据

**参数列表:**

{

`"promql"`(string, 必需):PromQL 查询语句

`"regionCode"`(string, 可选):地区代码,用于映射查询的 Prometheus 地址。默认值为 "mock",对应 "localhost"。

}

**返回值格式:**

```json
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"__name__": "process_cpu_seconds_total",
"instance": "localhost:9090",
"job": "prometheus"
},
"value": [1640995200, "0.001234"]
}
]
}
}
```

# ElasticSearch MCP Servier

## elasticsearch\_get\_service

**描述:**;询指定主机在给定时间区间内运行的服务

**参数列表:**

{

` "host_id"`(string, 必需):主机ID

`"start_time"`(string, 必需):查询区间的起始时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

`"end_time"`(string, 必需):查询区间的结束时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

}

**返回值格式:**

```json
{
"status": "success",
"data": {
"host_id": "server-001",
"service": "storage-service",
"start_time": "2025-08-20T00:00:00Z",
"end_time": "2025-08-20T23:59:59Z"
}
}
```

## elasticsearch\_fetch\_logs

**描述:**根据服务名称和主机 ID,获取指定时间段内的运行日志

**参数列表:**

{

`"service"`(string, 可选, 推荐):服务名称,若未指定,则需额外根据主机查询服务。

`"host_id"`(string, 必需):主机ID

`"start_time"`(string, 必需):查询区间的起始时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

`"end_time"`(string, 必需):查询区间的结束时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

}

**返回值格式:**

```json
{
"status": "success",
"data": {
"service": "storage-service",
"host_id": "server-001",
"start_time": "2025-08-20T00:00:00Z",
"end_time": "2025-08-20T23:59:59Z",
"index": "mock-storage-service-logs-2025.08.20",
"total_logs": 150,
"logs": [
{
"_index": "mock-storage-service-logs-2025.08.20",
"_source": {
"@timestamp": "2025-08-20T10:30:00Z",
"host_id": "server-001",
"service": "storage-service",
"level": "INFO",
"message": "Request processed successfully"
}
},
......
]
}
}
```

## elasticsearch\_request\_trace

**描述:**;据请求 ID,追踪该请求在指定时间段内经过的所有服务,并获取相关运行日志,构建请求链路

**实现方式:**;具会基于请求ID和起止时间,查询请求在指定时间段内经过的所有服务及其日志记录。随后根据处理顺序对服务进行排序,从而得到该请求的上下游关系。

**参数列表:**

{

`"request_id"`(string, 必需):请求ID

` "start_time"`(string, 必需):查询区间的结束时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

`"end_time"`(string, 必需):查询区间的结束时间,格式为 '2025-08-20T00:00:00Z',工具支持格式转换

}

**返回值格式:**

```json
{
"status": "success",
"data": {
"request_id": "req-12345",
"start_time": "2025-08-20T00:00:00Z",
"end_time": "2025-08-20T23:59:59Z",
"index_pattern": "mock-storage-service-logs-2025.08.20",
"total_services": 3,
"services": ["api-gateway", "user-service", "database-service"],
"total_logs": 25,
"logs": [...]
}
}
```

Binary file added docs/发布准备设计.md/images/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading