KosmoKrator

analytics

Prometheus MCP Integration for OpenAI Agents SDK

Connect Prometheus to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

7 functions 7 read 0 write API token auth

Connect Prometheus to OpenAI Agents SDK

Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.

Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with --write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.

Prometheus MCP Config for OpenAI Agents SDK

Use headless JSON commands for CI-style execution and MCP for agent tool discovery.

{
  "mcpServers": {
    "kosmokrator-prometheus": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=prometheus",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=prometheus --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Prometheus instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Prometheus Tools Visible to OpenAI Agents

OpenAI Agents sees stable MCP tool names generated from the Prometheus integration catalog.

MCP toolSource functionTypeDescription
integration__prometheus__prometheus_list_alerts prometheus.prometheus_list_alerts Read List Prometheus alerts. Optionally filter by alert state or label selectors. Returns alert names, states, labels, and annotations.
integration__prometheus__prometheus_get_alert prometheus.prometheus_get_alert Read Get a Prometheus alert by name. Returns the full alert definition including labels, annotations, and state.
integration__prometheus__prometheus_list_rules prometheus.prometheus_list_rules Read List Prometheus alerting and recording rules. Optionally filter by type. Returns rule groups with their rules and states.
integration__prometheus__prometheus_get_rule prometheus.prometheus_get_rule Read Get a Prometheus rule group by name. Returns the full rule group definition including all rules within the group.
integration__prometheus__prometheus_list_targets prometheus.prometheus_list_targets Read List Prometheus scrape targets. Optionally filter by state (active or dropped). Returns target health status, labels, and scrape info.
integration__prometheus__prometheus_get_target prometheus.prometheus_get_target Read Get a Prometheus target by its instance address. Returns target health, last scrape info, and discovery labels.
integration__prometheus__prometheus_get_current_user prometheus.prometheus_get_current_user Read Get the current authenticated Prometheus user info. Useful for verifying authentication and retrieving user details.

Related Prometheus Pages