Skip to content

Publish as a webhook

Webhooks suit CI alerts, cross-posters, and relays that need a channel-bound publishing identity with per-message name and avatar overrides. They use Discord’s webhook routes and bucket semantics, but remain rate-limited.

Ops engineer says: “Set up a webhook in #ci-alerts and use it for our GitHub Actions notifications.”

Two tool calls split across time: provision the webhook once (capture the token), then call webhooks_execute from there on out.

  1. Provision the webhook (one time).

    webhooks_create returns the full webhook record including the token. Capture the id and token and store them outside the agent’s working memory - typically in a secrets manager or a sealed config file.

    {
    "name": "webhooks_create",
    "arguments": {
    "channel_id": "222233334444555566",
    "name": "github-actions-notifier",
    "audit_reason": "ops: create CI alerts publisher"
    }
    }
  2. Post via webhooks_execute.

    The token replaces bot authentication. No Authorization header is sent on this call-the MCP argument becomes part of the Discord route URL, not the JSON request body. This is the tool’s auth: false behavior.

    {
    "name": "webhooks_execute",
    "arguments": {
    "webhook_id": "444455556666777788",
    "token": "REPLACE_WITH_WEBHOOK_TOKEN_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "content": "Build #4127 failed on `main` - https://github.com/cappyeo/discord-mcp/actions/runs/4127",
    "username": "GitHub Actions",
    "wait": true
    }
    }
ConcernBot userWebhook
Rate-limit handlingDiscord bot route/global schedulingDiscord webhook route scheduling; still rate-limited
AuthAuthorization: Bot <token> headertoken in the URL route, no bot header
Display identitybot’s name + avatarper-message username and avatar_url override
Can react / reply / edit other messagesyesno
Cost to provisionone bot install per Discord serverone webhooks_create per channel

When sending Components V2 through a webhook, you must set both:

  • flags: 32768 - the IS_COMPONENTS_V2 bit (1 << 15).
  • with_components: true - query parameter telling Discord to include the component tree in the returned message (only matters when wait: true).
  • Webhooks can only post. They can’t react, reply with interactions, or edit messages other than their own. For interactive flows, stick with the bot.
  • One target channel at a time. A webhook starts in its creation channel. Move a bot-owned webhook with webhooks_modify when that bot-authenticated route is permitted, or provision separate webhooks for concurrent targets.
  • Token leakage = full impersonation. Treat tokens like API keys. Anyone with the token can post as the webhook with no further auth.