discord-mcp
Comprehensive Discord server management through MCP, enabling channel, role, permission, message, moderation, and automation tasks via natural language.
README
Discord MCP Server
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.
Features
Server Information
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
Message Management
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)
Channel Management
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
Role Management
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
Permission Management
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
Invite Management
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
Auto-Moderation & Rules
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
Thread Management
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
Category Management
create_category: Create channel categoriesmodify_category: Modify category name, position, or permissionsdelete_category: Delete categories (optionally moving channels)
Emoji & Sticker Management
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
Webhook Management
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
User Management
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
New Features in This Fork
This enhanced fork includes extensive new features beyond the original project:
Recent Improvements
- 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
Permission Management
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 Operations
bulk_add_roles: Add a role to multiple usersbulk_modify_members: Update multiple members (nickname, timeout) in one call
Smart Search & Filtering
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
Scheduled Tasks
schedule_task: Schedule a supported task to run latersend_scheduled_message: Schedule a message to be sent later
Analytics
generate_server_analytics: Generate basic server analyticsgenerate_channel_analytics: Generate basic analytics for a channel
Automation Rules
create_automation_rule: Create an automation rule definition
Templates
create_message_template: Create a reusable message templatecreate_role_template: Create a reusable role template
Smart Moderation & Analysis
analyze_message_patterns: Analyze message patterns for spam indicatorsauto_moderate_by_pattern: Auto-moderate messages based on simple spam patterns
Advanced Analytics
track_metrics: Track custom metrics over timeexport_data: Export stored data (metrics, templates, automation rules)
Channel Organization
auto_organize_channels: Move inactive channels into a target categorycreate_channel_structure: Create channel structure from a template
Prerequisites
-
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)
Installation
-
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
Debugging
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
License
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.