burakdirin/mcp-opsgenie
If you are the rightful owner of mcp-opsgenie and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
OpsGenie MCP Server is a comprehensive Model Context Protocol server designed for OpsGenie incident management, providing tools, resources, and prompts for efficient alert management and incident response.
get-alert-details
Fetch comprehensive details for a specific alert.
get-alert-notes
Retrieve notes/comments for an alert.
search-alerts
Search alerts using OpsGenie query syntax.
get-alert-count
Get count of alerts matching criteria.
create-alert
Create a new alert.
OpsGenie MCP Server
A comprehensive Model Context Protocol (MCP) server for OpsGenie incident management. This server provides tools, resources, and prompts for managing alerts, conducting incident response, and performing post-incident analysis.
Features
🛠️ Tools
- Alert Management: Create, acknowledge, close, assign, and escalate alerts
- Note Management: Add and retrieve notes/comments on alerts
- Search & Discovery: Search alerts using OpsGenie query syntax
- Alert Actions: Snooze alerts, manage tags, and perform bulk operations
- Analytics: Get alert counts and statistics
📄 Resources
- Alert Details: Access comprehensive alert information as structured data
- Alert Notes: Retrieve all notes and comments for specific alerts
- Search Results: Get search results as structured JSON data
- Recent Alerts: Access recently updated alerts
💬 Prompts
- Incident Analysis: Structured prompts for analyzing alert severity and impact
- Incident Response: Step-by-step incident response workflows
- Alert Triage: Guidance for prioritizing and categorizing multiple alerts
- Post-Incident Review: Templates for comprehensive incident retrospectives
Installation
npm install mcp-opsgenie
Quick Start
1. Get Your OpsGenie API Key
- Log into your OpsGenie account
- Go to Settings → API key management
- Create a new API key with appropriate permissions
- Copy the API key
2. Configure Environment
export OPSGENIE_API_KEY="your-api-key-here"
3. Use with Claude Desktop
Add the server to your Claude Desktop configuration:
{
"mcpServers": {
"opsgenie": {
"command": "npx",
"args": ["mcp-opsgenie"],
"env": {
"OPSGENIE_API_KEY": "your-api-key-here"
}
}
}
}
4. Use with Other MCP Clients
# Run the server directly
npx mcp-opsgenie
# Or install globally
npm install -g mcp-opsgenie
mcp-opsgenie
Configuration
The server requires the following environment variables:
Variable | Required | Description |
---|---|---|
OPSGENIE_API_KEY | Yes | Your OpsGenie API key |
OPSGENIE_BASE_URL | No | OpsGenie API base URL (defaults to https://api.opsgenie.com) |
Available Tools
Alert Management
Tool | Description |
---|---|
get-alert-details | Fetch comprehensive details for a specific alert |
get-alert-notes | Retrieve notes/comments for an alert |
search-alerts | Search alerts using OpsGenie query syntax |
get-alert-count | Get count of alerts matching criteria |
create-alert | Create a new alert |
close-alert | Close an alert |
acknowledge-alert | Acknowledge an alert |
unacknowledge-alert | Remove acknowledgment from an alert |
assign-alert | Assign alert to a responder |
escalate-alert | Escalate alert to next level |
snooze-alert | Snooze alert until specified time |
add-note-to-alert | Add a note to an alert |
add-tags-to-alert | Add tags to an alert |
remove-tags-from-alert | Remove tags from an alert |
Example Tool Usage
// Search for critical alerts
await client.callTool({
name: "search-alerts",
arguments: {
query: "priority:P1 AND status:open",
limit: 10
}
});
// Create a new alert
await client.callTool({
name: "create-alert",
arguments: {
message: "Database connection timeout",
description: "Multiple connection timeouts detected on prod-db-01",
priority: "P2",
tags: ["database", "production", "timeout"],
entity: "prod-db-01"
}
});
// Acknowledge with a note
await client.callTool({
name: "acknowledge-alert",
arguments: {
identifier: "alert-id-12345",
note: "Investigating the issue, will update in 15 minutes"
}
});
Available Resources
Resource | URI Pattern | Description |
---|---|---|
Alert Details | opsgenie://alerts/{alertId} | Detailed alert information |
Alert Notes | opsgenie://alerts/{alertId}/notes | All notes for an alert |
Alert Search | opsgenie://search?query={query} | Search results |
Recent Alerts | opsgenie://alerts/recent | Recently updated alerts |
Example Resource Usage
// Read alert details
const alertData = await client.readResource({
uri: "opsgenie://alerts/12345-67890-abcdef"
});
// Search results as structured data
const searchResults = await client.readResource({
uri: "opsgenie://search?query=status:open AND priority:P1"
});
Available Prompts
Prompt | Description | Arguments |
---|---|---|
analyze-incident | Analyze alert severity and impact | alertId |
incident-response | Guide through incident response workflow | alertId , incidentType? |
triage-alerts | Help prioritize multiple alerts | query? |
post-incident-review | Structure post-incident analysis | alertId , resolutionSummary? |
Example Prompt Usage
// Get incident analysis prompt
const prompt = await client.getPrompt({
name: "analyze-incident",
arguments: {
alertId: "12345-67890-abcdef"
}
});
// Get triage guidance for open alerts
const triagePrompt = await client.getPrompt({
name: "triage-alerts",
arguments: {
query: "status:open"
}
});
Development
Setup
git clone https://github.com/burakdirin/mcp-opsgenie.git
cd mcp-opsgenie
npm install
Build
npm run build
Development Mode
npm run dev
Type Checking
npm run type-check
API Documentation
The server implements the full OpsGenie REST API v2 for alert management. Key endpoints include:
- GET
/v2/alerts/{id}
- Get alert details - POST
/v2/alerts
- Create alert - POST
/v2/alerts/{id}/close
- Close alert - POST
/v2/alerts/{id}/acknowledge
- Acknowledge alert - POST
/v2/alerts/{id}/notes
- Add note - GET
/v2/alerts/{id}/notes
- Get notes - GET
/v2/alerts
- Search alerts
See the OpsGenie API documentation for complete details.
Error Handling
The server implements comprehensive error handling:
- Authentication errors: Invalid API key or permissions
- Rate limiting: Automatic backoff and retry logic
- Network errors: Connection timeouts and retries
- Validation errors: Input validation with descriptive messages
Security
- API keys are passed via environment variables (never hardcoded)
- All requests use HTTPS
- Input validation using Zod schemas
- Proper error sanitization to prevent information leakage
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the file for details.
Support
Changelog
See for version history and updates.