Grafana debugging
Lucid reads your Grafana observability data — Loki logs, Prometheus metrics, dashboards, alerts and Sift error patterns — and uses it to drive a fix in your repository. It runs Grafana’s official mcp-grafana server locally and exposes its tools to the agent as mcp__grafana__*.
1. Connect
In the desktop app, click Connect Grafana, enter your Grafana URL, and choose an auth method. Lucid downloads the mcp-grafana binary into ~/.lucid-train/bin/, stores the credentials in the OS keychain, and attaches the Grafana tools to your session. Credentials never enter the web UI storage or the message protocol.
| Service-account token | Recommended. Administration → Service accounts → Add token. Set GRAFANA_SERVICE_ACCOUNT_TOKEN. |
| Username / password | Basic auth for local dev. Sets GRAFANA_USERNAME / GRAFANA_PASSWORD. Prefer a token for shared use. |
In the TUI, register it as an MCP server in ~/.lucid-train/config.toml:
2. Observe
Ask in plain language; the Activity panel shows each query and result.
- Loki logs — “last 30 min of error logs for
checkout”, or LogQL like{service="checkout"} |= "error". - Sift — “find elevated error patterns in
paymentslogs this hour”. - Prometheus — “p99 of
http_request_durationforapiover 3h”. - Dashboards & alerts — “which alerts are firing?”, “summarize the anomalous panels on
API Overview”.
3. Locate & fix
Point Lucid at the repo — “the logs show panic: nil pointer in order.go:142, find that path and explain the root cause” — then let it apply the fix. Start in /plan mode for a reviewed diagnosis, switch to /agent to edit.
| Local repo | Point the working directory at the checkout; Lucid edits with diffs and runs your tests via the shell. |
| GitHub | gh CLI (gh auth login) to clone/branch/PR; add the GitHub MCP server for issues, reviews and checks. |
| GitLab | glab CLI (glab auth login); open merge requests with glab mr create. |
| Bitbucket | Plain git over HTTPS with an app password (Repositories: Read/Write scope). |
4. Verify
After the fix ships, re-run the query that opened the incident: “confirm the nil pointer pattern has dropped to zero since the deploy.” The signal that raised the alarm is the one that proves it’s resolved.