opsgenie-mcp
opsgenie-mcp
面向 Opsgenie(Atlassian 的事件/告警管理与值班平台)的 MCP 服务器——将完整的 Opsgenie 公共 REST API 暴露为 MCP 工具。
⚠️ 供应商说明:Atlassian 已宣布 Opsgenie 即将停止支持,并建议迁移到 Jira Service Management 或 Compass。本文档所述的公共 API(
docs.opsgenie.com)在当前构建中仍然可用且未发生变化,但预计最终会被弃用。
概述
无状态 HTTP 服务。任何凭据都不会被持久化——每个请求通过请求头提供自己的 API 密钥,仅在该单个请求的生命周期内使用。
支持并发请求;每个请求的凭据隔离通过 Python
contextvars实现,而非全局/共享客户端实例。入口点:
POST /mcp(MCP 协议)和GET /health(健康检查)。默认端口:
8080(可通过MCP_HTTP_PORT配置)。
Related MCP server: MCP Setup Server
范围
22 个工具,从最初 213 个工具的完整 API 构建(2026-08-04)中精简而来,全部位于单一的 alert 类别中。MSPbots 为该供应商存储的集成配置恰好调用 1 个端点(GET /v2/alerts,只读,→ opsgenie_alert_list_alerts)。根据“实际使用 + 同类核心 CRUD”的范围决策,所有其他类别(Incident、Incident Timeline、Integration、Heartbeat、Alert & Notification Policy、Policy (legacy v1)、Maintenance、Account、User、Custom User Role、Contact、Notification Rule (+ Step)、Team (+ Member/Role/Routing Rule)、Schedule (+ Rotation/Override)、Escalation、Who Is On Call、Forwarding Rule、Service (+ Incident Rules/Templates)、Incident Templates——共 27 个类别,约 178 个工具)被完全移除,因为 MSPbots 不涉及其中任何一个;在 alert 类别本身中,35 个原始工具被削减为 22 个核心告警生命周期操作(list/get/create/close/delete/acknowledge/unacknowledge/note/tags/assign/responder/team/escalate/snooze/update message-description-priority/count/logs/request-status)——被移除的是 saved-search 子功能(5 个工具)、attachment 子功能(4 个工具)、custom-properties 添加/移除(2 个工具)、execute_custom_action(1 个)和 list_alert_recipients(1 个),这些都不是核心告警 CRUD。
保留工具的数据最初通过抓取 docs.opsgenie.com/docs/alert-api 获取,并将每个文档化操作(方法、路径、路径/查询参数、JSON 请求体字段)结构化为机器可读格式——与本项目中其他大型 API 供应商(ConnectSecure、Dynu、Jira Data Center)使用的“从结构化规范生成代码”方法相同,此处采用该方法是因为 Opsgenie 没有可下载的 OpenAPI/Postman 规范,只有文字文档。如果日后需要某个被移除的类别,可以用相同方式重新解析相同的源页面(docs.opsgenie.com/docs/*-api)。
身份验证
Opsgenie 使用绑定到特定 Opsgenie 集成的静态 API 密钥(在 Opsgenie 的 Settings → Integrations → API 中创建)。MSPbots 自身的集成约定以 Authorization: GenieKey <apiKey> 的形式发送此密钥,与 Opsgenie 官方文档格式一致,本服务器也以完全相同的方式转发。
HEADER 授权参数说明
Header | 类型 | 是否必填 | 默认值 | 枚举值 | 字段描述 | Example |
| string | 是 | 无 | 无 | Opsgenie 集成 API Key,原样转发为上游 |
|
| string | 否 |
| 无 | Opsgenie API 基础 URL;EU 实例客户需传 |
|
缺少必需请求头时返回 401:
{
"error": "Missing credentials",
"message": "This server requires the X-Opsgenie-Api-Key header",
"required_headers": ["X-Opsgenie-Api-Key"],
"optional_headers": ["X-Opsgenie-Base-Url"]
}环境变量
Variable | 类型 | 是否必填 | 默认值 | 说明 |
| int | 否 |
| HTTP 监听端口 |
| string | 否 |
| HTTP 监听地址 |
| string | 否 |
| 默认 Opsgenie API 基础 URL(可被请求头 |
MCP 端点
POST /mcp— MCP 协议(可流式 HTTP 传输)GET /health— 健康检查,返回{"status": "ok"}(纯本地存活探针,不调用 Opsgenie)
工具列表
工具名称格式为 opsgenie_<category>_<operation>,源自官方文档中每个操作的标题(例如 alert 类别中的 "List Alerts" → opsgenie_alert_list_alerts)。body 参数以通用 dict 形式接受——每个工具的确切字段列表记录在该工具自身的 docstring 中(从源文档提取),完整字段模式可在 Opsgenie 自己的 API 参考中查看(链接如下)。
类别 | 工具 | 描述 | 方法 + 路径 | 参数 |
alert |
| 确认警报。 | POST /v2/alerts/:identifier/acknowledge | identifier(required), body(required), identifier_type(optional) |
alert |
| 向警报添加备注。 | POST /v2/alerts/:identifier/notes | identifier(required), body(required), identifier_type(optional) |
alert |
| 向警报添加响应者。 | POST /v2/alerts/:identifier/responders | identifier(required), body(required), identifier_type(optional) |
alert |
| 向警报添加标签。 | POST /v2/alerts/:identifier/tags | identifier(required), body(required), identifier_type(optional) |
alert |
| 向警报添加团队。 | POST /v2/alerts/:identifier/teams | identifier(required), body(required), identifier_type(optional) |
alert |
| 分配警报。 | POST /v2/alerts/:identifier/assign | identifier(required), body(required), identifier_type(optional) |
alert |
| 关闭警报。 | POST /v2/alerts/:identifier/close | identifier(required), body(required), identifier_type(optional) |
alert |
| 统计警报数量。 | GET /v2/alerts/count | query(optional), search_identifier(optional), search_identifier_type(optional) |
alert |
| 创建警报。 | POST /v2/alerts | body(required) |
alert |
| 删除警报。 | DELETE /v2/alerts/:identifier | identifier(required), identifier_type(optional), user(optional), source(optional) |
alert |
| 将警报升级到下一级。 | POST /v2/alerts/:identifier/escalate | identifier(required), body(required), identifier_type(optional) |
alert |
| 获取警报。 | GET /v2/alerts/:identifier | identifier(required), identifier_type(optional) |
alert |
| 获取请求状态。 | GET /v2/alerts/requests/:requestId | request_id(required) |
alert |
| 列出警报日志。 | GET /v2/alerts/:identifier/logs | identifier(required), identifier_type(optional), offset(optional), direction(optional), limit(optional), order(optional) |
alert |
| 列出警报备注。 | GET /v2/alerts/:identifier/notes | identifier(required), identifier_type(optional), offset(optional), direction(optional), limit(optional), order(optional) |
alert |
| 列出警报。 | GET /v2/alerts | query(optional), search_identifier(optional), search_identifier_type(optional), offset(optional), limit(optional), sort(optional), order(optional) |
alert |
| 从警报中移除标签。 | DELETE /v2/alerts/:identifier/tags | identifier(required), tags(required), identifier_type(optional), user(optional), source(optional), note(optional) |
alert |
| 暂停警报。 | POST /v2/alerts/:identifier/snooze | identifier(required), body(required), identifier_type(optional) |
alert |
| 取消确认警报。 | POST /v2/alerts/:identifier/unacknowledge | identifier(required), body(required), identifier_type(optional) |
alert |
| 更新警报描述。 | POST /v2/alerts/:identifier/description | identifier(required), body(required), identifier_type(optional) |
alert |
| 更新警报消息。 | POST /v2/alerts/:identifier/message | identifier(required), body(required), identifier_type(optional) |
alert |
| 更新警报优先级。 | PUT /v2/alerts/:identifier/priority | identifier(required), body(required), identifier_type(optional) |
测试示例
# Health check
curl -s http://localhost:8080/health
# Call a tool via the MCP protocol (streamable HTTP) — requires an
# initialize handshake first per the MCP spec; abbreviated example below
# shows the tool-call request body only:
curl -s -X POST http://localhost:8080/mcp \
-H "X-Opsgenie-Api-Key: <your-opsgenie-api-key>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id-from-initialize>" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "opsgenie_alert_list_alerts",
"arguments": {"limit": 5}
}
}'实时验证(2026-07-30):opsgenie_alert_list_alerts(MSPbots 自身调用的同一端点)通过此运行中的服务器使用真实测试 API 密钥进行了端到端调用,并从账户中返回了真实的警报数据(消息、状态、优先级、响应者、集成等)。另外两个不同类别的工具(opsgenie_team_list_teams、opsgenie_account_get_account_info)也使用同一密钥进行了调用,并正确返回了 Opsgenie 自身的 403 API Key is not granted with configuration access —— 这证实了请求/认证头管道在 alert 类别之外也能正常工作;这个特定的测试密钥仅被限定为警报级访问权限(这是 Opsgenie 集成密钥的正常限制,而非缺陷)。
API 参考
各类别的文档可从侧边栏链接访问:https://docs.opsgenie.com/docs/alert-api
已知差距
2026-08-04 从 213 个工具缩减至 22 个。 根据早先的范围决策,原始构建覆盖了 28 个类别的完整公共 API。后来的范围决策将其缩减为 MSPbots 实际使用的类别(
alert)及其核心 CRUD 操作——有关alert内具体保留/删除的内容以及 27 个被移除类别的完整列表(约 178 个工具),请参阅上文的范围部分。如果日后需要某个被移除的类别,可以按照生成保留工具的方式重新解析相同的docs.opsgenie.com/docs/*-api页面。若干保留的工具仍会修改真实的 Opsgenie 警报状态(
opsgenie_alert_delete_alert、opsgenie_alert_close_alert、opsgenie_alert_create_alert等)——请将这些工具视为不可逆/会改变状态的操作,并在调用前与人工确认。body参数未做类型化(dict),而非完整建模——每个工具的 docstring 列出了从 Opsgenie 文档中提取的字段名,但对于机械生成的服务器而言,将所有字段重现为类型化的 Python 参数超出了范围。源数据提取自散文式文档,而非机器规范——Opsgenie 没有可下载的 OpenAPI/Postman 集合,因此每个操作的方法/路径/参数都是从
docs.opsgenie.com的 HTML 中解析出来的。只有
opsgenie_alert_list_alerts(MSPbots 自身的端点)通过返回真实数据进行了实时验证。其余 21 个工具在结构上是正确的(模式已验证、MCP 协议tools/list已确认、全部通过compile()),但未逐一进行冒烟测试——其中若干是写入/破坏性操作,会创建、修改或关闭真实警报,因此未在实时测试账户上执行。供应商即将停止支持(请参阅本 README 顶部的警告横幅)——Atlassian 建议迁移到 Jira Service Management 或 Compass。此 MCP 针对的是本次构建时仍处于活跃状态的 Opsgenie 公共 API。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
A basic MCP server to operate on the Postman API.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for the Splunk On-Call (VictorOps) API providing comprehensive incident management, on-call schedules, team administration, and alert reporting through natural language.MIT
- FlicenseNot gradedqualityCmaintenanceA modular MCP server exposing tools for integrating with services like GitHub, Redash, Jenkins, Figma, Jira, Confluence, Teams, Datadog, PagerDuty, Slack, and Presto, enabling users to manage these platforms through natural language via an MCP client.-
- AlicenseBqualityCmaintenanceMCP server for the Level v2 REST API, enabling management of alerts, automations, devices, groups, tags, updates, and custom fields through typed tools.35MIT
- AlicenseNot gradedqualityCmaintenanceJira Cloud MCP server providing Jira-first tools for common workflows and full REST API coverage through a generic request tool.493MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/MSPbotsAI/opsgenie-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server