discord-user-connector
Provides tools for interacting with a Discord user account, enabling AI agents to read servers, channels, DMs, mentions, and message history, with optional capabilities to send, edit, or delete messages and react.
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-user-connectorcheck my recent mentions and show me the last one"
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-user-connector
A Model Context Protocol (MCP) server that gives AI agents access to a Discord user account (not a bot account). It talks to the same REST API the official client uses, sends client-like headers, and exposes it as a set of clean, agent-friendly tools.
Run it with Bun. Point your MCP client at it, give it your Discord token, and your agent can read your servers, channels, DMs, mentions and message history — or even send messages on your behalf if you opt in.
Warning — read this first
Using a user token for automation is against the Discord Terms of Service. This is self-bot territory. Accounts that get flagged can lose their token or be suspended without warning — this server paces its requests and mimics a normal client, but there is no safe option, only a less risky one. Use a throwaway or low-value account, never your main one.
Your token is the password to your account. Never paste it into a chat, commit it to a repo, or give it to an MCP server you do not control. Keep it in an environment variable only.
Related MCP server: poke_discord
Features
All tools are prefixed discord_ by the MCP client.
Read (always enabled):
Tool | What it does |
| Your account profile |
| Public profile of any user (bio, badges, connections) |
| Servers you are in; details of one server |
| Channels of a server (text, voice, forum, ...); details of one channel |
| Guild member list, member search, single member |
| Server extras |
| Who is currently in voice channels |
| Your DM and group DM channels |
| Channel history (accepts message IDs or ISO dates as cursors); single message |
| Full-text search within a guild, filterable by author/channel/date |
| Threads and pins of a channel |
| Recent messages that mention you |
| Dump a channel's history to a local markdown file (up to 10k messages) |
| Download any attachment URL to disk |
Write (opt-in, disabled by default):
Set DISCORD_MCP_WRITE=1 to register these:
Tool | What it does |
| Send in a channel or DM |
| Edit or delete messages |
| React / unreact |
| Trigger the typing indicator |
Setup
Requires Bun 1.1+.
git clone https://github.com/Wqffles-com/discord-user-connector
cd discord-user-connector
bun installGet your token: open the Discord web app in a browser, open DevTools, go to the Network tab, click around in Discord, open any request to /api/v9/..., and copy the Authorization header value. That string is your token.
Then configure your MCP client. For opencode, in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"discord": {
"type": "local",
"command": ["bun", "run", "/path/to/discord-user-connector/src/index.ts"],
"enabled": true,
"timeout": 600000,
"environment": {
"DISCORD_TOKEN": "{env:DISCORD_TOKEN}"
}
}
}
}The {env:DISCORD_TOKEN} placeholder is resolved from the environment opencode runs in, so the token never lives in the config file. For other clients (Claude Desktop, Cursor, ...), the shape is the same:
{
"mcpServers": {
"discord": {
"command": "bun",
"args": ["run", "/path/to/discord-user-connector/src/index.ts"],
"env": { "DISCORD_TOKEN": "your-user-token" }
}
}
}Development
bun run check # typecheck
bun test # unit tests
bun run start # run the server on stdioThe REST client automatically handles 429 rate limits (backs off and retries), 5xx responses, per-request timeouts, and paces all requests with a configurable minimum delay (default 350 ms).
Disclaimer
This project is for accessing your own account's data. It is not affiliated with or endorsed by Discord. Use it at your own risk — you are responsible for what your agent does with your account, including everything it sends and deletes.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Connect AI agents to 1000+ apps with managed authentication and tool-calling.
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
- BankSyncOAuthio.banksync
Connect AI agents to bank accounts, transactions, balances, and investments.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables LLMs to read and send Discord messages, list servers and channels, and monitor unread messages via a selfbot that uses a user token (violates Discord ToS).821 npm1MIT
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Discord through natural language, including reading and sending messages, managing servers, and user actions.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Discord through the REST API and real-time events, supporting message management, user info, channel operations, and more with security controls.6 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to send and read messages in Discord channels, manage servers, channels, and roles via Discord's API.9 npm2MIT