Skip to main content
Glama

Discord MCP Agent

PyPI Python License

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

  1. Go to Discord Developer Portal

  2. Click New Application → Give it a name → Create

  3. Go to Bot section → Click Add Bot

  4. Copy the Bot Token (keep this secret!)

  5. Enable under Privileged Gateway Intents:

    • ✅ Message Content Intent

  6. Go to OAuth2URL Generator:

    • Scopes: bot

    • Bot Permissions: Send Messages, Read Message History, Add Reactions, Attach Files

  7. Copy the generated URL and open it to invite the bot to your server

  8. 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 .env files.

Tools Reference

discord_ask

Send a question and wait for user response. Supports reaction-based interactions.

Parameter

Type

Required

Description

question

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

message

string

The message to send

discord_send_file

Send a file to the user.

Parameter

Type

Required

Description

file_path

string

Absolute path to the file

message

string

Optional message with the file

discord_screenshot

Take and send a desktop screenshot.

Parameter

Type

Required

Description

message

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

title

string

Embed title

description

string

Main content

color

integer

Hex color (default: 0x5865F2)

fields

array

Array of {name, value, inline} objects

footer

string

Footer text

thumbnail_url

string

Small image (top-right)

image_url

string

Large image (bottom)

author_name

string

Author name (top)

url

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 discord_ask and returns control

Timeout

Added automatically when a request times out

How It Works

  1. Bot sends a message with 📷 and ❌ reactions

  2. User can click reactions to trigger actions

  3. 📷 immediately captures and sends a screenshot

  4. ❌ cancels waiting and returns "cancelled": true

Configuration

Environment Variables

Variable

Required

Default

Description

DISCORD_TOKEN

-

Your Discord bot token

DISCORD_GUILD_ID

-

Your Discord server ID

DISCORD_CHANNEL

general

Channel name to use

DISCORD_REMINDER

-

Custom text appended to all responses

DISCORD_ASK_TIMEOUT

300

Seconds to wait for user response

DISCORD_HTTP_TIMEOUT

30

Seconds for HTTP operations

DISCORD_CONNECTION_TIMEOUT

30

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:

  1. Downloaded from Discord

  2. Encoded as base64

  3. Returned as ImageContent for AI model consumption

Troubleshooting

Error

Cause

Solution

DISCORD_TOKEN environment variable is required

Missing token

Set DISCORD_TOKEN in your MCP config

Guild with ID X not found

Bot not in server

Invite bot using OAuth2 URL

Channel 'X' not found in guild

Wrong channel name

Check DISCORD_CHANNEL matches exactly

Failed to connect within 30 seconds

Network/token issue

Verify token and network connectivity

PIL not installed

Screenshot dep missing

Run pip install discord-mcp-agent[screenshot]

⏳ No response received within X seconds

User didn't respond

Increase DISCORD_ASK_TIMEOUT or user can click ❌

Common Issues

Bot appears offline:

  • Ensure Message Content Intent is enabled in Discord Developer Portal

  • Check that the bot token is correct

Bot can't see messages:

  • Enable Message Content Intent in bot settings

  • Ensure bot has Read Message History permission

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

  • discord.py >= 2.0.0

  • pydantic >= 2.0.0

  • aiohttp >= 3.8.0

  • Pillow >= 10.0.0 (optional, for screenshots)

Security

⚠️ Never commit your Discord bot token to version control!

  • Use environment variables or .env files

  • Add .env to .gitignore

  • Regenerate token immediately if exposed

Contributing

Contributions are welcome!

  1. Fork the repository

  2. Create your feature branch

  3. Add tests for new features

  4. 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/ -v

Made with ❤️ for the MCP community

Available Tools

5 tools
discord_askA

Send a question to the user via Discord and wait for their response. User can react with ❌ to cancel or 📷 for screenshot.

ParametersJSON Schema
NameRequiredDescriptionDefault
questionYesThe question to ask the user

TDQS

A4.4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
titleNoThe embed title
descriptionNoThe main embed description/content
colorNoEmbed color as integer (e.g., 0xFF0000 for red). Default: Discord blurple
fieldsNoArray of field objects with 'name', 'value', and optional 'inline' (boolean)
footerNoFooter text
thumbnail_urlNoURL for thumbnail image (small, top-right)
image_urlNoURL for main embed image (large, bottom)
author_nameNoAuthor name shown at top of embed
urlNoURL that the title links to

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to send

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageNoOptional message to accompany the screenshot

TDQS

B3/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to send
messageNoOptional message to accompany the file

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency5/5

All tools follow the consistent pattern 'discord_<verb>' with clear action verbs (ask, embed, notify, screenshot, send_file). No mixed conventions.

Tool Count5/5

5 tools is well-suited for a Discord interaction server, covering sending messages, files, screenshots, and interactive questions without bloat or insufficiency.

Completeness4/5

Covers core Discord communication needs, but a simple 'send_message' tool is missing; however, discord_notify may serve that purpose. Minor gap.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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