@cloud9-labs/mcp-discord
v0.1.0
Published
Discord MCP Server - Interact with Discord API via Model Context Protocol
Readme
Discord MCP Server
Discord API integration for Model Context Protocol (MCP). Interact with Discord servers, channels, messages, and users through Claude Desktop or any MCP client.
Features
- 12 Discord API Tools for comprehensive Discord automation
- Rate Limiting (5 requests/second with automatic retry)
- Type-Safe with TypeScript and Zod schemas
- Proper MCP SDK Pattern using
McpServerandStdioServerTransport
Tools
| Tool | Description |
|------|-------------|
| discord_send_message | Send a message to a channel |
| discord_edit_message | Edit an existing message |
| discord_delete_message | Delete a message |
| discord_get_channel | Get channel details |
| discord_list_guild_channels | List all channels in a server |
| discord_get_channel_messages | Get message history (up to 100 messages) |
| discord_get_guild | Get server details |
| discord_list_guild_members | List server members (up to 1000) |
| discord_get_user | Get user details |
| discord_add_reaction | Add emoji reaction to a message |
| discord_create_channel | Create a new channel |
| discord_search_guild_members | Search members by username/nickname |
Setup
1. Create a Discord Bot
- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to "Bot" section and click "Add Bot"
- Under "Token", click "Reset Token" and copy it
- Enable these Privileged Gateway Intents:
- Server Members Intent
- Message Content Intent
- Go to "OAuth2 > URL Generator"
- Select scopes:
bot - Select permissions:
Send Messages,Read Message History,Manage Channels,Add Reactions
- Select scopes:
- Copy the generated URL and invite the bot to your server
2. Configure MCP Server
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["/Users/A5O1/書類/AI/mcp-discord/dist/index.js"],
"env": {
"DISCORD_BOT_TOKEN": "YOUR_BOT_TOKEN_HERE"
}
}
}
}3. Restart Claude Desktop
After saving the config, restart Claude Desktop to load the MCP server.
Usage Examples
Send a Message
Use discord_send_message to send "Hello from Claude!" to channel ID 123456789Get Channel Messages
Use discord_get_channel_messages to get the last 10 messages from channel 123456789Create a Channel
Use discord_create_channel to create a text channel named "general-chat" in guild 987654321Search Members
Use discord_search_guild_members to find users named "john" in guild 987654321Finding Discord IDs
Channel ID
- Right-click a channel → Copy Channel ID (requires Developer Mode enabled)
Guild ID
- Right-click the server icon → Copy Server ID
User ID
- Right-click a user → Copy User ID
Message ID
- Right-click a message → Copy Message ID
Enable Developer Mode: User Settings → Advanced → Developer Mode
Rate Limiting
The client implements token bucket rate limiting:
- 5 requests per second
- Automatic retry on HTTP 429 (rate limit exceeded)
- Respects
Retry-Afterheaders from Discord API
API Reference
All tools follow Discord API v10 specifications: https://discord.com/developers/docs/reference
Development
# Build
npm run build
# Watch mode
npx tsc --watchLicense
MIT
Repository
https://github.com/cloud9-labs/mcp-discord
