LUCID-TRAIN(1)General Commands Manual

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 tokenRecommended. Administration → Service accounts → Add token. Set GRAFANA_SERVICE_ACCOUNT_TOKEN.
Username / passwordBasic 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:

~/.lucid-train/config.toml
[mcp_servers.grafana]
command = "mcp-grafana"
args = ["-t", "stdio"]
[mcp_servers.grafana.env]
GRAFANA_URL = "http://localhost:3000"
GRAFANA_SERVICE_ACCOUNT_TOKEN = "glsa_xxx"

2. Observe

Ask in plain language; the Activity panel shows each query and result.

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 repoPoint the working directory at the checkout; Lucid edits with diffs and runs your tests via the shell.
GitHubgh CLI (gh auth login) to clone/branch/PR; add the GitHub MCP server for issues, reviews and checks.
GitLabglab CLI (glab auth login); open merge requests with glab mr create.
BitbucketPlain 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.