saas-alerts-mcp

saas-alerts-mcp

MCP server for Kaseya SaaS Alerts, providing 30 tools to manage security events, customers, users, devices, billing, and reports via the SaaS Alerts API.

Category
访问服务器

README

saas-alerts-mcp

A fully self-contained Model Context Protocol server for Kaseya SaaS Alerts — the SaaS security monitoring platform for Microsoft 365 and Google Workspace events.

It wraps the SaaS Alerts External Partner API (Reports) v0.20.0 and exposes it as 30 MCP tools plus 3 workflow prompts. The API client is vendored in-tree (src/sdk), so the server builds and runs with a single public dependency (@modelcontextprotocol/sdk) — no private packages, no external SDK to install.

Features

Domain Tools
events Query/count security events by severity, customer, user, event type; advanced Elasticsearch queries; scroll pagination; recommended actions
customers List, get, create, update, delete customers; set IP/country and account whitelists
users MSP user info, partner users, customer users
devices Unify mapped/unmapped/ignored devices, device organizations
billing Billing details by date, billing date history
reports List/get/create/delete scheduled reports
partner Partner profile, branding settings
  • Two navigation helperssaas_alerts_navigate (browse a domain's tools) and saas_alerts_status (connectivity check against the authenticated MSP user).
  • Three promptsalert-triage, customer-alert-summary, cross-tenant-anomaly.
  • Write/destructive guards — mutating tools carry annotations.destructiveHint and, where irreversible, a ⚠ DESTRUCTIVE description prefix. They request confirmation via MCP elicitation and fail open (proceed) if the client doesn't support it.
  • Empty-result guard — list tools return isError with a clear "No … found" message instead of an empty payload, to stop the model hallucinating results.

Authentication

SaaS Alerts authenticates with an API key sent as the api_key HTTP header (not Authorization: Bearer). Generate one in the SaaS Alerts UI under Settings → API Keys.

Set it via the SAAS_ALERTS_API_KEY environment variable.

Quick start

npm install      # also builds via the `prepare` script
npm run build    # or build explicitly
export SAAS_ALERTS_API_KEY=your-api-key
node dist/index.js          # stdio transport

Importing into Hermes (or any MCP host)

The server speaks standard MCP over stdio, so it drops into any MCP host that uses the common mcpServers config block. Build it once (npm run build), then point your host at dist/index.js.

Copy .mcp.json.example into your host's MCP config and edit the path + key:

{
  "mcpServers": {
    "saas-alerts": {
      "command": "node",
      "args": ["/absolute/path/to/saas-alerts-mcp/dist/index.js"],
      "env": {
        "SAAS_ALERTS_API_KEY": "your-saas-alerts-api-key",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

After import, the host will discover all 30 saas_alerts_* tools. Call saas_alerts_status first to confirm the key is valid and connectivity is up.

Tip: if your Hermes deployment prefers a network endpoint over a spawned process, run the server in HTTP mode (below) and register the http://host:8080/mcp URL instead.

HTTP mode

export SAAS_ALERTS_API_KEY=your-api-key
export MCP_TRANSPORT=http
export MCP_HTTP_PORT=8080
node dist/http.js
  • POST /mcp — MCP endpoint (stateless streamable-HTTP, JSON responses).
  • GET /health — liveness probe (does not require credentials).

Gateway mode (multi-tenant)

Set AUTH_MODE=gateway. The server then reads the per-request API key from the X-SaaS-Alerts-API-Key header instead of the environment, and isolates each request's credentials in an AsyncLocalStorage context. The HTTP transport is intentionally kept stateless to preserve that per-request tenant isolation.

Running with Docker

export SAAS_ALERTS_API_KEY=your-api-key
docker compose up --build

The container runs HTTP mode on port 8080 with a /health healthcheck, as a non-root user.

Configuration

Variable Default Description
SAAS_ALERTS_API_KEY Required (env/stdio mode). Sent as the api_key header.
MCP_TRANSPORT stdio stdio or http.
MCP_HTTP_PORT 8080 HTTP mode listen port.
MCP_HTTP_HOST 0.0.0.0 HTTP mode bind host.
AUTH_MODE env env reads the key locally; gateway reads X-SaaS-Alerts-API-Key per request.
LOG_LEVEL info debug | info | warn | error (logs go to stderr).

Development

npm install
npm run build              # bundle to dist/ (ESM, with .d.ts)
npm test                   # vitest — SDK transport/resources + MCP domain handlers
npm run lint               # tsc --noEmit
npm run lint:destructive   # assert destructive tools carry warnings

Architecture

src/
  index.ts        stdio entrypoint
  http.ts         streamable-HTTP entrypoint (+ gateway mode)
  server.ts       MCP Server wiring: tools/list, tools/call, prompts
  prompts.ts      3 workflow prompts
  domains/        one handler per API domain (events, customers, …)
  elicitation/    destructive-action confirmation guard (fail-open)
  utils/          request-scoped credentials, result helpers, logger
  sdk/            vendored typed client for the SaaS Alerts Partner API
    http.ts       fetch transport: retries, timeouts, key redaction, typed errors
    resources/    one class per domain, mapping methods → REST endpoints
    client.ts     SaasAlertsClient façade

The API base URL defaults to the production host (https://us-central1-the-byway-248217.cloudfunctions.net/reportApi/api/v1) and can be overridden by constructing SaasAlertsClient with a baseUrl (dev/QA hosts are documented in the OpenAPI spec).

Attribution

The MCP surface design (domain layout, tool naming, destructive-action conventions) follows the open-source wyre-technology/saas-alerts-mcp project. This build vendors the API client in-tree so it is fully buildable and importable standalone.

License

Apache-2.0 — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选