mcp-alertmanager

jeanlopezxyz/mcp-alertmanager

3.2

If you are the rightful owner of mcp-alertmanager and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Alertmanager MCP Server is a Model Context Protocol server designed for seamless integration with Prometheus Alertmanager, providing efficient alert management and notification routing.

Tools
7
Resources
0
Prompts
0

Alertmanager MCP Server

License: MIT npm version Java GitHub release Docker

A Model Context Protocol (MCP) server for Prometheus Alertmanager integration.

Built with Quarkus MCP Server.

Transport Modes

ModeDescriptionUse Case
stdioStandard input/outputDefault for Claude Code, Claude Desktop, Cursor, VS Code
SSEServer-Sent Events over HTTPStandalone server, web integrations, multiple clients

Requirements

  • Java 21+ - Download
  • Prometheus Alertmanager - Running and accessible

Installation

Claude Code

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "alertmanager": {
      "command": "npx",
      "args": ["-y", "mcp-alertmanager@latest"],
      "env": {
        "ALERTMANAGER_URL": "http://localhost:9093"
      }
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "alertmanager": {
      "command": "npx",
      "args": ["-y", "mcp-alertmanager@latest"],
      "env": {
        "ALERTMANAGER_URL": "http://localhost:9093"
      }
    }
  }
}

Cursor / VS Code

Add to your MCP configuration:

{
  "mcpServers": {
    "alertmanager": {
      "command": "npx",
      "args": ["-y", "mcp-alertmanager@latest"],
      "env": {
        "ALERTMANAGER_URL": "http://localhost:9093"
      }
    }
  }
}

SSE Mode

Run as standalone server:

ALERTMANAGER_URL="http://localhost:9093" npx mcp-alertmanager --port 9082

Endpoint: http://localhost:9082/mcp/sse


Configuration

Command Line Options

OptionDescription
--port <PORT>Start in SSE mode on specified port
--helpShow help message
--versionShow version

Environment Variables

VariableDescriptionDefault
ALERTMANAGER_URLAlertmanager API URLhttp://localhost:9093

Tools

This server provides 7 tools organized in 3 categories:

Alerts

getAlerts

Get alerts from Alertmanager. Without filters, returns active/firing alerts.

ParameterTypeRequiredDescription
activebooleanNoShow active alerts (default if no filters)
silencedbooleanNoShow silenced alerts
inhibitedbooleanNoShow inhibited alerts
filterLabelstringNoFilter by label (e.g., severity=critical)

Examples:

  • Active alerts: getAlerts (no parameters)
  • Critical alerts: getAlerts filterLabel='severity=critical'
  • Silenced alerts: getAlerts silenced=true

getAlertGroups

Get alerts grouped by their routing labels. Shows how Alertmanager batches alerts for notifications.

Parameters: None

Returns: Alert groups with receiver and alert counts.


Silences

getSilences

Get silences from Alertmanager. Silences suppress notifications for matching alerts.

ParameterTypeRequiredDescription
statestringNoFilter: active, pending, or expired

Returns: List of silences with matchers, expiration, and creator.


createSilence

Create a silence to suppress notifications for an alert.

ParameterTypeRequiredDescription
alertNamestringYesAlert name to silence (exact match)
durationstringNoDuration: 30m, 2h, 1d (default: 2h)
commentstringNoReason for silencing
createdBystringNoYour name/identifier

Examples:

  • Silence for 2 hours: createSilence alertName='HighMemoryUsage'
  • Silence for maintenance: createSilence alertName='DiskSpaceLow' duration='1d' comment='Scheduled maintenance'

deleteSilence

Delete/expire a silence by ID. The alert will resume firing notifications if still active.

ParameterTypeRequiredDescription
silenceIdstringYesSilence ID to delete

Status

getAlertmanagerStatus

Get Alertmanager cluster status: version, uptime, cluster peers, and configuration.

Parameters: None


getReceivers

Get configured notification receivers (email, Slack, PagerDuty, webhooks).

Parameters: None


Example Prompts

Use natural language to interact with Alertmanager. Here are prompts organized by use case:

Checking Alerts

"What alerts are currently firing?"
"Show me all active alerts"
"Are there any critical severity alerts?"
"What alerts are firing in the production namespace?"
"Show alerts from the platform team"
"Do we have any high severity alerts right now?"
"What's currently broken in my infrastructure?"

Investigating Specific Issues

"Show me all alerts related to memory"
"Are there any disk space alerts?"
"What database alerts are firing?"
"Show alerts for the payment service"
"Are there any network-related alerts?"
"What Kubernetes pod alerts do we have?"

Managing Silences

"What silences are currently active?"
"Show me all silences"
"Who silenced the HighMemoryUsage alert?"
"Are there any expired silences?"
"Create a 2-hour silence for HighCPUUsage - scheduled maintenance"
"Silence the DiskSpaceLow alert for 4 hours, database cleanup in progress"
"Create a 30-minute silence for PodCrashLooping while I investigate"
"Delete silence abc-123-def-456"
"Remove the silence on HighMemoryUsage"

Understanding Alert Routing

"How are alerts grouped?"
"Show me alert groups"
"What receivers are configured?"
"Where do critical alerts get sent?"
"Show me all notification channels"
"Which Slack channels receive alerts?"

Status and Health

"Is Alertmanager running?"
"What version of Alertmanager are we using?"
"Show Alertmanager cluster status"
"Are all Alertmanager peers connected?"

Combined Workflows

"Show me critical alerts and then silence the noisy ones for 1 hour"
"What's firing? I need to understand the current incident"
"List all alerts, their silences, and the notification receivers"
"Give me a complete overview of our alerting status"

Development

Run in dev mode

export ALERTMANAGER_URL="http://localhost:9093"
./mvnw quarkus:dev

Build

./mvnw package -DskipTests

Test with MCP Inspector

# stdio mode
ALERTMANAGER_URL="http://localhost:9093" npx @modelcontextprotocol/inspector npx mcp-alertmanager

# SSE mode
ALERTMANAGER_URL="http://localhost:9093" npx mcp-alertmanager --port 9082
# Then connect inspector to http://localhost:9082/mcp/sse

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

- Free to use, modify, and distribute.