Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-discord-raw

MCP.Pizza Chef: hanweg

The mcp-discord-raw is an MCP server that offers direct, raw access to the Discord API through a single versatile tool. It supports both REST API calls and slash command syntax, enabling developers to integrate and control Discord bots with fine-grained API interactions. Installation is straightforward via Smithery or manual setup, requiring a Discord bot token and enabling privileged intents like MESSAGE CONTENT INTENT. This server is ideal for developers looking to build custom Discord bot functionalities or extend existing workflows with real-time Discord API capabilities.

Use This MCP server To

Integrate custom Discord bot commands via raw API calls Send and receive Discord messages programmatically Manage Discord channels and user permissions dynamically Execute slash commands through Discord API Automate Discord server moderation tasks Fetch real-time Discord server data for analytics Control Discord bot behavior with fine-grained API access

README

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

mcp-discord-raw FAQ

How do I install the mcp-discord-raw server?
You can install it automatically using Smithery CLI with 'npx -y @smithery/cli install @hanweg/mcp-discord-raw --client claude' or manually by setting up a Discord bot and configuring the server.
What Discord bot permissions are required?
You need to enable privileged intents such as MESSAGE CONTENT INTENT to allow the bot to read message content and interact fully with the Discord API.
Can this server handle both REST API and slash commands?
Yes, mcp-discord-raw supports both REST API calls and slash command syntax for flexible Discord bot interactions.
Is this MCP server compatible with multiple LLM clients?
Yes, it works with clients like Claude, OpenAI GPT-4, and Gemini, providing raw Discord API access regardless of the LLM provider.
How do I provide authentication for the Discord bot?
You must create a Discord application, generate a bot token, and supply this token to the MCP server for authenticated API access.
Can I use this server to automate Discord moderation?
Yes, with raw API access, you can automate moderation tasks such as message deletion, user bans, and role management.
Does this server support real-time event handling?
While primarily focused on raw API calls, it can be integrated with event listeners to respond to Discord events via slash commands or REST endpoints.
What is the advantage of using raw API access in MCP?
Raw API access provides maximum flexibility and control over Discord bot features beyond pre-built abstractions, enabling custom workflows and integrations.