Discord — Notifications Channel

Overview

The Discord server serves as the primary notification hub for the Ecotrans fleet platform (p24). The bot manages channels and webhooks used by automated pipelines (n8n, monitoring alerts, deployment notifications).

Server

PropertyValue
Server ID (Guild ID)1501736683354198067
Application ID1501737509896323072
Bot namep24-infra bot

Bot permissions

The bot was invited with Administrator scope. Required capabilities:

  • Manage Channels (create/rename/archive channels)
  • Manage Webhooks (create webhooks per channel for inbound notifications)
  • Send Messages
  • Read Message History

Credentials (in .env.local, not committed)

DISCORD_BOT_TOKEN=<bot token from Developer Portal>
DISCORD_SERVER_ID=1501736683354198067

The legacy key p24-infra-discord-bot-token is also present in .env.local for historical reasons — DISCORD_BOT_TOKEN is the canonical name.

Planned channel structure

ChannelPurpose
#deploy-prodVercel production deployment events
#deploy-stagingVercel staging deployment events
#alertsPrometheus/Grafana alertmanager alerts
#n8n-errorsn8n workflow failures
#supabaseSupabase edge function errors, quota warnings
#generalManual team notifications

Each channel gets a dedicated webhook URL stored in n8n credentials or Alertmanager config — never hardcoded in code.

MCP setup for administrative work

The discord-mcp server in .mcp.json gives Claude Code direct access to Discord API for channel and webhook management.

"discord": {
  "command": "npx",
  "args": ["-y", "discord-mcp"],
  "env": {
    "DISCORD_TOKEN": "${DISCORD_BOT_TOKEN}"
  }
}

Authorization flow:

  1. DISCORD_BOT_TOKEN loaded from .env.local into Claude Code env
  2. discord-mcp process started with that token
  3. All Discord API calls use the bot token (not a user token)

Scope of administrative operations via MCP:

  • Create / rename / delete channels
  • Create webhooks and retrieve their URLs
  • Send messages to channels
  • List existing channels and webhooks

Webhook integration points

Once channels are created, webhook URLs go into:

  • n8n: stored as HTTP Request node credential or workflow-level env var
  • Alertmanager (monitoring/alertmanager/alertmanager.yml): discord_webhook_url field in receiver config
  • Vercel: project notification settings (per-project, via Vercel dashboard or API)

Developer Portal

Application settings: https://discord.com/developers/applications/1501737509896323072