Cover image
Try Now
2025-02-02

MCP服务器用于Discord Bot-添加一个具有RAW API访问的工具

3 years

Works with Finder

1

Github Watches

4

Github Forks

7

Github Stars

Discord Raw API MCP Server

smithery badge This MCP server provides raw Discord API access through a single flexible tool. It supports both REST API calls and slash command syntax.

Discord Raw API Server MCP server

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

  1. 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
  2. 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

  1. Create a role:
{
    "method": "POST",
    "endpoint": "/role create name:Moderator color:red permissions:moderate_members guild_id:123456789"
}
  1. Send a message:
{
    "method": "POST",
    "endpoint": "channels/123456789/messages",
    "payload": {
        "content": "Hello from the API!"
    }
}
  1. 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:

  1. method: HTTP method ("GET", "POST", "PUT", "PATCH", "DELETE")
  2. endpoint: Discord API endpoint (e.g., "guilds/{guild.id}/roles")
  3. payload: Optional JSON object for the request body Key examples I've used:
  4. Creating roles:
discord_api
method: POST
endpoint: guilds/{server_id}/roles
payload: {
    "name": "Role Name",
    "color": 3447003,  // Blue color in decimal
    "mentionable": true
}
  1. Creating categories and channels:
// Category
discord_api
method: POST
endpoint: guilds/{server_id}/channels
payload: {
    "name": "Category Name",
    "type": 4  // 4 = category
}
// Text channel in category
discord_api
method: POST
endpoint: guilds/{server_id}/channels
payload: {
    "name": "channel-name",
    "type": 0,  // 0 = text channel
    "parent_id": "category_id",
    "topic": "Channel description"
}
  1. Moving channels to categories:
discord_api
method: PATCH
endpoint: channels/{channel_id}
payload: {
    "parent_id": "category_id"
}
  1. Sending messages:
discord_api
method: POST
endpoint: channels/{channel_id}/messages
payload: {
    "content": "Message text with emojis \ud83d\ude04"
}
  1. Assigning roles:
discord_api
method: PUT
endpoint: guilds/{server_id}/members/{user_id}/roles/{role_id}
payload: {}

The tool supports the full Discord API, so you can reference the Discord API documentation for more endpoints and features. The responses include IDs and other metadata you can use for subsequent requests. Pro tips:

  • Save IDs returned from creation requests to use in follow-up requests
  • Unicode emojis can be included directly in message content ? Tell the model to use discord emoji like :champagne_glass: - Messages with unicode emoji hangs Claude Desktop?
  • Channel types: 0 = text, 2 = voice, 4 = category, 13 = stage
  • Role colors are in decimal format (not hex)
  • Most modification endpoints use PATCH method
  • Empty payloads should be {} not null"

License

MIT License

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    1 (1)
    Avatar
    user_8JMXtDkj
    2025-04-15

    I've been using the Gemini Function Calling + Model Context Protocol (MCP) Flight Search, and it's been a game changer! The precision and speed of flight search are incredible, thanks to the advanced model context protocol. Kudos to arjunprabhulal for creating such an efficient tool. Highly recommended for anyone needing reliable flight search capabilities.