prometheus
A Model Context Protocol (MCP) server implementation that provides AI agents with programmatic access to Prometheus metrics via a unified interface.
claude mcp add --transport stdio idanfishman-prometheus-mcp npx prometheus-mcp@latest stdio \ --env PROMETHEUS_URL="http://localhost:9090"
How to use
Prometheus MCP Server provides a bridge between AI assistants and your Prometheus monitoring stack. It exposes a set of structured, AI-friendly tools that allow you to discover metrics, fetch metadata, inspect labels, and run PromQL queries, all through MCP clients like VS Code, Cursor, Windsurf, Claude Desktop, or other MCP-compatible interfaces. Tools are organized into three categories: Discovery (listing metrics, labels, targets and related metadata), Info (build/runtime information about the Prometheus server), and Query (executing instantaneous PromQL expressions). This structure is designed to be predictable for LLMs, returning JSON with clearly defined inputs and outputs to simplify integration into natural language workflows.
To use the server, connect via the stdio transport by default, or switch to HTTP transport if you need remote access. In many environments, you’ll configure the server to point at your Prometheus instance (PROMETHEUS_URL) and optionally disable specific tool categories via environment variables. Typical usage involves querying metrics, exploring available targets, and obtaining metric metadata to build dashboards or alerts with minimal Manual intervention.
How to install
Prerequisites:
- Node.js 20.19.0 or newer installed on the host system
- Access to a Prometheus server (URL reachable from the MCP host)
Installation steps:
- Install Node.js if you haven’t already (visit https://nodejs.org/).
- Install or run the MCP server package via npx as shown in the example configuration.
Usage example (local development):
- Ensure Prometheus is reachable at the URL you configure (default http://localhost:9090).
- Start using the MCP server via the stdio transport as described in the configuration:
# No separate install step required if using npx as shown; this runs on demand.
If you prefer deploying via Docker:
- Use the Docker command from the README to run the container and expose the PROMETHEUS_URL environment variable pointing to your Prometheus instance.
Additional notes
Tips and caveats:
- Ensure PROMETHEUS_URL is reachable from the machine running the MCP server; network firewalls may block access.
- You can disable discovery, info, or query tools by setting ENABLE_DISCOVERY_TOOLS, ENABLE_INFO_TOOLS, ENABLE_QUERY_TOOLS to false in the environment for tighter security.
- When using HTTP transport, you may run the server with the http command (npx prometheus-mcp@latest http --port 3000) and point clients to the generated HTTP endpoint.
- If you upgrade to a newer version of prometheus-mcp, remember to update the args in your mcp_config accordingly (e.g., bumping @latest).
- The Docker config provided in the README uses ghcr.io/idanfishman/prometheus-mcp as the image; ensure your host can pull from GHCR and adjust PROMETHEUS_URL as needed.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
tableau
Tableau's official MCP Server. Helping Agents see and understand data.
filesystem
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search/replace and directory tree traversal
any-script
An MCP server that exposes arbitrary CLI tools and shell scripts as MCP Tools
google -remote
Collection of Google-native tools (e.g., Gmail, Calendar) for the MCP
mcp-jira-stdio
MCP server for Jira integration with stdio transport. Issue management, project tracking, and workflow automation via Model Context Protocol.