Comprehensive administrative control over Discord communities via MCP
Discord MCP Server
A Model Context Protocol (MCP) server that provides full administrative control over Discord communities. Enables AI assistants like Claude to manage Discord servers through 128 operations covering messages, moderation, channels, roles, events, and more.
Features
- Messages: Send, read, edit, delete, pin messages and manage reactions
- Moderation: Kick, ban, timeout members with audit log support
- Channels: Create, edit, delete channels with permission management
- Threads: Create and manage threads and forum posts
- Roles: Full role CRUD with permission configuration
- Members: List, search, edit members and manage their roles
- Events: Create and manage scheduled events
- Polls: Create polls with multiple choice options
- Webhooks: Create and send messages via webhooks
- AutoMod: Configure auto-moderation rules
- Voice: Move and disconnect members from voice channels
- And more: Emojis, stickers, invites, templates, onboarding, stage channels...
Prerequisites
- Python 3.12+
- uv package manager
- A Discord account
- A Discord server where you have admin permissions
Installation
- Clone the repository:
git clone https://github.com/glittercowboy/discord-mcp.git
cd discord-mcp
- Install dependencies:
uv sync
Discord Bot Setup
Follow these steps carefully to create and configure your Discord bot.
Step 1: Create a Discord Application
- Go to the Discord Developer Portal
- Log in with your Discord account
- Click the "New Application" button (top right)
- Enter a name for your application (e.g., "My MCP Bot")
- Accept the Terms of Service and click "Create"
Step 2: Create the Bot User
- In your application's settings, click "Bot" in the left sidebar
- Click "Add Bot" and confirm by clicking "Yes, do it!"
- Your bot is now created!
Step 3: Get Your Bot Token
IMPORTANT: Your bot token is like a password. Never share it or commit it to version control.
- In the Bot section, find the "Token" area
- Click "Reset Token" (or "Copy" if available)
- You may need to enter your Discord password or 2FA code
- Copy the token immediately - you can only see it once!
- Store it somewhere safe (you'll need it for configuration)
If you lose your token, you'll need to reset it, which invalidates the old one.
Step 4: Enable Privileged Intents
Still in the Bot section, scroll down to "Privileged Gateway Intents" and enable:
| Intent | Why It's Needed |
|---|---|
| Server Members Intent | Required for listing members, managing roles, and member-related operations |
| Message Content Intent | Required for reading message content (not just metadata) |
Click "Save Changes" at the bottom.
Step 5: Generate the Bot Invite URL
- Click "OAuth2" in the left sidebar
- Click "URL Generator" under OAuth2
Select these scopes:
botapplications.commands
Select bot permissions:
For full functionality, select "Administrator".
Or for minimal permissions, select these individually:
- Manage Channels
- Manage Roles
- Kick Members
- Ban Members
- Manage Messages
- Read Message History
- Send Messages
- Create Public Threads
- Create Private Threads
- Manage Threads
- Embed Links
- Attach Files
- Add Reactions
- Use External Emojis
- Manage Webhooks
- View Audit Log
- Moderate Members (for timeouts)
- Manage Events
- Create Events
- Send Polls
- Copy the generated URL at the bottom of the page
Step 6: Invite the Bot to Your Server
- Open the URL you copied in your browser
- Select the server you want to add the bot to (you need "Manage Server" permission)
- Review the permissions and click "Authorize"
- Complete any CAPTCHA if prompted
- The bot should now appear in your server's member list (it will show as offline until the MCP server runs)
Step 7: Get Your Server (Guild) ID
- Open Discord (desktop app or web)
- Go to User Settings (gear icon near your username)
- Navigate to App Settings > Advanced
- Enable "Developer Mode"
- Close settings
- Right-click on your server name in the server list
- Click "Copy Server ID"
- Save this ID - you'll need it for configuration
Configuration
You need two values:
- Bot Token (from Step 3)
- Server ID (from Step 7)
Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"discord": {
"command": "uv",
"args": ["--directory", "/path/to/discord-mcp", "run", "python", "-m", "src.server"],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here",
"DISCORD_GUILD_ID": "your-server-id-here"
}
}
}
}
`
Tools (5)
messagesSend, read, edit, delete, pin messages and manage reactionsmoderationKick, ban, timeout members with audit log supportchannelsCreate, edit, delete channels with permission managementrolesFull role CRUD with permission configurationeventsCreate and manage scheduled eventsEnvironment Variables
DISCORD_BOT_TOKENrequiredThe secret token for your Discord bot applicationDISCORD_GUILD_IDrequiredThe unique ID of the Discord server (guild) to manageConfiguration
{"mcpServers": {"discord": {"command": "uv", "args": ["--directory", "/path/to/discord-mcp", "run", "python", "-m", "src.server"], "env": {"DISCORD_BOT_TOKEN": "your-bot-token-here", "DISCORD_GUILD_ID": "your-server-id-here"}}}}