Enables sending messages, release announcements, and teaser announcements to Discord channels via webhooks, including support for rich embeds and webhook management tools.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Discord MCP ServerSend 'The update is live!' to the announcements webhook"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Discord MCP Server
A Model Context Protocol (MCP) server for Discord integration via webhooks - TypeScript Edition.
Features
Send Messages: Post messages to Discord channels via webhooks
Release Announcements: Send beautifully formatted release announcements with rich embeds
Teaser Announcements: Send "coming soon" style teasers for upcoming releases
Webhook Management: Add, remove, and list webhook configurations
Secure Storage: Webhook URLs stored locally with partial URL display for security
Type Safe: Built with TypeScript and Zod validation for runtime safety
Technology Stack
Runtime: Bun (fast JavaScript runtime with native TypeScript support)
MCP SDK:
@modelcontextprotocol/sdk(official TypeScript implementation)HTTP Client: axios for Discord webhook API calls
Validation: Zod for runtime type validation
Language: TypeScript with strict mode enabled
Installation
Prerequisites
Bun 1.0+ or Node.js 20+ (Bun recommended for best performance)
Discord server with webhook access
Using Bun (Recommended)
Using Node.js
NixOS with Flakes
Configuration
1. Add to OpenCode
Add to your OpenCode configuration:
For Bun users:
For Node.js users:
Or manually add to ~/.opencode.json:
2. Verify Connection
3. Configure Webhooks
To get your Discord webhook URL:
Go to your Discord server
Server Settings → Integrations → Webhooks
Click New Webhook
Choose a name and channel
Copy Webhook URL
Use the
discord_add_webhooktool in OpenCode to add it
Environment Variables (Optional)
DISCORD_MCP_CONFIG_DIR: Custom directory for webhook configurations (default:~/.config/discord_mcp)
Usage
Simply ask OpenCode in natural language! The MCP server tools will be invoked automatically.
Send a Simple Message
Send a Release Announcement
The announcement will be formatted as a rich Discord embed with:
Colored sidebar (green for release, yellow for beta, red for hotfix)
Version title with emoji
Feature highlights
Download link
Automatic Living Lands logo thumbnail
Donation section
Send a Teaser
Tools
discord_send_message
Send a plain text message to a Discord channel.
Parameters:
webhookName(required): Name of configured webhookcontent(required): Message content (max 2000 chars)username(optional): Override webhook usernameavatarUrl(optional): Override webhook avatarresponseFormat(optional):markdownorjson
discord_send_announcement
Send a formatted release announcement with rich Discord embeds.
Parameters:
webhookName(required): Name of configured webhookversion(required): Version number (e.g., "v2.6.0-beta")headline(required): Main announcement headline (max 256 chars)changes(required): Array of changes/features (1-10 items)downloadUrl(optional): Download/info URLstyle(optional):release(green) /hotfix(red) /beta(yellow) /custom(blue)betaWarning(optional): Include backup warninguseEmbed(optional): Use rich embed format (default: true)embedColor(optional): Custom hex color (e.g., "#5865F2")thumbnailUrl(optional): Custom thumbnail URL (defaults to Living Lands logo)footerText(optional): Custom footer textusername(optional): Override webhook display nameresponseFormat(optional):markdownorjson
Embed Format:
Colored sidebar based on style
Version title with emoji (📦 release, 🧪 beta, 🚨 hotfix, 📢 custom)
Headline as description
"What's New" field with changes
Optional warning field
Download link field
Living Lands logo thumbnail (automatic)
Donation section (automatic)
Timestamp footer
discord_send_teaser
Send a teaser/preview announcement for upcoming releases.
Parameters:
webhookName(required): Name of configured webhookversion(required): Version numberheadline(required): Teaser headlinehighlights(required): Array of features to highlight (1-10 items)additionalInfo(optional): Additional context (max 500 chars)style(optional): Teaser style (default:custom)thumbnailUrl(optional): Custom thumbnail URLfooterText(optional): Custom footer textusername(optional): Override webhook usernameresponseFormat(optional):markdownorjson
discord_add_webhook
Add or update a webhook configuration.
Parameters:
name(required): Friendly name for the webhookurl(required): Discord webhook URLdescription(optional): What this webhook is for
Note: Webhook names are automatically sanitized (lowercase, spaces replaced with underscores).
discord_remove_webhook
Remove a webhook configuration.
Parameters:
name(required): Name of webhook to remove
discord_list_webhooks
List all configured webhooks (URLs partially hidden for security).
Parameters:
responseFormat(optional):markdownorjson
Development
Project Structure
Scripts
Type Safety
The server uses strict TypeScript mode with Zod for runtime validation:
All inputs are validated against Zod schemas
Type inference from schemas ensures consistency
No
anytypes in the codebaseComprehensive error handling
Security
Webhook URLs are stored locally in
~/.config/discord_mcp/webhooks.jsonFull URLs are never displayed in tool outputs (only last 8 characters shown)
Keep your configuration file secure as webhook URLs allow posting to channels
The
webhooks.jsonfile is gitignored by default
Performance
Startup time: ~50ms
Memory usage: ~30MB
Type safety: Compile-time + runtime validation
Bundle size: ~1.3MB (includes all dependencies)
Troubleshooting
Server won't start
Webhook not found errors
Discord API errors
Common errors and solutions:
400 Bad Request: Message content exceeds 2000 characters or invalid format
401 Unauthorized: Webhook URL is invalid or expired
403 Forbidden: Webhook has been deleted from Discord
404 Not Found: Webhook URL is incorrect
429 Rate Limited: Too many requests, wait before retrying
License
MIT