使用说明
断开MCP服务器
一个模型上下文协议(MCP)服务器,为Claude Desktop等MCP客户端提供Discord集成功能。
可用工具
服务器信息
list_servers:列出可用服务器get_server_info:获取详细的服务器信息get_channels:列出服务器中的频道list_members:列出服务器成员及其角色get_user_info:获取用户的详细信息
消息管理
send_message:向频道发送消息read_messages:读取最近的消息历史记录add_reaction:在消息中添加反应add_multiple_reactions:在消息中添加多个反应remove_reaction:从消息中删除反应moderate_message:删除消息和超时用户
渠道管理
create_text_channel:创建新的文本频道delete_channel:删除现有频道
角色管理
add_role:向用户添加角色remove_role:从用户中删除角色
安装
-
设置你的Discord机器人:
- 在以下位置创建新应用程序 Discord开发者门户
- 创建一个机器人并复制令牌
- 启用所需的特权意图:
- 消息内容意图
- 在场意图
- 服务器成员意图
- 使用OAuth2 URL生成器将机器人邀请到您的服务器
-
克隆并安装软件包:
# Clone the repository
git clone https://github.com/hanweg/mcp-discord.git
cd mcp-discord
# Create and activate virtual environment
uv venv
.venv\Scripts\activate # On macOS/Linux, use: source .venv/bin/activate
### If using Python 3.13+ - install audioop library: `uv pip install audioop-lts`
# Install the package
uv pip install -e .
- 配置Claude桌面(
%APPDATA%\Claude\claude_desktop_config.json在Windows上,~/Library/Application Support/Claude/claude_desktop_config.json在macOS上):
"discord": {
"command": "uv",
"args": [
"--directory",
"C:\\PATH\\TO\\mcp-discord",
"run",
"mcp-discord"
],
"env": {
"DISCORD_TOKEN": "your_bot_token"
}
}
通过Smithery安装
通过以下方式自动安装适用于Claude Desktop的Discord服务器 史密瑟里:
npx -y @smithery/cli install @hanweg/mcp-discord --client claude
许可证
MIT许可证-有关详细信息,请参阅许可证文件。