Labsco
idanfishman logo

Prometheus

β˜… 27

from idanfishman

Interact with your Prometheus monitoring infrastructure using natural language.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeNeeds API keys
<h1 align="center" style="border-bottom: none"> <img src="./assets/icon.png" alt="Prometheus MCP Logo"><br>Prometheus MCP Server </h1> <div align="center">

npm Docker codecov Node.js Version License: MIT

A Model Context Protocol (MCP) server that provides seamless integration between AI assistants and Prometheus, enabling natural language interactions with your monitoring infrastructure. This server allows for effortless querying, discovery, and analysis of metrics through Visual Studio Code, Cursor, Windsurf, Claude Desktop, and other MCP clients.

</div>

Key Features

  • Fast and lightweight. Direct API integration with Prometheus, no complex parsing needed.
  • LLM-friendly. Structured JSON responses optimized for AI assistant consumption.
  • Configurable capabilities. Enable/disable tool categories based on your security and operational requirements.
  • Dual transport support. Works with both stdio and HTTP transports for maximum compatibility.

Standalone MCP Server

When running in server environments or when you need HTTP transport, run the MCP server with the http command:

Copy & paste β€” that's it
npx prometheus-mcp@latest http --port 3000

And then in your MCP client config, set the url to the HTTP endpoint:

Copy & paste β€” that's it
{
  "mcpServers": {
    "prometheus": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:3000/mcp"]
    }
  }
}

Docker

Run the Prometheus MCP server using Docker:

Copy & paste β€” that's it
{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "--pull=always",
        "-e",
        "PROMETHEUS_URL=http://host.docker.internal:9090",
        "ghcr.io/idanfishman/prometheus-mcp",
        "stdio"
      ]
    }
  }
}

Tools

The Prometheus MCP server provides 10 tools organized into three configurable categories:

<details><summary><b>Discovery</b></summary>

Tools for exploring your Prometheus infrastructure:

  • prometheus_list_metrics

    • Description: List all available Prometheus metrics
    • Parameters: None
    • Read-only: true
  • prometheus_metric_metadata

    • Description: Get metadata for a specific Prometheus metric
    • Parameters:
      • metric (string): Metric name to get metadata for
    • Read-only: true
  • prometheus_list_labels

    • Description: List all available Prometheus labels
    • Parameters: None
    • Read-only: true
  • prometheus_label_values

    • Description: Get all values for a specific Prometheus label
    • Parameters:
      • label (string): Label name to get values for
    • Read-only: true
  • prometheus_list_targets

    • Description: List all Prometheus scrape targets
    • Parameters: None
    • Read-only: true
  • prometheus_scrape_pool_targets

    • Description: Get targets for a specific scrape pool
    • Parameters:
      • scrapePool (string): Scrape pool name
    • Read-only: true
</details> <details><summary><b>Info</b></summary>

Tools for accessing Prometheus server information:

  • prometheus_runtime_info

    • Description: Get Prometheus runtime information
    • Parameters: None
    • Read-only: true
  • prometheus_build_info

    • Description: Get Prometheus build information
    • Parameters: None
    • Read-only: true
</details> <details><summary><b>Query</b></summary>

Tools for executing Prometheus queries:

  • prometheus_query

    • Description: Execute an instant Prometheus query
    • Parameters:
      • query (string): Prometheus query expression
      • time (string, optional): Time parameter for the query (RFC3339 format)
    • Read-only: true
  • prometheus_query_range

    • Description: Execute a Prometheus range query
    • Parameters:
      • query (string): Prometheus query expression
      • start (string): Start timestamp (RFC3339 or unix timestamp)
      • end (string): End timestamp (RFC3339 or unix timestamp)
      • step (string): Query resolution step width
    • Read-only: true
</details>

Security Considerations

  • Network Access: The server requires network access to your Prometheus instance
  • Resource Usage: Range queries can be resource-intensive; monitor your Prometheus server load

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Built with ❀️ for the Prometheus and MCP communities