Discord MCP Server
# Discord MCP Server ๐ค๐ฌ
A lightweight, zero-external-dependency [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for interacting with Discord through AI assistants like Google Antigravity, Claude Desktop, Cursor, and other MCP-compliant clients.
## โจ Features
- ๐ฌ **Messages**: Read recent chat history, send messages, reply to threads/messages, edit and delete messages.
- ๐ข **Servers & Guilds**: List servers the bot belongs to, inspect member lists, roles, and guild details.
- ๐ **Channels & Categories**: Inspect channels, channel topics, and message metadata.
- ๐งต **Threads**: Create and participate in channel threads.
- ๐ **Pins**: Read, add, and remove pinned messages.
- ๐ **Reactions**: Add and remove reactions with unicode and custom emojis.
- ๐ **Zero External Dependencies**: Built entirely with Python's standard library (`urllib`, `json`).
---
## ๐ ๏ธ Tool Reference
| Tool | Description |
| :--- | :--- |
| `get_me` | Get profile information and status of the authenticated bot user. |
| `list_guilds` | List all Discord servers (guilds) the bot is a member of. |
| `get_guild` | Get details of a guild (members, roles, channels, emojis). |
| `list_channels` | List all channels in a guild. |
| `get_channel` | Get details of a specific channel or thread. |
| `list_messages` | Retrieve recent messages from a channel (supports `limit`, `before`, `after`, `around`). |
| `get_message` | Retrieve a single message by channel ID and message ID. |
| `send_message` | Send text messages, replies (`reply_to_message_id`), or rich embeds to a channel. |
| `edit_message` | Edit messages sent by the bot. |
| `delete_message` | Delete a message in a channel. |
| `add_reaction` | Add emoji reactions to messages. |
| `delete_reaction` | Remove bot reactions from messages. |
| `list_members` | List members of a guild. |
| `get_pinned_messages` | List all pinned messages in a channel. |
| `pin_message` | Pin a message in a channel. |
| `unpin_message` | Unpin a message in a channel. |
| `create_thread` | Create a new thread in a channel or from an existing message. |
---
## ๐ Quickstart & Configuration
### 1. Prerequisites
- Python 3.10+
- A Discord Bot Token (obtain one from the [Discord Developer Portal](https://discord.com/developers/applications)).
- Ensure your bot has appropriate permissions (e.g. *Read Messages/View Channels*, *Send Messages*, *Read Message History*, *Add Reactions*, etc.).
### 2. Installation & Running
Clone the repository:
```bash
git clone https://github.com/swaritsoni6-lgtm/discord-mcp-server.git
cd discord-mcp-server
```
Set your token and run:
```bash
export DISCORD_BOT_TOKEN="your-bot-token-here"
python3 server.py
```
---
## โ๏ธ Client Configurations
### Antigravity / Gemini CLI (`~/.gemini/config/mcp_config.json`)
```json
{
"mcpServers": {
"discord": {
"command": "python3",
"args": ["/path/to/discord-mcp-server/server.py"],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here"
}
}
}
}
```
### Claude Desktop (`claude_desktop_config.json`)
```json
{
"mcpServers": {
"discord": {
"command": "python3",
"args": ["/path/to/discord-mcp-server/server.py"],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here"
}
}
}
}
```
---
## ๐ License
[MIT License](LICENSE)
TDQS
Scored across 17 tools
Each tool targets a distinct resource-action pair: guild, channel, message, reaction, pin, or thread. Even similar tools like list_messages and get_message are clearly differentiated by scope, so an agent should not confuse them.
All tools follow a consistent snake_case verb_noun pattern, such as get_, list_, send_, edit_, delete_, add_, pin_, and create_. The naming is uniform and predictable across the entire set.
At 17 tools, the server is slightly above the ideal 3-15 tool range but each tool maps to a concrete Discord API operation and earns its place. The count is heavy but still navigable and well-scoped for a Discord bot.
The set covers core Discord workflows well: guild/channel reads, full message CRUD, reactions, pins, and thread creation. Obvious gaps like channel creation/deletion, member management, and thread editing/deleting are notable but not critical for the primary message-interaction use case.