discord-mcp-agent
Enables AI agents to communicate with users through Discord, supporting sending messages, files, embeds, screenshots, and interactive question-asking with reaction-based controls.
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-mcp-agent ask the user if they want to proceed with deployment"
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 Agent
A Model Context Protocol (MCP) server for Discord-based AI agent-user communication. Enables AI agents to communicate with users through Discord instead of IDE chat interfaces.
Table of Contents
Related MCP server: MCP-Discord
Quick Start
Installation
# Using uvx (recommended - no install needed)
uvx discord-mcp-agent
# Or install via pip
pip install discord-mcp-agent
# For screenshot support
pip install discord-mcp-agent[screenshot]VS Code / GitHub Copilot
Add to .vscode/mcp.json:
{
"servers": {
"discord": {
"type": "stdio",
"command": "uvx",
"args": ["discord-mcp-agent"],
"env": {
"DISCORD_TOKEN": "your-bot-token",
"DISCORD_GUILD_ID": "your-server-id",
"DISCORD_CHANNEL": "general"
}
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"discord": {
"command": "uvx",
"args": ["discord-mcp-agent"],
"env": {
"DISCORD_TOKEN": "your-bot-token",
"DISCORD_GUILD_ID": "your-server-id",
"DISCORD_CHANNEL": "general"
}
}
}
}Discord Bot Setup
Go to Discord Developer Portal
Click New Application → Give it a name → Create
Go to Bot section → Click Add Bot
Copy the Bot Token (keep this secret!)
Enable under Privileged Gateway Intents:
✅ Message Content Intent
Go to OAuth2 → URL Generator:
Scopes:
botBot Permissions:
Send Messages,Read Message History,Add Reactions,Attach Files
Copy the generated URL and open it to invite the bot to your server
Get your Server ID: Enable Developer Mode in Discord settings, right-click your server → Copy ID
⚠️ Security Warning: Never commit your bot token to version control! Use environment variables or
.envfiles.
Tools Reference
discord_ask
Send a question and wait for user response. Supports reaction-based interactions.
Parameter | Type | Required | Description |
| string | ✅ | The question to ask user |
Reactions automatically added:
📷 Take screenshot
❌ Cancel request
Response format:
{
"text": "User's response text",
"attachments": [{ "filename": "...", "url": "..." }],
"cancelled": false
}discord_notify
Send a notification (no response expected).
Parameter | Type | Required | Description |
| string | ✅ | The message to send |
discord_send_file
Send a file to the user.
Parameter | Type | Required | Description |
| string | ✅ | Absolute path to the file |
| string | ❌ | Optional message with the file |
discord_screenshot
Take and send a desktop screenshot.
Parameter | Type | Required | Description |
| string | ❌ | Optional message with the screenshot |
Requires
pip install discord-mcp-agent[screenshot]
discord_embed
Send a rich embed message with full formatting.
Parameter | Type | Required | Description |
| string | ❌ | Embed title |
| string | ❌ | Main content |
| integer | ❌ | Hex color (default: |
| array | ❌ | Array of |
| string | ❌ | Footer text |
| string | ❌ | Small image (top-right) |
| string | ❌ | Large image (bottom) |
| string | ❌ | Author name (top) |
| string | ❌ | Title link URL |
Reaction Features
Every message from the bot includes interactive reaction buttons:
Emoji | Action | Description |
📷 | Screenshot | Takes a screenshot and sends it to Discord |
❌ | Cancel | Cancels the current |
⏳ | Timeout | Added automatically when a request times out |
How It Works
Bot sends a message with 📷 and ❌ reactions
User can click reactions to trigger actions
📷 immediately captures and sends a screenshot
❌ cancels waiting and returns
"cancelled": true
Configuration
Environment Variables
Variable | Required | Default | Description |
| ✅ | - | Your Discord bot token |
| ✅ | - | Your Discord server ID |
| ❌ |
| Channel name to use |
| ❌ | - | Custom text appended to all responses |
| ❌ |
| Seconds to wait for user response |
| ❌ |
| Seconds for HTTP operations |
| ❌ |
| Seconds to establish connection |
Custom Reminder
Inject custom instructions into every tool response:
{
"env": {
"DISCORD_REMINDER": "Remember: Always confirm with the user before completing tasks."
}
}Timeout Configuration
Adjust timeouts for your use case:
{
"env": {
"DISCORD_ASK_TIMEOUT": "600",
"DISCORD_HTTP_TIMEOUT": "60"
}
}Usage Examples
MCP Tool Call: Ask Question
{
"name": "discord_ask",
"arguments": {
"question": "What color theme would you like for the dashboard?"
}
}Response:
{
"text": "I'd prefer a dark theme with blue accents",
"attachments": [],
"cancelled": false
}MCP Tool Call: Send Embed
{
"name": "discord_embed",
"arguments": {
"title": "Build Complete ✅",
"description": "Your project has been successfully built.",
"color": 5763719,
"fields": [
{ "name": "Duration", "value": "2m 34s", "inline": true },
{ "name": "Size", "value": "1.2 MB", "inline": true }
],
"footer": "Built with discord-mcp-agent"
}
}Handling Image Attachments
When users send images in response to discord_ask, they're automatically:
Downloaded from Discord
Encoded as base64
Returned as
ImageContentfor AI model consumption
Troubleshooting
Error | Cause | Solution |
| Missing token | Set |
| Bot not in server | Invite bot using OAuth2 URL |
| Wrong channel name | Check |
| Network/token issue | Verify token and network connectivity |
| Screenshot dep missing | Run |
| User didn't respond | Increase |
Common Issues
Bot appears offline:
Ensure
Message Content Intentis enabled in Discord Developer PortalCheck that the bot token is correct
Bot can't see messages:
Enable
Message Content Intentin bot settingsEnsure bot has
Read Message Historypermission
Screenshots not working:
Install Pillow:
pip install discord-mcp-agent[screenshot]On Linux, may require display server access
Requirements
Python 3.10+
mcp >= 1.0.0discord.py >= 2.0.0pydantic >= 2.0.0aiohttp >= 3.8.0Pillow >= 10.0.0(optional, for screenshots)
Security
⚠️ Never commit your Discord bot token to version control!
Use environment variables or
.envfilesAdd
.envto.gitignoreRegenerate token immediately if exposed
Contributing
Contributions are welcome!
Fork the repository
Create your feature branch
Add tests for new features
Submit a pull request
Development Setup
git clone https://github.com/zebbern/discord-mcp-agent.git
cd discord-mcp-agent
pip install -e ".[dev]"
pytest tests/ -vLinks
Made with ❤️ for the MCP community
Available Tools
5 toolsdiscord_askA
Send a question to the user via Discord and wait for their response. User can react with ❌ to cancel or 📷 for screenshot.
Inputs: question (required).
discord_embedC
Send a rich embed message to Discord with title, description, color, fields, and more.
Inputs: title, description, color, fields, +5 more.
discord_notifyA
Send a notification to the user via Discord. Does not wait for a response.
Inputs: message (required).
discord_screenshotB
Take a screenshot of the entire desktop and send it to Discord.
Inputs: message.
discord_send_fileB
Send a file to the user via Discord.
Inputs: file_path (required), message.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: ask waits for a response, embed sends a rich embed, notify sends without response, screenshot captures desktop, send_file sends a file. No overlap.
All tools follow the consistent pattern 'discord_<verb>' with clear action verbs (ask, embed, notify, screenshot, send_file). No mixed conventions.
5 tools is well-suited for a Discord interaction server, covering sending messages, files, screenshots, and interactive questions without bloat or insufficiency.
Covers core Discord communication needs, but a simple 'send_message' tool is missing; however, discord_notify may serve that purpose. Minor gap.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI dialogue using various LLM models via AceDataCloud
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol (MCP) server for the Discord integration with MCP-compatible applications like Claude Desktop.612MIT
- AlicenseCqualityBmaintenanceA Discord Model Context Protocol server that enables AI assistants to interact with Discord, providing functionality for sending messages, managing channels, handling forum posts, and working with reactions.461,560 npm113MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server for coordinating work between multiple AI agents in monorepos and shared codebases using a simple file-based signaling system or Discord thread chat.718 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA Discord bot server based on Model Context Protocol (MCP), enabling AI models to interact with Discord through the MCP protocol.2MIT