Triage MCP Server
Enables AI agents to autonomously check, diagnose, and recover Dockerized services through safe, tool-based ops without direct host shell access.
README
🩺 Triage — a self-healing ops MCP for any Dockerized service
Let an AI agent (or a human) check, diagnose, and recover a service — without a host shell.
Most "give the agent ops powers" setups are bad: you either hand the model a raw shell (now it can roam the whole box and conflate unrelated subsystems), or you wire up dashboards a model can't read. Triage is the third option:
A small MCP server that exposes a handful of health/diagnose/recover tools. Each returns raw evidence AND a plain-English translation, a suggested action, and whether the fix is safe to auto-apply. The agent acts through tools — it never touches the host directly.
The policy that makes it safe
| Class | Tools | Behaviour |
|---|---|---|
| Auto-fix safe | triage_restart_process, triage_recover |
An agent may run these on its own and report after. Infra only — no data touched. |
| Ask before risky | triage_apply(confirm=true) |
Anything that could lose data / change external state. Dry-run unless confirm=true. |
| Can't self-fix | (reported) | Diagnosed and handed to the human with exact steps — never faked. |
The dual raw + layman output is the differentiator: the agent gets structured data to act on, and the
human gets a sentence they can actually understand ("Postiz's API engine isn't running — the known cold-boot hiccup. I'll restart it.").
Tools
| Tool | Kind | What it does |
|---|---|---|
triage_health() |
read | Containers + configured in-container processes + optional dependency ping. |
triage_diagnose() |
read | Health check matched to a runbook → issues with raw + plain-English + action + can_auto_fix. |
triage_logs(lines) |
read | Raw service log tail. |
triage_restart_process(name) |
safe | Restart one in-container process (pm2). |
triage_recover() |
safe | Recreate the service container from compose. No volumes/data touched. |
triage_apply(confirm) |
risky | Dry-run by default; runs the configured risky command only on confirm=true. |
Configure (zero code changes)
Everything is env-driven — point it at any compose-managed service:
TRIAGE_COMPOSE=/path/to/docker-compose.yaml # compose file
TRIAGE_SERVICE=app # the main container/service name
TRIAGE_LABEL="My App" # friendly name used in messages
TRIAGE_PROCS=backend,worker # optional: in-container processes to watch
TRIAGE_PROC_MGR=pm2 # "pm2" | "none"
TRIAGE_DB_PING="docker exec app-db pg_isready" # optional: rc 0 = dependency healthy
TRIAGE_RISKY_CMD="" # optional: a guarded recovery (clear a queue, etc.)
TRIAGE_RISKY_DESC="clear the stuck job queue"
TRIAGE_PORT=9500
See .env.example.
Run
pip install -r requirements.txt
python3 triage.py # serves an MCP over streamable-http on TRIAGE_PORT
Register it with your agent runtime (any MCP client). For an always-on host service, use the included
launchd template com.triage.ops.plist (macOS) — adapt to systemd on Linux.
Hard-won lessons baked in
- Agents in a container can't see host processes. Give them status tools, not a shell. With shell access a model conflates unrelated subsystems and reports false negatives. Tools keep it honest.
- Two reports, always. Structured
rawfor the agent to branch on; a one-sentencelaymanfor the human. A health check the human can't read is half a tool. - Encode the safe/risky boundary in the tool, not the prompt. "Don't clear the queue without asking" in
a system prompt is a suggestion; a
confirm=true-gated dry-run is a guarantee. docker compose ps --format jsonvaries by version (NDJSON vs single array) — handle both.- Recover ≠ restart. A dead process needs a restart; an unhealthy container needs a recreate. Separate tools so the agent escalates correctly.
Built by
Built by KodeKing · author Fazal Shah. We build local, private, multi-agent AI systems for teams who can't send their data to the cloud. Issues and PRs welcome.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。