sentry-claude-channel
Sentry issue events delivered to subscribed Claude Code sessions as <channel source="claude-hive"> notifications, via claude-hive.
Mirrors the architecture of notion-channel-mcp and github-claude-channel.
What it does
When a new Sentry issue fires (or an existing one changes status), the receiver daemon looks up which Claude Code peers are subscribed to that project, and pushes the event to each via claude-hive. Subscriptions persist across session restarts because they're keyed on the workspace stable_id.
That id is taken from claude-hive's own live peer list rather than computed here. The MCP server runs from the plugin's install directory, not the session's, so its process.cwd() names no session at all — deriving an id from it addressed every session's events to the same nonexistent peer, and nothing reported a failure because the broker accepts a message for an unknown id. The launcher passes the session's cwd, the server matches it against the broker's live peers, and it returns an error naming the directory it tried rather than guessing when no peer owns it.
Architecture
receiver.ts — long-running HTTP daemon. Receives Sentry webhook POSTs at /webhook, verifies HMAC signature, fan-outs to subscribed peers via claude-hive /send-message. Runs behind a tunnel that gives Sentry a public HTTPS URL.
server.ts — per-Claude-session MCP server. Provides sentry_watch_project, sentry_unwatch_project, sentry_list_my_watches tools.
shared/db.ts — SQLite subscription store at ~/.sentry-channel.db (WAL mode; receiver and MCP server both open it).
shared/hive.ts — thin HTTP client for the claude-hive broker.
shared/session-id.ts — works out which session is calling, from the cwd the launcher captured plus claude-hive's live peer list. Refuses rather than guessing.
scripts/remap-subscriptions.ts — one-off repair for rows filed under a wrong id (dry-run by default).
shared/types.ts — Sentry webhook payload + subscription types.
shared/board.ts — files new issues as tasks on a claude-workspaces board, comments on repeats, and refreshes each board's token.
Requirements
bun — the server uses bun:sqlite and other Bun APIs, so node is not a
substitute. You do not need bun on your PATH: the plugin ships a /bin/sh launcher that
finds bun itself, so it works in sessions started by launchd, a GUI app, or cron, where
your shell profile never runs.
Optional overrides (SENTRY_RECEIVER_PORT, CLAUDE_HIVE_URL, SENTRY_CHANNEL_DB) go in
~/.config/sentry-claude-channel/env, which the launcher sources at startup. Keep them
there rather than inside the plugin directory — the plugin cache is keyed by version, so
each release installs into a fresh directory and anything written inside is orphaned by
the next upgrade. SENTRY_CLIENT_SECRET is not needed by the MCP server; the receiver
reads it from macOS Keychain (see SETUP.md).
Install
As a Claude Code plugin (recommended)
This repo is a Claude Code plugin. Install it via the standard plugin flow — the MCP server and a PreToolUse auto-approve hook ship together, so you don't have to hand-edit ~/.claude.json per session:
# Add this checkout as a local plugin marketplace
claude plugin marketplace add /path/to/sentry-claude-channel
# Install the plugin from that marketplace
claude plugin install sentry-claude-channel@sentry-claude-channel
The plugin registers an MCP server named sentry-claude-channel (exposing the sentry_* tools) and a PreToolUse hook that auto-approves the plugin's own MCP tools + a narrow allowlist of receiver lifecycle commands (./scripts/run-receiver.sh, bun receiver.ts, and launchctl ops scoped to the com.fryanpan.sentry-channel-receiver / com.fryanpan.sentry-bridge-cloudflared service labels).
You still need to set up the receiver daemon, the Sentry integration, and the Cloudflare tunnel once per machine — see SETUP.md.
As a raw MCP entry (fallback)
If you prefer to wire up the MCP server manually (e.g. you're on a Claude Code version without plugin support, or you don't want the auto-approve hook), add the server directly to your .mcp.json or ~/.claude.json:
{
"mcpServers": {
"sentry-claude-channel": {
"command": "bun",
"args": ["/path/to/sentry-claude-channel/server.ts"]
}
}
}
You'll then be prompted to approve each mcp__sentry-claude-channel__* tool the first time Claude Code uses it.
Quick start
bun install
# Start the receiver (one per machine; manage via launchd in production).
# It needs SENTRY_CLIENT_SECRET; the launcher reads it from Keychain.
./scripts/run-receiver.sh