MCP server that diffs error logs between two deployment versions of a service over SSH.
post-deploy-monitor
MCP server that compares error patterns between two deployment versions of a service by SSH-grepping log files on a central log host, classifying each distinct error as NEW, REGRESSED, or PRE_EXISTING.
Setup
- Install uv.
- From this directory:
uv sync. - Copy
config.example.tomltoconfig.tomland fill in your values, OR setSSH_HOST_ALIASandLOG_ROOTas environment variables. - Add a matching
Hostblock to~/.ssh/config(see the design doc).
Wiring into GitHub Copilot
Add to your Copilot MCP config:
{
"mcpServers": {
"post-deploy-monitor": {
"command": "uv",
"args": ["run", "--project", "<absolute-path-to-this-dir>", "post-deploy-monitor"],
"env": {
"SSH_HOST_ALIAS": "log-host",
"LOG_ROOT": "/var/log/myapp"
}
}
}
}
Testing
uv run pytest
How it works
For each call, the server SSHes into the log host and runs zgrep over the
log files for the current deployment version, then again for the previous
version. Matching lines are normalized into stable signatures (timestamps,
UUIDs, request IDs, line numbers stripped). Each signature seen in current is
classified as:
- NEW — not seen at all in previous (likely caused by your change)
- REGRESSED — present in both, but >3× more frequent in current
- PRE_EXISTING — present in both at similar rates (not your problem)
The result is a JSON report sorted with NEW first, ready for an LLM agent to read and reason about.
Log file layout
Hard-coded assumption (see log_locator.py): files live at
<LOG_ROOT>/<YYYY>/<MM>/<DD>/<vm_host>/<service>-<version_underscored>/<app_instance_uuid>/<file>.gz
If your layout differs, edit build_globs in log_locator.py to match.