Skip to main content
Glama
mcp-platform-tools

mcp-platform-tools

by MuhFawad1

mcp-platform-tools: a governed, read-only MCP server for platform status

CI TypeScript Node.js 26 MCP License: MIT

A reference implementation of a Model Context Protocol server that platform teams can safely hand to AI agents. An SRE copilot or an incident bot can ask:

  • "is the llm-gateway canary healthy?"

  • "how much error budget is left?"

  • "what did the payments team spend on models this week?"

The agent gets an answer without ever touching kubectl, PromQL or credentials.

Four read-only tools sit on top of the platform built in the other repositories:

Tool

Reads

Scope

deployment_status

a Kubernetes Deployment: desired, ready, updated, available, conditions, images

platform:k8s.read

rollout_status

an Argo Rollouts canary from gitops-argocd-fleet: phase, step, stable and canary revisions, aborted

platform:k8s.read

slo_status

objective, error budget remaining, 1h and 6h burn rates, and firing alerts, from the rules generated by monitoring-observability-stack

platform:slo.read

gateway_spend

llm-gateway spend in USD and tokens per team and model over 1h, 24h, 7d or 30d

platform:finops.read

flowchart LR
    A[AI agent<br/>MCP client] -->|Streamable HTTP<br/>Bearer JWT, aud = this server| S[mcp-platform-tools]
    IdP[OAuth 2.1 / OIDC<br/>authorization server] -.->|access token with scopes| A
    S -.->|JWKS| IdP
    S --> G{governed: scope, allowlist,<br/>rate limit, timeout, cap, audit}
    G -->|get only, own service account| K[Kubernetes API]
    G -->|instant queries| P[Prometheus<br/>SLO rules + gateway metrics]
    G --> L[(audit log, JSON lines)]

Governance

Every call goes through the same wrapper (ADR 0001). A prompt-injected agent can at most read a summary it was already allowed to read.

  • Authentication. An OAuth 2.1 resource server. JWT access tokens must name this server as their audience (RFC 8707). Protected-resource metadata is published at /.well-known/oauth-protected-resource (RFC 9728). There is no token passthrough: backends are called with the server's own identity (ADR 0002).

  • Authorization. Each tool needs one scope. Namespaces, services and teams are allowlisted in the server's config.

  • Input. zod schemas: DNS-1123 names and a fixed set of time windows. PromQL is built only from values that passed both the schema and the allowlist.

  • Limits. A token-bucket rate limit per principal, a timeout on every backend call, a 16 KB result cap and a 64 KB request cap.

  • Output. Typed summaries, never raw API objects, so a Deployment's environment variables never leave the server. Backend errors reach the agent as a generic message.

  • Audit. One JSON line per call: principal, client, tool, arguments, decision, outcome, reason, duration, result size. Denials are logged too.

  • Transport. Stateless Streamable HTTP. Requests from browser origins outside allowedOrigins are refused, which protects against DNS rebinding (ADR 0004).

  • Kubernetes. get on deployments and rollouts, bound per allowlisted namespace. No list, no Secrets, nothing cluster-wide (ADR 0003, deploy/kubernetes).

Related MCP server: mcp-k8s-context-server

Verified against real systems

The end-to-end test calls the tools over HTTP with the MCP SDK client, against:

  • the llm-gateway image under traffic

  • Prometheus evaluating monitoring-observability-stack's generated SLO rules

  • a Kubernetes cluster

  • this repository's container image

It checks that every call is audited. A local run against the gitops fleet and the monitoring demo stack returned:

rollout_status     {"phase":"Healthy","step":5,"steps":5,"stableRevision":"6b7b985989","aborted":false}
slo_status         availability: objective 0.995, budget remaining -2.83, burn rate 1h 2.88,
                   firing: LlmGatewayAvailabilitySlowBurn (ticket)      <- the demo's deliberate 2% errors
gateway_spend      slo-demo: $0.0241 over 1h, 1389 input and 926 output tokens
deployment_status  kube-system/coredns -> "namespace "kube-system" is not in this server's allowlist"

Building the tests caught a real bug. llm-gateway labels token directions prompt/completion, not input/output (ADR 0005).

Run it

npm ci
npm test               # 28 unit tests
npm run coverage       # coverage gate: 85% lines, 75% branches
npm run build && MCP_CONFIG=config.json npm start

Configuration is one JSON file, validated at start-up by src/config.ts:

{
  "resource": "https://mcp.platform.example.com/mcp",
  "auth": {"issuer": "https://login.example.com/", "jwksUrl": "https://login.example.com/.well-known/jwks.json"},
  "allow": {"namespaces": ["llm-gateway"], "services": ["llm-gateway"], "teams": ["payments", "research"]},
  "prometheus": {"url": "http://kube-prometheus-stack-prometheus.monitoring.svc:9090"},
  "kubernetes": {"apiServer": "https://kubernetes.default.svc", "tokenFile": "/var/run/secrets/kubernetes.io/serviceaccount/token"}
}

Deploy with deploy/kubernetes/mcp-platform-tools.yaml, using the signed image ghcr.io/muhfawad1/mcp-platform-tools. Releases are multi-arch, keyless-signed with Sigstore, with an SBOM and provenance. The signature's identity, this repository's release.yml on a version tag, matches the gitops fleet's Kyverno signature policy.

What CI checks

Job

Checks

Test

ESLint (strict, type-checked), tsc strict, 28 tests with the coverage gate, build, npm audit

End to end

the container image against llm-gateway, Prometheus with the SLO rules, and a kind cluster; every call audited, a denial included

Image

Trivy finds no fixable HIGH or CRITICAL vulnerabilities in the image, and no misconfigurations in the Kubernetes manifests

Design decisions

ADR

Decision

0001

Governance lives in the server, not in the agent's prompt

0002

An OAuth 2.1 resource server, as the MCP authorization spec describes

0003

Least privilege at every backend

0004

Stateless Streamable HTTP, behind an Origin check

0005

Test against the real systems the tools read

Layout

src/
  auth.ts           JWT access-token verification, scopes
  governance.ts     scope check, rate limit, timeout, result cap, audit
  tools/            the four tools and their input schemas
  backends/         Prometheus and Kubernetes clients
  server.ts         MCP server with read-only tool annotations
  http.ts           protected-resource metadata, health, /mcp with bearer auth
test/               unit tests; e2e/ against real systems
deploy/kubernetes/  namespace, RBAC per namespace, config, Deployment, Service

Roadmap

  • Per-tool, per-principal allowlists from token claims (for example, a team claim that limits gateway_spend to the caller's own team).

  • OpenTelemetry spans per tool call, correlated with the audit log.

  • An agent-eval-harness suite where an agent uses these tools to triage an incident.

  • Argo Rollouts in the CI cluster, so rollout_status runs end to end.

  • A Helm chart and an ApplicationSet entry in gitops-argocd-fleet.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides a read-only interface to Kubernetes clusters, enabling LLMs to list pods, get pod status and logs, fetch deployment manifests, and perform pod health analysis with resource trend tracking.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Gives AI assistants read-only access to a Kubernetes cluster's observability stack — Loki, Prometheus, Tempo, the Kubernetes API — plus AWS telemetry from CloudTrail, Config, ECR, and RDS. 23 tools for querying logs, metrics, traces, Kubernetes events, deployments, and audit history in plain language.
      23
      Apache 2.0
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to query application projects directly for logs, metrics, incidents, and semantic search through read-only tools.
      17
      274 npm
      1
      MIT