1. Why Connect AI Agents to AlertHub?
AI coding assistants routinely run long test suites, database migrations, or multi-step refactoring tasks in the background. Instead of watching a terminal spinner, you can give your agent native AlertHub tools so it reaches you wherever you are:
- Background Task Completion: Ask your agent to run an integration suite or build and ping your Android device or Slack channel the moment it finishes or hits an error.
- Natural-Language Reminders: Tell your assistant to schedule a follow-up alert 30 minutes ahead to verify a staging deployment or certificate renewal.
- Recent Event Diagnostics: Let your agent query your latest AlertHub events to confirm whether an upstream webhook or CI alert fired properly.
2. Prerequisites
- Create a free account at alerthub.io and configure at least one delivery channel (Mobile Push, Slack, Telegram, WhatsApp, Email, or Webhook).
- Copy your User ID and generate an API Key (
X-API-KEY) from your AlertHub dashboard.
3. Install the AlertHub MCP Server
Choose whichever installation method fits your environment:
Option A: Pre-Built Static Binary (Recommended)
Download the latest archive for Linux, macOS, or Windows (amd64 / arm64) from GitHub Releases, extract alerthub-mcp, and move it into a directory on your $PATH (such as /usr/local/bin).
Option B: Install via Go Toolchain
go install github.com/alerthubio/mcp-server/cmd/alerthub-mcp@latest
Option C: Run via Docker (Zero Local Install)
If you prefer not to install a local binary, you can run the official non-root OCI image directly:
docker pull ghcr.io/alerthubio/mcp-server:latest
4. Connect Your AI Client
Claude Code (CLI)
Register the server globally or per-project using the Claude Code CLI:
claude mcp add --transport stdio \
-e ALERTHUB_USER_ID="YOUR_USER_ID" \
-e ALERTHUB_API_KEY="YOUR_API_KEY" \
alerthub -- alerthub-mcp
Run /mcp inside a Claude Code session to verify that alerthub shows as connected.
Claude Desktop
Add alerthub to your claude_desktop_config.json file and restart Claude Desktop:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"alerthub": {
"command": "alerthub-mcp",
"env": {
"ALERTHUB_USER_ID": "YOUR_USER_ID",
"ALERTHUB_API_KEY": "YOUR_API_KEY"
}
}
}
}
Cursor
Add the same configuration block to .cursor/mcp.json in your repository root (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"alerthub": {
"command": "alerthub-mcp",
"env": {
"ALERTHUB_USER_ID": "YOUR_USER_ID",
"ALERTHUB_API_KEY": "YOUR_API_KEY"
}
}
}
}
Using Docker Instead of a Local Binary
Replace the command and args fields in any mcpServers configuration above to run the containerized server with a read-only filesystem:
{
"mcpServers": {
"alerthub": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--read-only",
"-e", "ALERTHUB_USER_ID",
"-e", "ALERTHUB_API_KEY",
"ghcr.io/alerthubio/mcp-server:latest"
],
"env": {
"ALERTHUB_USER_ID": "YOUR_USER_ID",
"ALERTHUB_API_KEY": "YOUR_API_KEY"
}
}
}
}
5. Available MCP Tools
Once connected, your assistant gains access to three focused tools:
-
send_alert: Dispatches an immediate notification (title,body, optionalstatus,priority, andprofile). Headlines over 50 characters are automatically clamped while preserving the full text at the top ofbody. -
schedule_alert: Schedules a one-time or recurring reminder at least 20 minutes in the future (title,body, UTC RFC 3339start_time, optionalprofile,frequency, andinterval). -
list_recent_events: Read-only snapshot returning up to 20 of your newest AlertHub events (limit, optionalstatusandsourcefilters) so your agent can verify delivery or inspect recent errors. -
list_profiles: Read-only request to list up to 20 of AlertHub notification profiles (limit, optionaldefaultsthat filters the built-in default profiles) so your agent can select the appropriate notification channel.
6. Example Prompts to Try
- "Run the full Go test suite and send me a high-priority AlertHub alert if any package fails."
- "Schedule an AlertHub reminder 30 minutes from now to verify the production deployment metrics."
- "Check my last 5 AlertHub events and summarize any errors from github-actions."
7. Built-In Security & Guardrails
- Zero Credential Exposure:
ALERTHUB_USER_IDandALERTHUB_API_KEYare loaded strictly from process environment variables and never appear in MCP tool schemas or LLM context windows. - Anti-Spam Burst Cap: An in-memory rate limiter caps outbound dispatches at 5 alerts per 60 seconds to protect your devices from runaway agent loops.
- Unprivileged Runtime: The official OCI image runs
FROM scratchas non-root user65534:65534.