Discord MCP Server
Allows LLMs to interact with Discord channels, enabling sending and reading messages, managing roles and channels, and listing servers and channels.
Click on "Deploy 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 'Hello everyone!' to #general"
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 that enables LLMs to interact with Discord channels, allowing them to send and read messages through Discord's API. Using this server, LLMs like Claude can directly interact with Discord channels while maintaining user control and security.
Features
Send messages to Discord channels
Read recent messages from channels
Automatic server and channel discovery
Support for both channel names and IDs
Proper error handling and validation
Related MCP server: MCP-Discord
Prerequisites
Node.js 16.x or higher
A Discord bot token
The bot must be invited to your server with proper permissions:
Read Messages/View Channels
Send Messages
Read Message History
Setup
Clone this repository:
git clone https://github.com/yourusername/discordmcp.git
cd discordmcpInstall dependencies:
npm installCreate a
.envfile in the root directory with your Discord bot token:
DISCORD_TOKEN=your_discord_bot_token_hereBuild the server:
npm run buildUsage with Claude for Desktop
Open your Claude for Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the Discord MCP server configuration:
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["path/to/discordmcp/build/index.js"],
"env": {
"DISCORD_TOKEN": "your_discord_bot_token_here"
}
}
}
}Restart Claude for Desktop
Available Tools
send-message
Sends a message to a specified Discord channel.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)channel: Channel name (e.g., "general") or IDmessage: Message content to send
Example:
{
"channel": "general",
"message": "Hello from MCP!"
}read-messages
Reads recent messages from a specified Discord channel.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)channel: Channel name (e.g., "general") or IDlimit(optional): Number of messages to fetch (default: 50, max: 100)
Example:
{
"channel": "general",
"limit": 10
}list-servers
Lists all servers (guilds) the bot is currently connected to.
Parameters:
None
Example:
{}list-channels
Lists all text channels in a specific server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)
Example:
{
"server": "My Cool Server"
}create-channel
Creates a new text channel in a specific server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)channelName: Name for the new text channel
Example:
{
"server": "My Cool Server",
"channelName": "new-project-discussion"
}read-multiple-channels
Reads recent messages from multiple text channels in a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)channels(optional): List of channel names or IDs (defaults to all text channels if omitted)limitPerChannel(optional): Max messages per channel (default: 10, max: 50)
Example (read from specific channels):
{
"server": "My Cool Server",
"channels": ["general", "announcements"],
"limitPerChannel": 5
}Example (read from all channels):
{
"server": "My Cool Server",
"limitPerChannel": 3
}list-roles
Lists all roles in a specific server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)
Example:
{
"server": "My Cool Server"
}assign-role
Assigns a role to a user in a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)user: User name#discriminator, user ID, or user mentionrole: Role name or ID
Example:
{
"server": "My Cool Server",
"user": "SomeUser#1234",
"role": "Moderator"
}remove-role
Removes a role from a user in a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)user: User name#discriminator, user ID, or user mentionrole: Role name or ID
Example:
{
"server": "My Cool Server",
"user": "SomeUser#1234",
"role": "Moderator"
}create-role
Creates a new role in a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)roleName: Name for the new rolecolor(optional): Hex color code (e.g., "#FF0000")permissions(optional): List of permission names (e.g., ["SendMessages", "ManageMessages"])mentionable(optional): Boolean, whether the role is mentionable (default: false)
Example:
{
"server": "My Cool Server",
"roleName": "Team Alpha",
"color": "#3498db",
"mentionable": true
}delete-role
Deletes a role from a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)role: Role name or ID to delete
Example:
{
"server": "My Cool Server",
"role": "Old Role Name"
}update-role
Updates an existing role in a server.
Parameters:
server(optional): Server name or ID (required if bot is in multiple servers)role: Role name or ID to updatenewName(optional): New name for the rolenewColor(optional): New hex color codenewPermissions(optional): New list of permission names (replaces existing)newMentionable(optional): New mentionable status
Example:
{
"server": "My Cool Server",
"role": "Team Alpha",
"newName": "Team Bravo",
"newColor": "#e67e22"
}Development
Install development dependencies:
npm install --save-dev typescript @types/nodeStart the server in development mode:
npm run devTesting
You can test the server using the MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.jsExamples
Here are some example interactions you can try with Claude after setting up the Discord MCP server:
"Can you read the last 5 messages from the general channel?"
"Please send a message to the announcements channel saying 'Meeting starts in 10 minutes'"
"What were the most recent messages in the development channel about the latest release?"
Claude will use the appropriate tools to interact with Discord while asking for your approval before sending any messages.
Security Considerations
The bot requires proper Discord permissions to function
All message sending operations require explicit user approval
Environment variables should be properly secured
Token should never be committed to version control
Channel access is limited to channels the bot has been given access to
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
Check the GitHub Issues section
Consult the MCP documentation at https://modelcontextprotocol.io
Open a new issue with detailed reproduction steps
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables LLMs to interact with Discord channels by sending and reading messages through Discord's API, with a focus on maintaining user control and security.9 npm231MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Discord servers through a bot, supporting channel management, messaging, forum operations, reactions, and webhooks.22411 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Discord through natural language, including reading and sending messages, managing servers, and user actions.-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to read and write Discord messages, search content, and compute channel statistics via a Discord bot.MIT