by v-3
Discord MCP Server is a Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to send and read messages within Discord channels. Its main purpose is to facilitate seamless interaction between LLMs and Discord, ensuring user control and security.
Discord MCP Server is a Model Context Protocol (MCP) server that facilitates interaction between Large Language Models (LLMs) like Claude and Discord channels. It enables LLMs to send and read messages within Discord, ensuring user control and security.
To use Discord MCP Server, you need Node.js (16.x or higher) and a Discord bot token. After cloning the repository and installing dependencies, create a .env
file with your Discord bot token. Then, build the server using npm run build
. For integration with Claude for Desktop, you need to configure claude_desktop_config.json
to include the Discord MCP server, specifying the command to run the server and your Discord bot token as an environment variable. After setup, LLMs can utilize the send-message
and read-messages
tools to interact with Discord.
Q: What are the prerequisites for running Discord MCP Server? A: You need Node.js 16.x or higher, a Discord bot token, and the bot must have specific permissions (Read Messages/View Channels, Send Messages, Read Message History) in your Discord server.
Q: How do I configure Discord MCP Server with Claude for Desktop?
A: You need to modify the mcpServers
section in your Claude for Desktop configuration file (claude_desktop_config.json
) to include the Discord MCP server's command and environment variables.
Q: What tools are available for LLMs to interact with Discord?
A: The send-message
tool allows LLMs to send messages, and the read-messages
tool enables them to read recent messages from Discord channels.
Q: What security considerations should I be aware of? A: Ensure proper Discord permissions for the bot, require explicit user approval for message sending, secure environment variables, never commit your bot token to version control, and understand that channel access is limited to what the bot has been granted.
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.
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp
npm install
.env
file in the root directory with your Discord bot token:DISCORD_TOKEN=your_discord_bot_token_here
npm run build
Open your Claude for Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%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"
}
}
}
}
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 sendExample:
{
"channel": "general",
"message": "Hello from MCP!"
}
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
}
npm install --save-dev typescript @types/node
npm run dev
You can test the server using the MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.js
Here are some example interactions you can try with Claude after setting up the Discord MCP server:
Claude will use the appropriate tools to interact with Discord while asking for your approval before sending any messages.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
Reviews feature coming soon
Stay tuned for community discussions and feedback