This MCP server provides a bridge between Claude and your Prometheus monitoring system through the Model Context Protocol. It allows Claude to access and analyze metrics from your Prometheus instance, enabling natural language interactions with your monitoring data.
To use the MCP Prometheus server with Claude Desktop, you'll need to add the server configuration to your Claude Desktop config file.
Add the server configuration to your Claude Desktop config file:
On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Edit the configuration file to include:
{
"mcpServers": {
"mcp-server-prometheus": {
"command": "/path/to/mcp-server-prometheus/build/index.js",
"env": {
"PROMETHEUS_URL": "http://your-prometheus-instance:9090"
}
}
}
}
Configure the server with these environment variables:
Required:
PROMETHEUS_URL
: The base URL of your Prometheus instanceOptional (for authenticated Prometheus instances):
PROMETHEUS_USERNAME
: Username for basic authPROMETHEUS_PASSWORD
: Password for basic authOnce configured, Claude can interact with your Prometheus metrics through natural language.
The MCP server provides access to:
You can ask Claude questions about your Prometheus metrics such as:
If you encounter issues, you can use the MCP Inspector for debugging:
npm run inspector
This will provide a URL to access debugging tools in your browser, which is helpful since MCP servers communicate over stdio.
The server exposes Prometheus metrics through the following URI structure:
http://your-prometheus-instance:9090
http://your-prometheus-instance:9090/metrics/{metric_name}
Each metric resource returns structured JSON data containing the metric's name, metadata, and current statistics.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.