An MCP server that gives Claude and other MCP clients access to your own Discord account: servers, channels, DMs, search, unread messages, and sending as you. Written in Rust on the official rmcp SDK.
Caution
Discord does not allow automating user accounts ("self-bots") or using unofficial clients. This project logs in as you and acts as you. Discord can detect this and suspend or permanently ban the account, without warning and without appeal.
- Do not use it with an account you can't afford to lose.
- Third-party clients like discordo, Dissent and Abaddon carry the same risk.
- The authors take no responsibility for what happens to your account. Use at your own risk.
- Logs in like the desktop app: scan a QR code with the Discord mobile app. No password, no copying tokens out of devtools. The token goes straight into the OS keychain.
- Looks like the web app: Chrome's TLS and HTTP/2 fingerprint, the web app's headers in Chrome's order, the live client build number, and a real gateway session.
- Knows what's unread: keeps a gateway connection like an open client does, and answers "what did I miss" from Discord's own read state and your recent mentions.
- Modern MCP: speaks protocol
2026-07-28(stateless, multi round-trip requests) and falls back to older versions; tools return structured output with schemas and read/write annotations.
Needs a Rust toolchain plus cmake and a C/C++ compiler (for BoringSSL).
cargo install --git https://github.com/hatemosphere/discord-mcp --lockedAdd it to your MCP client as a stdio server. Claude Code:
claude mcp add discord -- discord-mcpOther clients (Claude Desktop, Cursor, ...):
{
"mcpServers": {
"discord": { "command": "discord-mcp" }
}
}Either way, scan the code in the Discord mobile app (Settings -> Scan QR Code) and confirm.
- In a terminal:
discord-mcp loginprints the QR code. - From your MCP client: ask it to log you in to Discord. The
discord_logintool serves the QR code on a local page (http://127.0.0.1:<port>/) and asks the client to open it. If the client can't open links, it gives you the URL instead.
The token is stored in the OS keychain (macOS Keychain, Windows Credential Manager, Secret Service
on Linux). DISCORD_TOKEN overrides it. If Discord rejects the token later, the next tool call asks
you to log in again.
discord-mcp status # who is logged in
discord-mcp logout # delete the stored token
discord-mcp login --token # paste a token instead (e.g. when QR login hits a captcha)| Tool | What it does |
|---|---|
discord_login |
QR login, or report who is logged in |
discord_list_guilds |
Servers you're in |
discord_list_channels |
A server's channels in sidebar order, optionally filtered by name |
discord_list_dms |
DMs and group DMs, most recent first |
discord_list_threads |
Threads and forum posts of a channel, with the start of each post |
discord_list_pins |
Pinned messages of a channel |
discord_read_messages |
Messages of a channel, thread or DM, paged with before/after/around |
discord_search_messages |
Discord search: text, author, mentions (incl. me), attachments, date range, pinned |
discord_recent_mentions |
Messages that mentioned you in the last 7 days |
discord_unread |
Channels and DMs with unread messages, mentions first |
discord_find_user |
User IDs by name, among friends, DMs and a server's members |
discord_send_message |
Send or reply as you, optionally with local files attached |
discord_edit_message |
Edit your message |
discord_delete_message |
Delete your message (or others', where you can manage messages) |
discord_add_reaction |
React to a message |
discord_disconnect |
Close the live connection so you appear offline |
Write tools are annotated as such, so clients ask before sending, editing or deleting. Mentions,
replies and forwards are made readable (@name, #channel, a preview of the replied-to message).
- Requests go through wreq, which reproduces Chrome 154's
TLS and HTTP/2 handshake with BoringSSL. Headers,
X-Super-Propertiesand cookies match the web app on Windows; the client build number is read from discord.com on startup. - The gateway connects on the first tool call and stays connected until
discord_disconnector the MCP client exits, so you show as online while it runs (with your saved status). It keeps read states, channel and role names and known users current, whichdiscord_unread,discord_find_userand mention names rely on. Everything else uses the REST API. - Reading never marks anything as read: the server doesn't acknowledge messages.
- Message content is untrusted. The server tells the model never to follow instructions found in messages, but treat what other people write as potential prompt injection.
discord_send_messagecan attach any local file the server process can read; your client asks before each send.
cargo test
cargo clippy --all-targets -- -D warnings
cargo deny check advisories bans sourceswreq, wreq-util and btls are pinned to git commits because Chrome 152+ TLS support isn't on
crates.io yet. To move to a newer Chrome, bump those revisions and the profile, user agent and
sec-ch-ua values in src/browser.rs.
Discord's undocumented user API is described at docs.discord.food; discordo and yapfast were references for the login flow and client fingerprint.
No license is granted; all rights reserved.