Skip to content

observer-mcp: a read-only MCP server - #57

Merged
josedaniel-dev merged 2 commits into
mainfrom
feat/mcp-server
Oct 16, 2026
Merged

josedaniel-dev merged 2 commits into
mainfrom
feat/mcp-server

Conversation

@josedaniel-dev

@josedaniel-dev josedaniel-dev commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Step 6 of docs/roadmap.md.

  • observer-mcp (app/ops/mcp_server.py): MCP over stdio, talks to a running Observer via its HTTP API. Optional extra mcp (also in dev so CI tests it).
  • 11 tools, all declared readOnlyHint: observer_overview, list_traces, list_failed_traces (status error + health below a threshold, with reasons), get_trace (spans, tools, provider chain, scores), list_alerts, list_datasets, get_dataset, list_runs, compare_runs, metrics_schema, query_metrics.
  • Privacy: span/trace input/output are never returned unless OBSERVER_MCP_CONTENT=1; lists are capped.
  • Read-only by construction: only GET plus the metrics query (a POST that computes, writes nothing); a test fails on any other method or write path. stdio only, no listening port.
  • Docs: docs/mcp.md (setup for Claude Code, tools, privacy), README, roadmap.

Tests (7): tool list and annotations, content omitted, failed traces, datasets/runs/comparison/metrics through an in-memory MCP client, clean errors, read-only guard. Backend 201 passed on this branch (it does not include the OTLP PR #56), ruff clean. Verified over real stdio with an MCP client against a synthetic Observer: an OTLP-ingested trace with its tool span was listed and read.

Closes roadmap steps 1–6; 'Later' (per-project capture modes, ingestion reliability) remains.

Merge order: this branch is based on main without #56; both append to docs/roadmap.md, so merge #56 first and I will rebase this one (the roadmap log lines would conflict otherwise).

Eleven read-only tools over the HTTP API (overview, traces, failed traces with reasons, one trace
with spans/tools/provider chain/scores, alerts, datasets, runs, comparison, metrics query). Trace
and span input/output are never returned unless OBSERVER_MCP_CONTENT=1. A test fails if the
reader can use anything but GET or the metrics query. Optional extra 'mcp'. Roadmap step 6 done.
@josedaniel-dev
josedaniel-dev merged commit ea5671c into main Oct 16, 2026
5 checks passed
@josedaniel-dev
josedaniel-dev deleted the feat/mcp-server branch October 17, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant