MCP servers as a tool source, prometheus-mcp first #2005
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2005
Reference in new issue
Block a user
An investigation needs the trend, not just a snapshot: how fast a filesystem is filling and when it will be full. Prometheus has an official MCP server (
prometheus/prometheus-mcp), so Archie runs it as published instead of wrapping it: core becomes an MCP client, and an MCP server is a fourth kind of accepted package beside connectors, secret engines and guards. Spec: R36. Design: ARCHITECTURE 2.5.Requirements
Accepting a server
Using its tools
5. Declared tools are offered to agents beside connector lookups and actions, named so they can't collide with them, with the server's input schema. They take the same path: lookups run directly, and once judgement exists an action is judged before it runs.
6. A tool call's result and errors come back to the agent verbatim. An error result fails that tool call, not the run.
7. Tool calls carry a deadline, and results are capped in size.
Prometheus first
8.
prometheus-mcpis accepted on staging over stdio with an allow-list of read tools only:query,range_query,series,label_names,label_values,metric_metadata. Its management and TSDB admin tools are not declared.9. Prometheus computes forecasts, not the model: the investigate prompt says to use
predict_linearthroughqueryfor a time-until-full figure.The old core MCP tool path moved to #2012, with the gateway and daemon that
still read it.
Done when
predict_linearquery, and the figure matches the same query run by hand in Prometheus.reload, is absent from the tools the agent is offered.Prometheus lookup for forecaststo Prometheus connector: metric lookups and a filesystem forecastPrometheus connector: metric lookups and a filesystem forecastto MCP servers as a tool source, prometheus-mcp firstAccepted on staging and verified end to end.
Deployed.
mainat the commit that made the MCP client, plus the fixes below, deployed to the staging host; migrations 00005 and 00006 applied.prometheus-mcpv0.18.0 (linux/amd64, sha256ea823027c6540d2adb46b6b58189e9ba8cf3b797e9a1e0043ab91d050645ceb3) sits in the host's extensions directory and is accepted over stdio:Allow-list. A run's
agent-toolsstep pinned 9 read-only tools: the host connector's three and the six declared Prometheus tools.reload,quit,tsdb_statsand the rest are absent, and calling one by name is refused.Forecast. An alert posted through Alertmanager, carrying
instanceandmountpoint. The run measured the filesystem with the host connector, then calledprometheus_querywith-predict_linear(node_filesystem_avail_bytes{instance="…",mountpoint="…"}[6h],0) / deriv(node_filesystem_avail_bytes{instance="…",mountpoint="…"}[6h]) / 3600and got 134.64637685173412. The same query run by hand against the demo Prometheus at the run's own evaluation timestamp returns 134.64637685173412. The findings report "not full for approximately 134.6 hours", and the message reached the composer.
Readiness and restart. A second accepted server pointed at a closed port made
/readyzreport it, with retries backing off 1s, 2s, 4s, 8s, 16s. Killing the Prometheus server's process got it restarted and its tools still answered; the reconnect is immediate, so a successful restart barely shows in readiness.Tool errors. A server's error result comes back as its own text and fails only that call (connector test, plus the loop's in-band tool error). Not shown end to end on staging: the model didn't produce a failing call, and an empty result is an answer, not an error.
Fixes this needed, all on main before it would run: the dashboard's SPA fallback panicked against its
/api/catch-all, which took staging down on that deploy; the runtime role was granted DML on tables but not on sequences, so the deliveries insert failed every run; and a run's NULL result or a step's NULL output couldn't be read, so the trail API answered 500 for exactly the runs that failed.Requirement 10 moved to #2012, with the gateway and daemon it depends on.
Found a real gap: ARCHITECTURE.md 2.5 carries the design, but this issue's requirements had no home in SPEC.md. Its 'Spec: R36' line predates R36 becoming the Prometheus lookup, so R36 no longer described the MCP server. SPEC.md now has R46 restating the seven requirements here (accepted by name, stdio or HTTP, confined with declared egress, per-server credentials, allow-listed tools declared as lookups or actions, readiness and restart, tools offered beside connector lookups), with R36 kept as the Prometheus lookup and this issue named as the detail. The parity ledger has a row for MCP servers as an accepted package.