本 MCP 服务器借助灵活工具,为用户提供对 Discord 原始 API 的访问能力。它支持 REST API 调用以及 Slash 命令语法,能满足多样化的使用需求。
本 Discord 原始 API MCP 服务器能让你便捷地使用 Discord 原始 API,支持 REST API 调用和 Slash 命令语法。下面为你介绍详细的安装、配置和使用方法。
若要借助 Smithery 自动为 Claude Desktop 安装 Discord 原始 API,可使用以下命令:
npx -y @smithery/cli install @hanweg/mcp-discord-raw --client claude
git clone https://github.com/yourusername/mcp-discord-raw.git
cd mcp-discord-raw
npm install
.env 文件,并添加以下内容(需将 YOUR_DISCORD_TOKEN 替换为你自己的令牌):DISCORD_TOKEN=your_discord_token_here
npm start
在 config.json 文件中,添加以下配置以启用 Discord 原始 API 支持:
{
"apiEndpoints": {
"discord": {
"url": "https://discord.com/api/v9"
}
},
"botConfig": {
"token": "your_discord_token_here",
"prefix": "/"
}
}
使用 raw 命令与 Discord API 进行交互:
{
"command": "raw",
"endpoint": "/users/{user_id}",
"method": "GET",
"headers": {
"Authorization": "Bearer your_discord_token_here"
}
}
使用 slash 命令创建和管理 Slash 命令:
{
"command": "slash",
"name": "ping",
"description": "测试机器人是否正常运行。",
"options": []
}
使用以下 JSON 请求创建一个新频道:
{
"command": "raw",
"endpoint": "/guilds/{guild_id}/channels",
"method": "POST",
"headers": {
"Authorization": "Bearer your_discord_token_here"
},
"body": {
"name": "new-channel-name",
"type": 0
}
}
使用以下 JSON 请求向指定频道发送消息:
{
"command": "raw",
"endpoint": "/channels/{channel_id}/messages",
"method": "POST",
"headers": {
"Authorization": "Bearer your_discord_token_here"
},
"body": {
"content": "Hello, Discord!"
}
}
\:champagne_glass:)可能会导致 Claude Desktop 挂起,请告知模型使用 Discord 表情符号。{} 而不是 null本项目采用 MIT License 进行许可。