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.
- 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
- 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
- Clone this repository:
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp- Install dependencies:
npm install- Create a
.envfile in the root directory with your Discord bot token:
DISCORD_TOKEN=your_discord_bot_token_here
- Build the server:
npm run build-
Open your Claude for Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
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