Pulsetic MCP Server

官方

Pulsetic MCP服务器将Pulsetic监控与AI代理及MCP兼容工具连接,通过模型上下文协议(MCP)直接访问运行时间数据、定时监控结果、事件管理工作流和状态页面信息。它允许团队以结构化格式安全地暴露运维监控数据,无需自定义中间件即可轻松构建AI驱动的自动化、监控助手和智能运维工作流。

你可以用 Pulsetic MCP 做什么?

  • 检查监控器状态和运行时间 — 使用 list_monitors 查询所有监控器,或通过 get_monitor_stats 获取特定监控器的详细统计信息。
  • 调查停机事件 — 使用 get_monitor_events 获取在线/离线事件,或使用 get_monitor_downtime 获取总停机秒数。
  • 创建和管理监控器 — 使用 create_monitor 添加新的 HTTP、TCP 或 ICMP 监控器,通过 update_monitor 更新设置,或暂停/恢复检查。
  • 处理状态页面上的事件 — 使用 create_incidentupdate_incidentresolve_incident 管理事件生命周期并发布状态更新。
  • 安排维护窗口 — 使用 create_maintenance 创建即将到来的维护时段,或使用 delete_maintenance 删除它们。

文档

Pulsetic MCP 服务器

使用模型上下文协议 (MCP) 将 AI 助手连接到您的 Pulsetic 监控平台。


什么是 MCP?

模型上下文协议是一个开放标准,允许 AI 助手与外部工具和服务进行交互。借助 Pulsetic 的 MCP 服务器,您可以让 AI 助手检查监控状态、创建事件、安排维护等——所有这些都可以通过自然对话完成。

支持的客户端:


前提条件

  • 一个具有 API 访问权限 的 Pulsetic 账户(Business 或 Enterprise 计划)。
  • 一个 Pulsetic API 密钥 — 在仪表板的 设置 → API 中生成。
  • 一个兼容 MCP 的 AI 客户端。

设置

Claude Desktop

Claude Desktop 使用基于 stdio 的 MCP 服务器。使用 mcp-remote 来桥接远程 HTTP 端点。打开 设置 → 开发者 → 编辑配置 并添加:

{
  "mcpServers": {
    "pulsetic": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://api.pulsetic.com/mcp",
        "--header", "Authorization: Bearer YOUR_API_KEY"
      ]
    }
  }
}

YOUR_API_KEY 替换为您的实际 API 密钥。重启 Claude Desktop 以应用更改。

Claude Code

将服务器添加到您项目的 .mcp.json 文件中:

{
  "mcpServers": {
    "pulsetic": {
      "type": "streamableHttp",
      "url": "https://api.pulsetic.com/mcp",
      "headers": {
        "Authorization": "YOUR_API_KEY"
      }
    }
  }
}

Cursor

打开 设置 → MCP 服务器 → 添加服务器 并进行配置:

  • 类型: streamableHttp
  • URL: https://api.pulsetic.com/mcp
  • 标头: Authorization: YOUR_API_KEY

ChatGPT

ChatGPT 通过 开发者模式 原生支持 MCP。它使用 OAuth 与 Pulsetic 进行身份验证。

步骤 1. 在 ChatGPT 中启用开发者模式:前往 已启用的应用 → 高级设置 → 开发者模式 并将其打开。此功能适用于 ChatGPT Pro、Plus、Team、Business、Enterprise 和 Edu 用户。

步骤 2. 创建一个新应用:前往 已启用的应用 → 创建应用

步骤 3. 填写应用详情:

字段
名称Pulsetic MCP(或您喜欢的任何名称)
描述Uptime monitoring(可选)
MCP 服务器 URLhttps://api.pulsetic.com/mcp
身份验证OAuth

步骤 4. OAuth 端点将从服务器自动发现。您可以在 高级设置 下验证它们:

字段
授权 URLhttps://api.pulsetic.com/mcp/oauth/authorize
令牌 URLhttps://api.pulsetic.com/mcp/oauth/token
注册 URLhttps://api.pulsetic.com/mcp/oauth/register

