
用于不和bot的 MCP 服务器 - 添加一个带有原始 API 访问的工具
概览
这个MCP服务器通过单一的灵活工具提供原始Discord API访问. 它既支持REST API调用,也支持斜线命令语法. 要通过 Smithery 为 Claude 桌面自动安装 Discord Raw API : 1. 设置您的 Discord bot: - 在 Discord 开发者门户网站创建新应用程序 - 创建一个 bot并复制该令牌 - 启用所需的特殊意图 : - MESSAGE CANSNT INTENT - PRESENT - SERVER MemberS INTENT - 请您使用 OAuth2 URL 生成器访问您的服务器 添加到您的 Claude desktop config.json 中 在项目知识中加入服务器、频道和用户的ID和一些实例,以避免提醒这些模型,同时加上类似的东西来启动: "这是如何有效利用Discord原始API工具: 该工具被称作不和-api并取出三个参数: 1. 方法: HTTP 方法 ("GET","POST","PUT","PATCH","DELETE") 2. 端点: Discord API 端点 (例如"guilds/{guild.id}/roles") 3.
概述(AI 翻译)
这个MCP服务器通过单一的灵活工具提供原始Discord API访问. 它既支持REST API调用,也支持斜线命令语法.
□ 安装
通过 Smithery 安装
要通过 Smithery 为 Claude 桌面自动安装 Discord Raw API :
手动安装
- 设置您的 Discord bot :
- 在 Discord 开发者门户网站创建新应用程序
- 创建机器人并复制代币
- 启用所需的特殊意图:
- 犯罪事实
- 罪魁祸首
- 服务会员
- 使用 OAuth2 URL 生成器邀请机器人到您的服务器
- 克隆并安装包件:
□ 配置
将此添加到您的 claude_desktop_config.json
□ 使用量
-
-
- REST API 样式
-
QQ 斜线命令样式
□ 实例
-
发挥以下作用:
-
发出信息:
-
获取服务器信息 :
建议: 在项目知识中加入服务器、频道和用户的ID和一些实例,以避免提醒这些模型,同时加上类似的东西来启动:
"这是如何有效利用Discord原始API工具: 该工具称为相不和 api并需要三个参数:
- 方法: HTTP 方法 (“GET”,“POST”,“PUT”,“PATCH”,“DEELETE”)
- 联合国.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Discord Raw API MCP Server
This MCP server provides raw Discord API access through a single flexible tool. It supports both REST API calls and slash command syntax.
Installation
Installing via Smithery
To install Discord Raw API for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @hanweg/mcp-discord-raw --client claude
Manual Installation
-
Set up your Discord bot:
- Create a new application at Discord Developer Portal
- Create a bot and copy the token
- Enable required privileged intents:
- MESSAGE CONTENT INTENT
- PRESENCE INTENT
- SERVER MEMBERS INTENT
- Invite the bot to your server using OAuth2 URL Generator
-
Clone and install the package:
# Clone the repository
git clone https://github.com/hanweg/mcp-discord-raw.git
cd mcp-discord-raw
# Create and activate virtual environment
uv venv
.venv\Scripts\activate
### If using Python 3.13+ - install audioop library: `uv pip install audioop-lts`
# Install the package
uv pip install -e .
Configuration
Add this to your claude_desktop_config.json
"discord-raw": {
"command": "uv",
"args": [
"--directory",
"PATH/TO/mcp-discord-raw",
"run",
"discord-raw-mcp"
],
"env": {
"DISCORD_TOKEN": "YOUR-BOT-TOKEN"
}
}
Usage
REST API Style
{
"method": "POST",
"endpoint": "guilds/123456789/roles",
"payload": {
"name": "Bot Master",
"permissions": "8",
"color": 3447003,
"mentionable": true
}
}
Slash Command Style
{
"method": "POST",
"endpoint": "/role create name:Bot_Master color:blue permissions:8 mentionable:true guild_id:123456789"
}
Examples
- Create a role:
{
"method": "POST",
"endpoint": "/role create name:Moderator color:red permissions:moderate_members guild_id:123456789"
}
- Send a message:
{
"method": "POST",
"endpoint": "channels/123456789/messages",
"payload": {
"content": "Hello from the API!"
}
}
- Get server information:
{
"method": "GET",
"endpoint": "guilds/123456789"
}
Recommendations:
Put server, channel and user IDs and some examples in project knowledge to avoid having to remind the model of those, along with something like this to get it started:
"Here’s how to effectively use the Discord raw API tool: The tool is called discord_api and takes three parameters:
安装
npx -y @smithery/cli install @hanweg/mcp-discord-raw --client claude