discord-mcp
Reads your Discord conversation history from the local Discord desktop cache and, optionally, falls back to the Discord REST API. Provides tools to list guilds and channels (including categories and forums with cached message counts), read channel messages with author/date filters, fetch a single message with its Discord link and attachments, search messages by text/server/channel/author/date, list and download message attachments, export cached channels or threads to JSON or Markdown, and list/read threads (token required). Cache mode makes zero network requests, while API mode uses a personal token to reach uncached messages.
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-mcpsearch my Discord history for messages mentioning 'roadmap'"
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
An MCP server that lets Claude read your Discord conversation history.
It parses the local Discord desktop cache and, optionally, falls back to the Discord REST API. Cache mode makes zero network requests, so it carries no account-detection risk.
Windows / macOS supported (the on-disk cache format differs per platform and is handled automatically).
🇰🇷 한국어 README: README.ko.md
⚠️ Disclaimer — read before enabling API mode
This tool has two independent modes:
Cache mode (default, safe). Reads files Discord already wrote to your local disk. No API calls, no token, nothing sent to Discord. Only reads channels you have already opened in the Discord app.
API mode (optional, opt-in, your risk). If you set a
DISCORD_TOKEN, the server calls the Discord REST API with your personal user token. This is a self-bot, which violates the Discord Terms of Service and the Developer Policy, and can get your account suspended or terminated. API mode is off until you create a.envwith a token yourself.
Use this software only on your own account and your own data, and only where local law allows. You are solely responsible for how you use it. The authors provide it "as is" with no warranty (see LICENSE). If you do not want the ToS risk, do not configure a token — cache mode works on its own.
Related MCP server: cowork-history
Why
Discord gives you no built-in way to search or summarize your own history from an assistant. The official bot API requires inviting a bot per server and can't reach DMs or read-only servers.
So this reads the cache the Discord desktop app already stores locally. Zero API calls in cache mode → no account detection, no rate limits. Any channel you've opened in the app is readable with no network request.
Only when you explicitly need older messages or threads that aren't cached does the optional token-based REST fallback come into play.
Result: Claude can answer "what was said in this channel yesterday?" purely by reading local files.
Tools
Tool | Description |
| List servers you're in |
| List channels per server (categories & forums, with cached message counts) |
| Read channel messages, with author/date filters |
| Fetch one message by ID, with its Discord link and attachment info |
| Search by text, server, channel, author, or date |
| List a cached message's attachments (size, type, URL) |
| Save a cached Discord CDN file into |
| Export a cached channel/thread to JSON or Markdown in |
| List forum/threads (API token required) |
| Read messages inside a thread |
| Cache statistics + API availability |
Query & file tools
authorinread_messages/search_messagesmatches an author ID, username, or display name exactly.since/untilacceptYYYY-MM-DDor ISO 8601 and are inclusive on both ends; a bare date is interpreted in UTC.search_messagesworks with an emptyquery— filter by channel, author, or date alone. Results and single-message lookups include the Discord message link and attachment metadata.Pass the
attachment_idfromlist_attachments(channel_id, message_id)todownload_attachment. The download tool only accepts Discord CDN URLs that a cached message points to, and caps each file at 100 MiB. Expired or uncached URLs return an error.export_messages(channel_id, format="json")orformat="markdown"saves a cached conversation;author/since/untilfilters apply. Exports are written oldest-message-first.Downloads and exports create local files.
downloads/,exports/, and the original backupbackups/are git-ignored.
File downloads and exports operate on messages present in the cache. Message links use the server link when the guild ID can be found in cache, otherwise a DM style link — so some links may not open.
Install
git clone https://github.com/mu1aq/discord-mcp.git
cd discord-mcp
# or install from releaseWindows (PowerShell 7+):
./install.ps1macOS / Linux:
./install.shWhat the installer does:
Check Python 3.11+
Install dependencies (
mcp[cli],aiohttp)Auto-detect the Discord install / cache location
Pick a target — Claude Code / Codex / both
Claude Code →
~/.claude.jsonCodex →
~/.codex/config.tomlinjects the cache path as
DISCORD_CACHE_DIR
Multiple clients share the same server (identical code). To run non-interactively,
set DISCORD_MCP_TARGET=claude|codex|both.
API mode (optional)
To read messages that aren't cached, set a Discord token. See the disclaimer above first — this is a self-bot and violates Discord's ToS.
cp .env.example .env
# open .env and set DISCORD_TOKENGetting the token:
Log in to the Discord desktop app or discord.com
Ctrl+Shift+I(macOS:Cmd+Option+I) → Network tabClick any channel → click a
/api/v9/request → Headers → copy theAuthorizationvalue
How it works
Discord client → local cache (Chromium Cache)
↓ (1st: zero API calls, undetectable)
MCP Server (localhost)
↓ (2nd: on cache miss, token required)
REST API (rate-limited)
↓
Claude Code / Claude DesktopCache mode: reads messages of channels you've opened in the Discord app, from local files.
Windows: blockfile format (payload brute-scan), macOS: simple cache format
API mode: queries uncached channels/threads via the Discord API (self-bot, ToS-violation risk).
Requirements
Windows or macOS
Python 3.11+
Discord desktop client installed and logged in
Manual install
pip install "mcp[cli]" aiohttpAdd to mcpServers in ~/.claude.json (command is your python path):
{
"discord-cache": {
"command": "python",
"args": ["/path/to/discord-mcp/server.py"],
"timeout": 30000,
"env": { "DISCORD_CACHE_DIR": "<Discord Cache_Data path>" }
}
}Codex — add to ~/.codex/config.toml:
[mcp_servers.discord-cache]
command = "python"
args = ["/path/to/discord-mcp/server.py"]
env = { DISCORD_CACHE_DIR = "<Discord Cache_Data path>" }Default cache path — Windows: %APPDATA%\discord\Cache\Cache_Data,
macOS: ~/Library/Application Support/discord/Cache/Cache_Data.
Use DISCORD_CACHE_DIR for other locations.
Self-check
python test_cache.py
python test_read_features.pyLicense
This server cannot be deployed
Maintenance
Related MCP Connectors
Give Claude only the Google Drive files you choose. Every action logged.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Your own WhatsApp in Claude and ChatGPT: read chats, draft replies, send messages you approve.
1Connect Claude to Fathom meeting recordings, transcripts, and summaries
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to interact with Discord servers, including sending messages, reading channels, managing threads, and adding reactions via natural language commands.10 npmMIT
- AlicenseBqualityCmaintenanceEnables searching and browsing of Claude conversation history with hybrid search combining full-text, Spotlight, and optional vector embeddings.1026 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude to search through its own past sessions using full-text search and resume them. Works offline with zero runtime dependencies.MIT
- AlicenseBqualityBmaintenanceEnables Claude to interact with Discord through natural conversation, including reading and sending messages, managing threads, reacting, searching history, and sending direct messages using a user token.20181 npmMIT