Skip to content

About

MCP server for your own Discord account: QR login, web-client fingerprint, live gateway, unread tracking. Rust. Breaks Discord ToS - use at your own risk.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

discord-mcp

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

⚠️ THIS BREAKS DISCORD'S TERMS OF SERVICE. YOUR ACCOUNT CAN BE BANNED. ⚠️

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.

What it does

  • 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.

Install

Needs a Rust toolchain plus cmake and a C/C++ compiler (for BoringSSL).

cargo install --git https://github.com/hatemosphere/discord-mcp --locked

Add it to your MCP client as a stdio server. Claude Code:

claude mcp add discord -- discord-mcp

Other clients (Claude Desktop, Cursor, ...):

{
  "mcpServers": {
    "discord": { "command": "discord-mcp" }
  }
}

Log in

Either way, scan the code in the Discord mobile app (Settings -> Scan QR Code) and confirm.

  • In a terminal: discord-mcp login prints the QR code.
  • From your MCP client: ask it to log you in to Discord. The discord_login tool 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)

Tools

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).

How it works

  • Requests go through wreq, which reproduces Chrome 154's TLS and HTTP/2 handshake with BoringSSL. Headers, X-Super-Properties and 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_disconnect or 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, which discord_unread, discord_find_user and 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_message can attach any local file the server process can read; your client asks before each send.

Development

cargo test
cargo clippy --all-targets -- -D warnings
cargo deny check advisories bans sources

wreq, 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.

License

No license is granted; all rights reserved.

About

MCP server for your own Discord account: QR login, web-client fingerprint, live gateway, unread tracking. Rust. Breaks Discord ToS - use at your own risk.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages