A minimal MCP server for Discord. Exposes two read-only tools — listing channels and reading messages — from a single configured guild.
list_channels— lists all channels in the configured guild (id, name, type)get_messages— retrieves recent messages from a channel (channel_id required, limit optional 1–100, default 50)
- Go to https://discord.com/developers/applications and create an application
- Under Bot, click Add Bot
- Copy the token
- Under OAuth2 → URL Generator, select scopes:
bot— permissions:View Channels,Read Message History - Open the generated URL to invite the bot to your server
cp config.example.toml config.tomlEdit config.toml:
[discord]
token = "Bot YOUR_TOKEN_HERE"
guild_id = "YOUR_GUILD_ID"To find your guild ID: in Discord, enable Developer Mode (Settings → Advanced), right-click your server → Copy Server ID.
cargo build --releaseIn your Claude Code MCP config (.mcp.json or claude_desktop_config.json):
{
"mcpServers": {
"discord": {
"command": "/path/to/discord-mcp/target/release/discord-mcp",
"args": []
}
}
}The server reads config.toml from its current working directory. Set cwd in the MCP config if needed.
cargo test # run all tests
cargo clippy # lint
cargo build # debug build