About Discord MCP Server
Discord MCP Server is an MCP server for sending messages to Discord through a webhook. It is suited to MCP clients that need to post text or Markdown, with webhook configuration via arguments or environment variables.
Key features
- 01Send text messages
- 02Send Markdown messages
- 03Configure via arguments or environment variables
- 04Error handling and retries
Use cases
- 01Post notifications to Discord from an MCP client
- 02Send formatted Markdown content
MCP support
It exposes the `send_message` tool over MCP so clients can send text or Markdown messages to a Discord webhook.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDiscord MCP Server
一个基于 MCP 的 Discord webhook 服务器,用于通过 MCP 接口发送消息到 Discord。
功能特性
- 支持发送文本消息
- 支持发送 Markdown 格式消息
- 通过 MCP 提供标准化的 API 接口
- 支持命令行参数和环境变量配置
- 自动错误处理和重试机制
安装
pip install discord-mcp-server
使用方法
1. 配置 Discord Webhook URL
可以通过以下两种方式设置 Discord webhook URL:
- 环境变量方式:
export DISCORD_WEBHOOK_URL="your-discord-webhook-url"
- 命令行参数方式:
discord-mcp-server "your-discord-webhook-url"
2. 运行服务器
使用 uvx 运行服务器:
uvx discord-mcp-server@latest
3. MCP 接口说明
服务器提供以下 MCP 工具:
send_message: 发送消息到 Discord- 参数:
content: 消息内容(必需)msg_type: 消息类型,支持 "text" 或 "markdown"(可选,默认为 "text")
- 参数:
环境变量
DISCORD_WEBHOOK_URL: Discord webhook URL(必需)
错误处理
服务器会自动处理以下错误情况:
- 无效的 webhook URL
- 网络连接问题
- 消息发送失败
- 无效的消息类型
开发
项目结构
discord-mcp-server/
├── src/
│ ├── __init__.py
│ └── discord_mcp_server.py
├── pyproject.toml
└── README.md
依赖项
- fastapi>=0.68.0
- uvicorn>=0.15.0
- pydantic>=2.0.0
- requests>=2.31.0
- mcp[cli]>=1.6.0
许可证
MIT License
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.