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 "Install 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-agentask 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.
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | The question to ask the user |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses waiting for response and user reactions (cancel, screenshot). Lacks details on timeout or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, 24 words, front-loaded purpose. Every sentence earns its place with no waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description covers purpose, behavior, and parameter context. Could mention what result returns (e.g., response text) but strong overall.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with parameter described as 'The question to ask the user'. Description adds context about waiting and reactions, enhancing understanding beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool sends a question and waits for response, with specific verb and resource. It distinguishes from siblings like discord_notify (no wait) and discord_screenshot (takes screenshot).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for interactive queries by mentioning waiting for response and cancellation/screenshot reactions. It does not explicitly state when not to use or name alternatives, but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discord_embedC
Send a rich embed message to Discord with title, description, color, fields, and more.
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | The embed title | |
| description | No | The main embed description/content | |
| color | No | Embed color as integer (e.g., 0xFF0000 for red). Default: Discord blurple | |
| fields | No | Array of field objects with 'name', 'value', and optional 'inline' (boolean) | |
| footer | No | Footer text | |
| thumbnail_url | No | URL for thumbnail image (small, top-right) | |
| image_url | No | URL for main embed image (large, bottom) | |
| author_name | No | Author name shown at top of embed | |
| url | No | URL that the title links to |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully convey behavioral traits. It only states the action without disclosing limits, authentication needs, error behavior, or response format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one sentence, concise at 14 words, and front-loads the purpose. It could be slightly expanded without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 9 optional parameters and no output schema, the description lacks context about default values, constraints, or expected behavior. Incomplete for practical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptive parameter names and descriptions. The description adds a high-level listing of parameters but no additional semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb (send), the resource (rich embed message to Discord), and lists key components (title, description, color, fields). It distinguishes from sibling tools like discord_ask and discord_send_file, though not explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives such as discord_notify or discord_ask. No when/when-not instructions provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discord_notifyA
Send a notification to the user via Discord. Does not wait for a response.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to send |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It covers the key aspect that no response is awaited, but omits other common details like error handling, rate limits, or required permissions. For a simple notification tool, this is adequate but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise, front-loaded sentences with no extraneous information. Every word contributes to the understanding of the tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema), the description is nearly complete. It covers the main action and response behavior. Minor missing details (e.g., whether message length is limited) prevent a perfect score.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the input schema already explains the 'message' parameter. The description adds no additional meaning beyond what the schema provides, meeting the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the action ('Send a notification') and the target ('via Discord'). The additional note 'Does not wait for a response' distinguishes it from siblings like discord_ask, making purpose and differentiation explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for one-way messages by noting it does not wait for a response, but it does not explicitly state when to use this tool vs alternatives (e.g., 'Use discord_ask for interactive prompts'). Guidance is only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discord_screenshotB
Take a screenshot of the entire desktop and send it to Discord.
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Optional message to accompany the screenshot |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description gives minimal behavioral context—it doesn't specify scope (full desktop, multi-monitor), permissions, file size limits, or delivery confirmation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is concise but lacks structure and offers no additional detail; could be improved by highlighting key constraints.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite low complexity (one optional param, no output schema), the description omits important details like delivery behavior or whether the screenshot is of the entire screen or a window.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the one optional parameter, so baseline is 3; the description adds nothing beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (take a screenshot) and the target (send to Discord), distinguishing it from sibling tools like discord_send_file which are for general file sending.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives; no mention of prerequisites, contexts, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discord_send_fileB
Send a file to the user via Discord.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the file to send | |
| message | No | Optional message to accompany the file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description lacks details on side effects, limitations (e.g., file size), or behavioral traits. It is unclear if the file is sent in a DM or channel, or what happens if the file doesn't exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that conveys the core purpose without unnecessary words. However, it could include more context without becoming verbose, hence not a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema and annotations, the description is insufficient. It does not explain return values, error handling, or the exact mechanism of delivery, leaving gaps for the agent to infer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with basic parameter descriptions. The tool description does not add additional meaning beyond what the schema already provides, but it also doesn't omit anything. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (send) and resource (file), and specifies the platform (Discord), distinguishing it from sibling tools like discord_ask (asking questions) and discord_notify (sending notifications).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives or any context-specific usage. There is no mention of prerequisites, when not to use, or comparison with siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.469MIT
- AlicenseAqualityAmaintenanceA 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.30221,062103MIT
- AlicenseBqualityCmaintenanceA 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.7181MIT
- AlicenseNot gradedqualityDmaintenanceA Discord bot server based on Model Context Protocol (MCP), enabling AI models to interact with Discord through the MCP protocol.2MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zebbern/discord-mcp-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server