Discord MCP Server
Allows interaction with Discord to send messages, read channel history, post rich embeds, and list server 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 Server Send 'The latest build is ready' to the #general channel"
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 Python MCP (Model Context Protocol) server that lets you interact with Discord directly from Claude Code sessions. Send messages, read channels, post rich embeds, and list server channels — all through natural conversation with Claude.
Prerequisites
Docker and Docker Compose installed
Claude Code CLI installed
A Discord bot token (setup guide below)
Related MCP server: Discord MCP Server
Discord Bot Setup
Go to the Discord Developer Portal
Click New Application, give it a name, and create it
Go to Bot in the left sidebar
Click Reset Token and copy the token — this is your
DISCORD_BOT_TOKENUnder Privileged Gateway Intents, enable Message Content Intent
Go to OAuth2 > URL Generator in the left sidebar
Select scopes:
botSelect bot permissions:
Send Messages,Read Message History,View ChannelsCopy the generated URL and open it in your browser to invite the bot to your server
Installation
1. Clone the repository
git clone <your-repo-url>
cd discord-mcp-server2. Set up environment variables
cp .env.example .env
# Edit .env and add your DISCORD_BOT_TOKEN and optionally DISCORD_DEFAULT_GUILD_ID3. Build the Docker image
docker compose build4. Register with Claude Code
Add the following to your Claude Code MCP settings. You can configure this in
~/.claude/settings.json (global) or .mcp.json (project-level):
{
"mcpServers": {
"discord-mcp": {
"command": "docker",
"args": [
"compose",
"-f", "/absolute/path/to/discord-mcp-server/docker-compose.yml",
"run", "--rm", "-i", "discord-mcp"
],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here",
"DISCORD_DEFAULT_GUILD_ID": "your-guild-id-here"
}
}
}
}Note: Replace
/absolute/path/to/discord-mcp-serverwith the actual absolute path to this project on your machine. Replace the token and guild ID with your actual values.
Usage Examples
Once configured, you can use these tools in any Claude Code session:
List channels in a server:
"Show me all the channels in my Discord server"
Send a message:
"Send 'Deployment complete!' to the #general channel"
Read recent messages:
"What are the last 5 messages in #random?"
Send a rich embed:
"Send an embed to #updates with title 'Release v2.0' and a green color, with fields for 'Changes' and 'Breaking Changes'"
Tool Reference
discord_list_channels
Lists all text channels in a Discord server.
Parameter | Type | Required | Description |
| string | Yes | Discord server/guild ID |
discord_send_message
Sends a plain text message to a channel.
Parameter | Type | Required | Description |
| string | Yes | Channel ID or name (e.g. |
| string | Yes | Message text (max 2000 chars) |
| string | No | Server ID. Required if channel is a name and no default is set. |
discord_read_messages
Reads recent messages from a channel.
Parameter | Type | Required | Description |
| string | Yes | Channel ID or name |
| string | No | Server ID. Required if channel is a name and no default is set. |
| integer | No | Number of messages (default: 10, max: 50) |
discord_send_embed
Sends a rich embed message to a channel.
Parameter | Type | Required | Description |
| string | Yes | Channel ID or name |
| string | Yes | Embed title (max 256 chars) |
| string | No | Embed body text (max 4096 chars) |
| integer | No | Color as decimal (e.g. |
| list | No | List of |
| string | No | Plain text alongside the embed |
| string | No | Server ID. Required if channel is a name and no default is set. |
Environment Variables
Variable | Required | Description |
| Yes | Bot token from Discord Developer Portal |
| No | Default server ID for all tool calls |
Architecture
Claude Code ←stdio→ MCP Server (Python) ←HTTPS→ Discord API v10src/discord_mcp/types.py— Pydantic models with Discord API limit validation (Channel, Message, SendResult, Embed)src/discord_mcp/discord_client.py— Async Discord REST API wrapper using httpxsrc/discord_mcp/server.py— MCP tool definitions and handler functions
Key design decisions:
All Discord API interaction goes through
DiscordClient— never call httpx directly from server.pyTool handlers are separated from
@mcp.tool()decorators for testabilityChannel names are resolved case-insensitively via the Discord API
Guild ID follows a fallback chain: explicit parameter →
DISCORD_DEFAULT_GUILD_IDenv var → None
Security
Input validation — Guild IDs and channel IDs are validated as numeric Discord snowflakes before use in API URLs
Content length enforcement — Message content (2000 chars) and all embed fields (title 256, description 4096, field name 256, field value 1024, max 25 fields, 6000 total) are validated before sending to the Discord API
Embed sanitization — Embed fields are validated through Pydantic models (
EmbedField), preventing injection of arbitrary embed propertiesError message hygiene — Failed channel lookups do not enumerate available channels, preventing server structure disclosure
Rate limit handling — The client retries once with backoff on 429 responses (capped at 5s)
Docker hardening — Container runs as a non-root
appuserDependency pinning — All dependencies (production and dev) use compatible-release (
~=) constraintsReproducible builds —
requirements-lock.txtpins all transitive dependency versions; Docker builds install from the lock file
Development
Running locally (without Docker)
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
export DISCORD_BOT_TOKEN=your-token
export DISCORD_DEFAULT_GUILD_ID=your-guild-id
discord-mcpRunning tests
pip install -e ".[dev]"
pytest tests/ -vTests use respx to mock httpx requests — no real Discord API calls are made.
License
MIT
Available Tools
4 toolsdiscord_list_channelsA
List all text channels in a Discord server.
Args: guild_id: The Discord server/guild ID
Inputs: guild_id (required).
discord_read_messagesA
Read recent messages from a Discord channel.
Args: channel: Channel ID or channel name guild_id: Server/guild ID. Required when channel is a name. Falls back to DISCORD_DEFAULT_GUILD_ID. limit: Number of messages to retrieve (default 10, max 50)
Inputs: channel (required), guild_id, limit.
discord_send_embedA
Send a rich embed message to a Discord channel.
Args: channel: Channel ID or channel name title: Embed title description: Embed body text color: Embed color as decimal (e.g. 3447003 for blue) fields: List of field objects with name, value, and optional inline boolean content: Plain text to send alongside the embed guild_id: Server/guild ID. Required when channel is a name. Falls back to DISCORD_DEFAULT_GUILD_ID.
Inputs: channel (required), title (required), description, color, +3 more.
discord_send_messageA
Send a plain text message to a Discord channel.
Args: channel: Channel ID or channel name (e.g. "general" or "123456789") content: The message text to send guild_id: Server/guild ID. Required when channel is a name. Falls back to DISCORD_DEFAULT_GUILD_ID.
Inputs: channel (required), content (required), guild_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: listing channels, reading messages, sending plain messages, and sending rich embeds. There is no functional overlap between these operations, making tool selection straightforward for an agent.
All tools follow a consistent 'discord_verb_noun' naming pattern with snake_case throughout. This predictable structure makes the tool set easy to navigate and understand at a glance.
With 4 tools, the server covers core Discord operations well for its apparent scope of channel/message management. It's slightly lean but reasonable; additional tools like editing/deleting messages or managing reactions could enhance completeness without being essential.
The tool set covers basic read and send operations but has notable gaps for a full Discord interaction surface. Missing are tools for updating/deleting messages, managing reactions, or handling other Discord features like voice channels or user management, which could limit agent workflows.
Related MCP Connectors
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
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.
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Discord channels by sending and reading messages through Discord's API, with a focus on maintaining user control and security.248MIT
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Discord through the Model Context Protocol, providing access to all Discord features like channels, messages, threads, reactions, and roles. Supports secure Discord bot operations with rate limiting, caching, and comprehensive API coverage for OpenAI, LangChain, and other MCP clients.MIT
- AlicenseBqualityBmaintenanceExposes the Discord REST API to AI agents via the Model Context Protocol, enabling message sending and other Discord interactions.222180Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to send and read messages in Discord channels, manage servers, channels, and roles via Discord's API.2MIT