步骤 5. 勾选 “我理解并希望继续”,然后点击 创建

步骤 6. 完成 OAuth 登录流程。您将被重定向到 Pulsetic 授权页面,在那里输入您的账户邮箱和 API 令牌。

邮箱必须与您的 API 令牌匹配。 在授权页面上,您输入的邮箱必须与您提供的 API 令牌的所有者匹配。

请妥善保管您的 API 密钥。 您的 API 密钥拥有对 Pulsetic 账户的完全访问权限。切勿将其提交到版本控制或公开分享。


可用工具

MCP 服务器提供了 17 个工具,分为四个类别。

监控器

工具描述
list_monitors列出所有监控器,包括状态、正常运行时间和响应时间。
get_monitor获取特定监控器的详细信息。
get_monitor_stats1 天/7 天/30 天/90 天的正常运行时间百分比、停机时间和响应时间。
get_monitor_events日期范围内的在线/离线事件。
get_monitor_downtime给定时间段内的总停机时间(秒)。
create_monitor创建一个新的 HTTP、TCP 或 ICMP 监控器。
update_monitor更新监控器的名称、URL、频率或设置。
delete_monitor永久删除一个监控器。
pause_monitor暂停监控(停止检查)。
resume_monitor恢复已暂停的监控器。

状态页面

工具描述
list_status_pages列出所有状态页面,包括标题、slug 和域名。

事件

工具描述
list_incidents列出状态页面的事件。
create_incident创建一个新事件并附带初始状态更新。
update_incident向现有事件发布状态更新。
resolve_incident将事件标记为已解决。

维护

工具描述
create_maintenance在状态页面上安排一个维护窗口。
delete_maintenance删除已安排的维护窗口。

使用示例

配置完成后,您可以通过自然语言与 Pulsetic 进行交互。

检查您的监控器

"Show me all my monitors and their current status."

"What's the uptime for my production API monitor over the last 30 days?"

"Are any of my monitors currently down?"

"Show me the downtime events for monitor 42 in the past week."

管理监控器

"Create a new monitor for https://api.example.com that checks every 30 seconds."

"Pause the staging monitor while we do the migration."

"Resume all paused monitors."

"Change the check frequency of monitor 15 to 60 seconds."

"Delete the old marketing-site monitor."

处理事件

"Create an incident on our main status page: 'Elevated API latency'
 with status investigating and message 'We're looking into slow response times.'"

"Update the API latency incident to identified: 'Root cause is a database
 connection pool issue. Working on a fix.'"

"Resolve incident 8 with message 'Connection pool limits increased.
 Response times back to normal.'"

安排维护

"Schedule a maintenance window on status page 1 called 'Database upgrade'
 starting 2025-03-20 at 2am UTC and ending at 4am UTC."

"Delete the maintenance window we scheduled for next week."

使用 cURL 进行测试

您可以直接使用 cURL 测试 MCP 端点,以验证您的 API 密钥是否有效。

初始化

curl -X POST https://api.pulsetic.com/mcp \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {"name": "curl", "version": "1.0"}
    }
  }'

列出工具

curl -X POST https://api.pulsetic.com/mcp \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

调用工具

curl -X POST https://api.pulsetic.com/mcp \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "list_monitors",
      "arguments": {}
    }
  }'

工具参考

list_monitors

返回您账户的所有监控器。

无参数。


get_monitor

返回单个监控器的完整详细信息,包括 SSL 证书信息。

参数类型必需描述
monitor_id整数监控器 ID。

get_monitor_stats

返回 1 天、7 天、30 天和 90 天期间的正常运行时间百分比、停机时间、事件计数和平均响应时间。

参数类型必需描述
monitor_id整数监控器 ID。

get_monitor_events

返回日期范围内的在线/离线事件(最多 100 条,最新的在前)。

参数类型必需描述
monitor_id整数监控器 ID。
from字符串开始日期 (YYYY-MM-DD)。默认:7 天前。
to字符串结束日期 (YYYY-MM-DD)。默认:今天。

get_monitor_downtime

返回某个时间段内的总停机时间(秒)和事件计数。

