discord-mcp
A Model Context Protocol server that gives AI assistants full access to Discord via a user token, enabling reading and sending messages, managing threads, reacting, searching history, sending DMs, and more.
README
<div align="center">
๐ค Discord MCP Server
Give Claude full access to Discord.
Read messages, send messages, manage threads, react, search history, send DMs โ all through natural conversation.
</div>
What is this?
Discord MCP Server is a Model Context Protocol server that bridges Claude and Discord. Once connected, you can talk to Claude in plain English and it will interact with your Discord account โ no scripting, no dashboards, no manual API calls.
Uses a Discord user token โ no bot registration needed.
Demo
You: "What are the last 15 messages in #general?"
You: "Send a message to #announcements: deployment done โ
"
You: "Search #support for messages about 'login error'"
You: "DM user 123456789 and say hey, got a minute?"
You: "Create a thread called 'Release notes' from that last message"
You: "What are my recent mentions across all servers?"
You: "React to message 987654321 with ๐"
Tools
| Tool | Description |
|---|---|
get_bot_info |
Connected account info (username, ping, server count) |
list_guilds |
All Discord servers you're in |
get_guild_info |
Server details: members, boosts, verification level, etc. |
list_channels |
All channels in a server, sorted by position |
get_channel_info |
Info about a specific channel |
get_messages |
Fetch recent messages (up to 100), with pagination |
send_message |
Send a message, with optional reply |
send_embed |
Send a rich embed (title, description, fields, color, footer) |
edit_message |
Edit one of your own messages |
delete_message |
Delete a message |
pin_message |
Pin or unpin a message |
add_reaction |
React with a Unicode or custom emoji |
create_thread |
Start a thread from a message or create a standalone one |
list_members |
List server members with roles (up to 1 000) |
get_user_info |
Full profile of a user in a server |
search_messages |
Keyword search across recent channel history |
get_pinned_messages |
All pinned messages in a channel |
get_dm_channels |
List your open DM conversations |
send_dm |
Send a direct message to any user by ID |
get_mentions |
Recent messages that mention you across all servers |
Requirements
- Node.js 18+
- Your Discord user token
Setup
1. Get your Discord User Token
- Open Discord in your browser at discord.com/app
- Press
F12โ Network tab - Send any message or switch a channel
- Find any request to
discord.com/api, click it, look at Request Headers - Copy the value of the
Authorizationheader โ that's your token
Or paste this in the browser Console:
(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m)
.find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken()
โ ๏ธ Your user token = your password. Never share it, commit it to git, or put it in public config files.
2. Install
git clone https://github.com/vovafes/discord-mcp-server.git
cd discord-mcp-server
npm install
npm run build
3. Connect to Claude Desktop
Edit your Claude Desktop config:
- macOS โ
~/Library/Application Support/Claude/claude_desktop_config.json - Windows โ
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["/absolute/path/to/discord-mcp-server/dist/index.js"],
"env": {
"DISCORD_USER_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}
Restart Claude Desktop โ the Discord tools will appear automatically.
4. Connect to Claude Code CLI
claude mcp add discord \
--env DISCORD_USER_TOKEN=YOUR_TOKEN_HERE \
-- node /absolute/path/to/discord-mcp-server/dist/index.js
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_USER_TOKEN |
โ | โ | Your Discord user token |
REQUEST_DELAY_MS |
โ | 5000 |
Delay between REST calls in ms. Lower = faster, higher = safer. |
Rate-Limit Protection
Discord enforces strict limits on user tokens. Three layers of protection are built in:
Global throttle
Every REST call passes through a shared gate that enforces a minimum gap of REQUEST_DELAY_MS (default 5 seconds) between consecutive requests.
Exponential back-off
On a 429 Too Many Requests response, the server automatically retries:
attempt 1 โ wait 2s
attempt 2 โ wait 4s
attempt 3 โ wait 8s
attempt 4 โ wait 16s (then give up)
Hard scan caps
Bulk tools that touch many channels are capped to prevent runaway API storms:
| Tool | Limit |
|---|---|
search_messages |
Max 500 messages (5 batches ร 100) |
get_mentions |
Max 20 channels scanned across all servers |
To tune the throttle:
"env": {
"DISCORD_USER_TOKEN": "...",
"REQUEST_DELAY_MS": "2000"
}
Architecture
โโโโโโโโโโโโโโโโโโโโ
โ Claude / MCP โ
โ Client โ
โโโโโโโโโโคโโโโโโโโโโ
โ stdio (JSON-RPC)
โโโโโโโโโโผโโโโโโโโโโ
โ discord-mcp โ โ this server
โ (Node.js) โ
โโโโโโโโโโคโโโโโโโโโโ
โ discord.js (WebSocket + REST)
โโโโโโโโโโผโโโโโโโโโโ
โ Discord API โ
โโโโโโโโโโโโโโโโโโโโ
The server speaks MCP over stdio โ no open ports, no HTTP server. The MCP host (Claude Desktop, Claude Code, etc.) spawns it as a subprocess.
Development
# Dev mode โ no build step needed
DISCORD_USER_TOKEN=your_token npm run dev
# Build
npm run build
# Run built output
DISCORD_USER_TOKEN=your_token npm start
<div align="center">
Made by Claude for Claude ๐ค
Built with discord.js ยท Model Context Protocol SDK
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.