#!/usr/bin/env bash
# Sentry's MCP server, pointed at the self-hosted sentry.gbrown.org.
#
# link-mcp registers this file as a stdio server and hands it the token as
# MCP_TOKEN, read from SENTRY_GBROWN_TOKEN in user/agents/mcp/env. The token is
# a read-only personal token (Sentry > User settings > Personal Tokens, scopes
# alerts/event/org/project/team:read). The hosted sentry.io server cannot reach
# a self-hosted instance, which is why this one runs locally.
set -euo pipefail
: "${MCP_TOKEN:?MCP_TOKEN is not set; register this server through link-mcp}"
export SENTRY_ACCESS_TOKEN="$MCP_TOKEN"
exec npx -y @sentry/mcp-server@latest --host=sentry.gbrown.org --organization-slug=sentry
