运维智能体使用mcp配置
  • Python 83.1%
  • Shell 16.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-22 09:56:22 +08:00
core init 2026-10-22 09:34:34 +08:00
database init 2026-10-22 09:34:34 +08:00
mcp_server init 2026-10-22 09:34:34 +08:00
.env.example init 2026-10-22 09:34:34 +08:00
.gitignore init 2026-10-22 09:34:34 +08:00
.python-version init 2026-10-22 09:34:34 +08:00
debug.sh 优化启动脚本 2026-10-22 09:56:22 +08:00
DEVELOP.md init 2026-10-22 09:34:34 +08:00
pyproject.toml init 2026-10-22 09:34:34 +08:00
README.md init 2026-10-22 09:34:34 +08:00
start-bg.sh 优化启动脚本 2026-10-22 09:56:22 +08:00
start.sh init 2026-10-22 09:34:34 +08:00
uv.lock init 2026-10-22 09:34:34 +08:00

bingjun-devops

能碳平台数据采集运维 MCP:按项目名切库、抽样水/电表、查采集、写 AMC 告警。

架构对齐 bingjun_energy_os(@register_tool + FastMCP bridge)。

快速开始

cd bingjun-devops
cp .env.example .env   # 填写 AMC / 项目库连接
uv sync
# 在 AMC 库执行 database/*.sql
./start.sh mcp

MCP 工具

工具 说明
query_sample_devices 项目名 → 映射切库 → 抽样电表/水表
query_device_collection_data 按 device_name 模糊匹配设备 + 时间窗查采集(不用 device_id)
insert_collection_ops_alert 告警写入 AMC(severe/general)
query_collection_ops_alerts 查询告警

多数据源

  1. Hermes 传 project_name
  2. 读 AMC 表 agent_project_db_mapping 得 database_name
  3. 用 .env 的 project_data_source(host/user/password)+ 动态库名连业务库
  4. 告警写回 AMC(amc_data_source)

建表

SQL 在项目根目录 database/:

  • agent_project_db_mapping.sql
  • agent_collection_ops_alert.sql