Skip to main content
Glama

Prometheus MCP Server

by yanmxa

Prometheus MCP Server

A Model Context Protocol (MCP) server that provides seamless integration with Prometheus, enabling AI assistants to query metrics, discover available data, and analyze system performance through natural language interactions.

Features

  • Real-time Metrics Access - Query current and historical metrics data
  • Metrics Discovery - Find available metrics and monitoring targets
  • Multiple Auth Methods - Basic auth, bearer tokens, and TLS support
  • Type-safe - Full TypeScript implementation

MCP Configuration

Add to your MCP client settings:

{ "mcpServers": { "prometheus": { "command": "npx", "args": ["prometheus-mcp-server"], "env": { "PROMETHEUS_URL": "http://localhost:9090" } } } }

Using global installation

First install the package globally:

npm install -g prometheus-mcp-server

Then configure your MCP client:

{ "mcpServers": { "prometheus": { "command": "prometheus-mcp-server", "env": { "PROMETHEUS_URL": "http://localhost:9090" } } } }

Environment Variables

# Required PROMETHEUS_URL=http://localhost:9090 # Optional Authentication PROMETHEUS_USERNAME=admin PROMETHEUS_PASSWORD=password PROMETHEUS_TOKEN=bearer-token # Optional Connection PROMETHEUS_TIMEOUT=10000 PROMETHEUS_INSECURE=false

Available Tools

ToolDescriptionUse Case
prom_queryExecute PromQL instant queryGet current metric values, alerts status
prom_rangeExecute PromQL range queryAnalyze trends, create graphs, historical data
prom_discoverDiscover available metricsExplore what metrics are available in your system
prom_metadataGet metric metadataUnderstand metric types, descriptions, and units
prom_targetsGet scrape targets infoMonitor scraping health and service discovery

Example Usage

Ask your AI assistant natural language questions:

  • "What's the current CPU usage across all servers?"
  • "Show me HTTP request rates for the last 6 hours"
  • "Which services have the highest memory consumption?"
  • "Are there any failing health checks?"
  • "What metrics are available for monitoring my database?"

Development

# Run with inspector npm run inspector # Run directly npm run dev

Connection Methods

1. No Authentication

export PROMETHEUS_URL=http://localhost:9090

2. Basic Authentication

export PROMETHEUS_URL=http://localhost:9090 export PROMETHEUS_USERNAME=admin export PROMETHEUS_PASSWORD=secret

3. Bearer Token

export PROMETHEUS_URL=https://prometheus.example.com:9090 export PROMETHEUS_TOKEN=your-bearer-token

Additional Options

For self-signed certificates or development:

export PROMETHEUS_INSECURE=true

License

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Model Context Protocol server that enables AI assistants to query Prometheus metrics, discover available data, and analyze system performance through natural language interactions.

  1. Features
    1. MCP Configuration
      1. Using npx (Recommended)
      2. Using global installation
    2. Environment Variables
      1. Available Tools
        1. Example Usage
          1. Development
            1. Connection Methods
              1. 1. No Authentication
              2. 2. Basic Authentication
              3. 3. Bearer Token
              4. Additional Options
            2. License

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
                Last updated -
                14
                Python
                • Apple
                • Linux
              • A
                security
                A
                license
                A
                quality
                Provides access to Prometheus metrics and queries through standardized Model Context Protocol interfaces, allowing AI assistants to execute PromQL queries and analyze metrics data.
                Last updated -
                5
                165
                Python
                MIT License
                • Linux
                • Apple
              • -
                security
                F
                license
                -
                quality
                A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
                Last updated -
                3
                1
                TypeScript
              • -
                security
                F
                license
                -
                quality
                A tool that enables access to Prometheus metrics data through a Model Context Protocol server, allowing interaction with monitoring data using natural language.
                Last updated -
                Python

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/yanmxa/prometheus-mcp-server'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server