A Model Context Protocol (MCP) server that provides Discord integration capabilities to MCP clients.
Note: This is an enhanced fork of the original mcp-discord repository with an immense amount of new features added.
list_servers: List all Discord servers (guilds) the bot is a member ofget_server_info: Get detailed server informationlist_members: List server members and their rolesget_server_settings: Retrieve current server configurationmodify_server_settings: Update server name, description, icon, banner, verification, notifications, AFK, system channel, explicit content filter, and locale
send_message: Send a message to a channelread_messages: Read recent message historyedit_message: Edit an existing messageget_message: Get a specific message by IDadd_reaction: Add a reaction to a messageadd_multiple_reactions: Add multiple reactions to a messageremove_reaction: Remove a reaction from a messagepin_message: Pin a message in a channelunpin_message: Unpin a message from a channelmoderate_message: Delete messages and timeout usersbulk_delete_messages: Delete multiple messages at once (2-100 messages)
create_text_channel: Create a new text channelcreate_voice_channel: Create a new voice channellist_channels: List all channels in a server (shows categories and sorts channels)get_channel_info: Get detailed information about a channelmodify_channel: Modify channel properties (name, topic, permissions, category, etc.)delete_channel: Delete an existing channel
create_role: Create a new role in a serverdelete_role: Delete a role from a servermodify_role: Modify role properties (name, color, permissions, position, etc.)list_roles: List all roles in a server with details (includes position information)get_role_info: Get detailed information about a specific roleset_role_hierarchy: Set the role hierarchy by specifying role order (from highest to lowest)- Supports both role IDs and role names (case-insensitive)
- Automatically handles bot role restrictions
- Intelligently calculates positions below the bot's role
add_role: Add a role to a userremove_role: Remove a role from a user
check_bot_permissions: Check what permissions the bot has in a channel or servercheck_member_permissions: Check what permissions a member has in a channel or serverconfigure_channel_permissions: Configure permissions for a role or member in a channellist_discord_permissions: List all available Discord permissions with descriptions
create_invite: Create channel invites with usage limits and expirationlist_invites: List active server invitesget_invite_info: Get details about an invitedelete_invite: Revoke an invite
create_automod_rule: Create auto-moderation ruleslist_automod_rules: List auto-moderation rulesmodify_automod_rule: Update auto-moderation rulesdelete_automod_rule: Delete auto-moderation rules
create_thread: Create threads from messages or standalonelist_threads: List active or archived threadsarchive_thread: Archive a threadunarchive_thread: Unarchive a threaddelete_thread: Delete a thread
create_category: Create channel categoriesmodify_category: Modify category name, position, or permissionsdelete_category: Delete categories (optionally moving channels)
create_emoji: Create custom emojislist_emojis: List server emojisdelete_emoji: Delete custom emojiscreate_sticker: Create custom stickerslist_stickers: List server stickersdelete_sticker: Delete custom stickers
create_webhook: Create a new webhooklist_webhooks: List webhooks in a channelsend_webhook_message: Send messages via webhookmodify_webhook: Update webhook settingsdelete_webhook: Delete a webhook
get_user_info: Get information about a Discord userget_member_info: Get detailed information about a server membermodify_member: Modify member properties (nickname, timeout, etc.)ban_user: Ban a user from the serverunban_user: Unban a user from the serverkick_user: Kick a user from the server
This enhanced fork includes extensive new features beyond the original project:
- Enhanced
list_channels: Now displays channel categories and sorts channels by position - Category Support in
modify_channel: Move channels between categories or remove them from categories list_serversTool: List all servers the bot is a member of- Role Hierarchy Management: Enhanced
set_role_hierarchytool with improved position calculation and automatic bot role handling- Supports both role IDs and role names (case-insensitive matching)
- Automatically skips the bot's own role (bots cannot edit their own role position)
- Intelligently calculates positions to ensure roles are placed below the bot's role
- Handles permission errors gracefully when roles are above the bot's position
- Enhanced
list_roles: Now displays role positions to help visualize hierarchy - Position Support in
modify_role: Set individual role positions to control hierarchy
check_bot_permissions: Check what permissions the bot has in a channel or servercheck_member_permissions: Check what permissions a member has in a channel or serverconfigure_channel_permissions: Configure permissions for a role or member in a channellist_discord_permissions: List all available Discord permissions with descriptions
bulk_add_roles: Add a role to multiple usersbulk_modify_members: Update multiple members (nickname, timeout) in one call
search_messages: Search messages by content, author, or date range within channelsfind_members_by_criteria: Find members by role, join date, name, or bot status
schedule_task: Schedule a supported task to run latersend_scheduled_message: Schedule a message to be sent later
generate_server_analytics: Generate basic server analyticsgenerate_channel_analytics: Generate basic analytics for a channel
create_automation_rule: Create an automation rule definition
create_message_template: Create a reusable message templatecreate_role_template: Create a reusable role template
analyze_message_patterns: Analyze message patterns for spam indicatorsauto_moderate_by_pattern: Auto-moderate messages based on simple spam patterns
track_metrics: Track custom metrics over timeexport_data: Export stored data (metrics, templates, automation rules)
auto_organize_channels: Move inactive channels into a target categorycreate_channel_structure: Create channel structure from a template
-
Set up your Discord bot:
- Create a new application at Discord Developer Portal
- Create a bot and copy the token
- Enable required privileged intents:
- MESSAGE CONTENT INTENT
- PRESENCE INTENT
- SERVER MEMBERS INTENT
- Invite the bot to your server using OAuth2 URL Generator
-
Python Requirements:
- Python 3.10 or higher
- pip (Python package installer)
-
Clone the Repository:
git clone <your-repo-url> cd mcp-discord-main
-
Create and Activate Virtual Environment:
# On Windows python -m venv venv venv\Scripts\activate # On macOS/Linux python -m venv venv source venv/bin/activate
-
Install Dependencies:
pip install -e .Note: If using Python 3.13+, also install audioop:
pip install audioop-lts -
Configure your MCP Client:
Add this to your MCP client configuration file:
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["-m", "discord_mcp"],
"cwd": "path/to/mcp-discord-main",
"env": {
"DISCORD_TOKEN": "your_bot_token"
}
}
}
}Note:
- Replace "path/to/mcp-discord-main" with the actual path to your cloned repository
- Replace "your_bot_token" with your Discord bot token
- Consult your MCP client's documentation for the exact configuration file location
If you run into issues, check your MCP client's logs for detailed error messages.
Common issues:
-
Token Errors:
- Verify your Discord bot token is correct
- Check that all required intents are enabled
-
Permission Issues:
- Ensure the bot has proper permissions in your Discord server
- Verify the bot's role hierarchy for role management commands
-
Installation Issues:
- Make sure you're using the correct Python version
- Try recreating the virtual environment
- Check that all dependencies are installed correctly
GNU General Public License v3.0 (GPLv3) - see LICENSE file for details.
Note: This is an enhanced fork of the original mcp-discord repository with extensive new features added.