参数类型必需描述
monitor_id整数监控器 ID。
days整数回溯的天数。默认:30。

create_monitor

创建一个新的正常运行时间监控器。

参数类型必需描述
url字符串要监控的 URL 或主机名。
name字符串显示名称。
request_type字符串httptcpicmp。默认:http
uptime_check_frequency整数检查间隔(秒)。默认:60。
request_method字符串HTTP 方法。默认:GET。
request_timeout整数超时时间(秒)。默认:30。
ssl_check布尔值启用 SSL 监控。

update_monitor

更新现有监控器的设置。仅包含您想要更改的字段。

参数类型必需描述
monitor_id整数监控器 ID。
name字符串新的显示名称。
url字符串新的 URL 或主机名。
uptime_check_frequency整数新的检查间隔(秒)。
request_method字符串HTTP 方法。
request_timeout整数超时时间(秒)。
ssl_check布尔值启用/禁用 SSL 监控。

delete_monitor

永久删除一个监控器及其所有相关数据。

参数类型必需描述
monitor_id整数监控器 ID。

pause_monitor

暂停一个监控器。在恢复之前,它将停止被检查。

参数类型必需描述
monitor_id整数监控器 ID。

resume_monitor

恢复一个已暂停的监控器。

参数类型必需描述
monitor_id整数监控器 ID。

list_status_pages

返回您账户的所有状态页面。

无参数。


list_incidents

返回状态页面的事件,包括每个事件的最新更新。

参数类型必需描述
status_page_id整数状态页面 ID。

create_incident

创建一个新事件,并附带一个显示在状态页面上的初始状态更新。

参数类型必需描述
status_page_id整数状态页面 ID。
title字符串事件标题。
status字符串investigatingidentifiedmonitoringresolved
message字符串初始更新消息。

update_incident

向现有事件发布新的状态更新。

参数类型必需描述
incident_id整数事件 ID。
status字符串investigatingidentifiedmonitoringresolved
message字符串更新消息。
title字符串更新事件标题。

resolve_incident

将事件标记为已解决,并附带解决消息。

参数类型必需描述
incident_id整数事件 ID。
message字符串解决消息。

create_maintenance

在状态页面上安排一个维护窗口。

参数类型必需描述
status_page_id整数状态页面 ID。
name字符串维护标题。
description字符串维护描述。
start字符串开始时间,ISO 8601 格式。
end字符串结束时间,ISO 8601 格式。
timezone字符串时区(例如,UTCAmerica/New_York)。默认:UTC

delete_maintenance

删除已安排的维护窗口。

参数类型必需描述
maintenance_id整数维护窗口 ID。

故障排除

401 未授权

  • 验证您的 API 密钥是否正确且未过期。
  • 确保您在 Authorization 标头中传递了密钥(可以是原始令牌,也可以带有 Bearer 前缀)。
  • 确认您的账户使用的是启用了 API 访问权限的计划。

OAuth 授权失败 (ChatGPT)

  • 在授权页面上,您输入的 邮箱 必须与 API 令牌的所有者匹配。
  • 确保在您的 ChatGPT 设置中启用了开发者模式。
  • 确保您拥有支持开发者模式的 ChatGPT 计划(Pro、Plus、Team、Business、Enterprise 或 Edu)。

“监控器未找到或访问被拒绝”

  • 监控器 ID 不存在或属于其他账户。
  • 使用 list_monitors 查看您可用的监控器 ID。

工具未在您的 AI 客户端中显示

  • 在编辑 MCP 配置后重启 AI 客户端。
  • 检查 URL 是否完全为 https://api.pulsetic.com/mcp
  • 使用 cURL 测试端点以验证连接性。

遇到协议错误

  • 确保请求使用 Content-Type: application/json
  • jsonrpc 字段必须完全为 "2.0"
  • 对于除通知之外的所有请求,请包含一个 id 字段(整数或字符串)。

API 参考

该 MCP 服务器通过单一 POST /mcp 端点,使用 JSON-RPC 2.0 的 Streamable HTTP 传输方式,实现了 MCP 规范(2025-03-26)