Discord MCP Server
Enables sending and receiving messages, listing guilds and channels, and monitoring bot responses via a user account, facilitating real-time testing of Discord bot commands.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Discord MCP Server for VS Code
An MCP (Model Context Protocol) server that lets VS Code Copilot (or any MCP-compatible agent) send and receive Discord messages as your own user account — enabling real-time testing of Discord bot commands directly from your editor.
⚠️ Discord ToS Notice: Automating a user account ("self-botting") is against Discord's Terms of Service. This tool is intended strictly for local development/testing of your own bots on your own servers. Do not use it for spam, abuse, or on servers you don't control. Use at your own risk.
Why a user account?
Many bot commands check server state tied to the command invoker — e.g., message.member.voice.channel to verify the user is in a voice channel before playing audio. A separate bot account cannot satisfy these checks. Messages must originate from your real Discord user to test these commands properly.
Related MCP server: discord-mcp
Prerequisites
Node.js 18+ (uses native
fetch)VS Code with GitHub Copilot (or another MCP host like Claude Desktop / Cursor)
Your Discord user token (see below)
Obtaining your Discord user token
Open Discord in a browser or the desktop app
Open Developer Tools (
F12/Ctrl+Shift+I)Go to the Network tab
Perform any action in Discord (send a message, switch channels)
Find any request to
discord.com/apiCopy the
Authorizationheader value — that's your user token
Your user token grants full access to your Discord account. Treat it like a password and never commit it to version control.
Installation
# 1. Clone the repository
git clone https://github.com/masonbesmer/code-discord-mcp.git
cd code-discord-mcp
# 2. Install dependencies
npm install
# 3. Build
npm run build
# 4. Set your Discord user token
cp .env.example .env
# Edit .env and set DISCORD_USER_TOKEN=your-token-hereVS Code Integration
The repository includes .vscode/mcp.json which automatically registers the server with VS Code. The server reads your token from the DISCORD_USER_TOKEN environment variable.
Make sure the variable is set in your shell before launching VS Code:
# macOS / Linux
export DISCORD_USER_TOKEN="your-token-here"
code .
# Windows PowerShell
$env:DISCORD_USER_TOKEN = "your-token-here"
code .Available Tools
Tool | Description |
| Send a text message to a Discord channel |
| Read recent messages from a channel |
| Send a command and wait for a bot response |
| List channels in a guild |
| List guilds your account is in |
| Delete a message (with confirmation prompt) |
Available Resources
Resource | Description |
| Channel list for a guild |
| Last 25 messages in a channel |
Example Workflow
Open your Discord bot project in VS Code
Start a Copilot Chat session in Agent Mode
Ask: "Send
!helpto my #bot-testing channel and show me what my bot responds with"Copilot will:
Call
list_guildsto find your serverCall
list_channelsto find#bot-testingCall
wait_for_responsewith!helpShow you the bot's response inline in the chat
Development
# Watch mode (recompiles on file changes)
npm run dev
# Run tests
npm test
# Debug with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsSecurity
Concern | Mitigation |
Token exposure | Read from env var only; never logged or returned in responses; |
Discord ToS | Local dev/testing on your own servers only |
Rate limiting | Automatic retry after |
Accidental pings |
|
Destructive actions |
|
Stdout pollution | All diagnostic output goes to stderr; stdout is reserved for MCP JSON-RPC |
Dependencies
Package | Purpose |
| MCP server framework (stdio transport, tool registration) |
| Input schema validation |
| TypeScript compiler |
| Node.js type definitions |
| Test runner |
No Discord library needed. All Discord API calls use Node 18+ native
fetch.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Discord by sending notifications, creating channels, and managing interactive questions with support for two-way responses. It allows for streamlined communication through channel keys and supports various question types like multiple-choice and extended-answer modals.-
- 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).817 npm1MIT
- 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.23 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to send and read messages in Discord channels, manage servers, channels, and roles via Discord's API.14 npm2MIT