Pulsetic MCP Server

官方

Pulsetic MCP Server 將 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 帳戶(商務版或企業版)。
  • 一個 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 伺服器採用 MCP 規範 (2025-03-26),透過單一 POST /mcp 端點並搭配 JSON-RPC 2.0 的 Streamable HTTP 傳輸來實作。