Enables interaction with Discord channels, allowing for sending messages and reading recent message history through Discord's API.
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
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:
Install dependencies:
Create a
.env
file in the root directory with your Discord bot token:
Build the server:
Usage with Claude for Desktop
Open your Claude for Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the Discord MCP server configuration:
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:
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:
Development
Install development dependencies:
Start the server in development mode:
Testing
You can test the server using the MCP Inspector:
Examples
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 installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables LLMs to interact with Discord channels by sending and reading messages through Discord's API, with a focus on maintaining user control and security.
- Features
- Prerequisites
- Setup
- Usage with Claude for Desktop
- Available Tools
- Development
- Testing
- Examples
- Security Considerations
- Contributing
- License
- Support
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityEnables direct interaction with the Discord API using both REST API calls and slash command syntax for bot management, server configuration, and message operations.Last updated -8MIT License
- AsecurityFlicenseAqualityEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.Last updated -3121
- AsecurityAlicenseAqualityA Discord Model Context Protocol server that enables AI assistants to interact with Discord, providing functionality for sending messages, managing channels, handling forum posts, and working with reactions.Last updated -221347MIT License
- -securityFlicense-qualityA secure server that enables interaction with Discord channels through JWT-authenticated API calls, allowing users to send messages, fetch channel data, search content, and perform moderation actions.Last updated -