Skip to main content
Glama
discord-mcp

discord-mcp

by scarecr0w12

Discord MCP Server

License: ISC MCP Node.js

A Model Context Protocol (MCP) server that provides comprehensive tools for managing Discord servers. This server uses HTTP transport with Server-Sent Events (SSE) for real-time communication.

Features

  • 50+ Discord Management Tools across 12 categories

  • 10 MCP Prompts for guided server management workflows

  • HTTP Transport with StreamableHTTPServerTransport for easy integration

  • Session Management for concurrent MCP connections

  • Comprehensive Error Handling with detailed error messages

  • Graceful Shutdown handling

Related MCP server: pterodactyl-mcp

Prerequisites

  • Node.js 18+

  • A Discord Bot Token with appropriate permissions

  • Discord bot added to your server(s)

Installation

  1. Clone the repository:

    git clone https://github.com/scarecr0w12/discord-mcp.git
    cd discord-mcp
  2. Install dependencies:

    npm install
  3. Create a .env file from the example:

    cp .env.example .env
  4. Configure your Discord bot token in .env:

    DISCORD_BOT_TOKEN=your_bot_token_here
    PORT=3000
  5. Build the project:

    npm run build
  6. Start the server:

    npm start

Discord Bot Setup

Your Discord bot requires the following Gateway Intents enabled in the Discord Developer Portal:

  • GUILDS - Access to guild information

  • GUILD_MEMBERS - Access to member information (Privileged)

  • GUILD_MODERATION - Access to moderation events

  • GUILD_MESSAGES - Access to messages

  • GUILD_PRESENCES - Access to presence information (Privileged)

  • MESSAGE_CONTENT - Access to message content (Privileged)

Configuration

Environment Variable

Description

Default

DISCORD_BOT_TOKEN

Your Discord bot token (required)

-

PORT

HTTP server port (HTTP mode only)

3000

MCP_TRANSPORT

Transport mode (stdio or http)

http

Usage

The server supports two transport modes:

HTTP Mode (Default)

Start the server in HTTP mode:

npm start

HTTP Endpoints

  • POST /mcp - MCP requests

  • GET /mcp - SSE stream for server-initiated messages

  • DELETE /mcp - Session cleanup

  • GET /health - Health check endpoint

VS Code MCP Configuration (HTTP)

Add to your .vscode/mcp.json:

{
  "servers": {
    "discord-mcp": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Stdio Mode

For use with Claude Desktop, Cline, or other MCP clients that use stdio transport:

npm start -- --stdio
# or
MCP_TRANSPORT=stdio npm start

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "discord-mcp": {
      "command": "node",
      "args": ["/path/to/discord-mcp/dist/index.js", "--stdio"],
      "env": {
        "DISCORD_BOT_TOKEN": "your_bot_token_here"
      }
    }
  }
}

Cline Configuration

Add to your Cline MCP settings:

{
  "mcpServers": {
    "discord-mcp": {
      "command": "node",
      "args": ["/path/to/discord-mcp/dist/index.js", "--stdio"],
      "env": {
        "DISCORD_BOT_TOKEN": "your_bot_token_here"
      }
    }
  }
}

Available Tools

Server Management

  • list_servers - List all Discord servers the bot has access to

  • get_server_info - Get detailed information about a specific server

  • modify_server - Modify server settings

Channel Management

  • list_channels - List all channels in a server

  • get_channel_info - Get detailed channel information

  • create_channel - Create a new channel

  • delete_channel - Delete a channel

  • modify_channel - Modify channel settings

Member Management

  • list_members - List server members

  • get_member_info - Get member details

  • modify_member - Modify member properties

  • kick_member - Kick a member from the server

  • ban_member - Ban a member

  • unban_member - Unban a member

  • list_bans - List all bans

Role Management

  • list_roles - List all roles

  • get_role_info - Get role details

  • create_role - Create a new role

  • delete_role - Delete a role

  • modify_role - Modify role settings

  • assign_role - Assign a role to a member

  • remove_role - Remove a role from a member

Permission Management

  • get_channel_permissions - Get channel permission overwrites

  • set_channel_permission - Set channel permissions

  • delete_channel_permission - Delete permission overwrites

  • list_permissions - List available permissions

  • sync_channel_permissions - Sync permissions with category

Message Management

  • send_message - Send a message to a channel

  • get_messages - Retrieve messages from a channel

  • edit_message - Edit a bot message

  • delete_message - Delete a message

  • bulk_delete_messages - Bulk delete messages (up to 100)

  • pin_message / unpin_message - Pin/unpin messages

  • get_pinned_messages - Get all pinned messages

  • add_reaction / remove_reactions - Manage reactions

Emoji & Sticker Management

  • list_emojis - List server emojis

  • create_emoji - Create a custom emoji

  • delete_emoji - Delete an emoji

  • modify_emoji - Modify emoji settings

  • Sticker operations (list, create, delete, modify)

Webhook Management

  • list_channel_webhooks / list_guild_webhooks - List webhooks

  • create_webhook - Create a webhook

  • delete_webhook - Delete a webhook

  • modify_webhook - Modify webhook settings

  • send_webhook_message - Send a message via webhook

Invite Management

  • list_invites - List server invites

  • get_invite_info - Get invite details

  • create_invite - Create an invite

  • delete_invite - Delete an invite

Event Management

  • list_events - List scheduled events

  • get_event_info - Get event details

  • create_event - Create a scheduled event

  • modify_event - Modify an event

  • delete_event - Delete an event

  • get_event_subscribers - Get event subscribers

Thread Management

  • list_threads - List threads in a channel or server

  • create_thread - Create a new thread

  • create_forum_post - Create a forum post

  • modify_thread - Modify thread settings

  • delete_thread - Delete/archive a thread

  • Thread join/leave and member management operations

Audit & Moderation

  • get_audit_logs - Retrieve server audit logs

  • list_audit_log_types - List available audit log action types

  • list_automod_rules - List AutoMod rules

  • get_automod_rule - Get AutoMod rule details

  • delete_automod_rule - Delete an AutoMod rule

  • toggle_automod_rule - Enable/disable an AutoMod rule

Available Prompts

MCP Prompts provide guided workflows for complex server management tasks. Use these prompts to start structured conversations for common administrative operations.

Prompt

Description

server-audit

Comprehensive security and configuration audit checklist

moderation-report

Generate moderation activity summaries from audit logs

channel-setup-guide

Step-by-step guidance for setting up new channels

role-hierarchy-review

Analyze and suggest improvements to role hierarchy

permission-troubleshoot

Diagnose why a user cannot perform a specific action

welcome-message-template

Generate customized server welcome messages

announcement-draft

Draft formatted server announcements

automod-setup-guide

Guide for configuring Discord AutoMod rules

webhook-security-audit

Audit webhooks for security concerns

member-onboarding-review

Review and improve new member experience

Using Prompts

Prompts can be invoked in MCP-compatible clients. Each prompt accepts arguments to customize the workflow:

# Example: Server Audit
Prompt: server-audit
Arguments: { "guildId": "123456789" }

# Example: Channel Setup Guide  
Prompt: channel-setup-guide
Arguments: { "channelType": "forum", "purpose": "community feedback" }

Development

# Run in development mode with hot reload
npm run dev

# Build the project
npm run build

# Start the production server
npm start

Attributions

This project is built with the following open-source libraries:

  • @modelcontextprotocol/sdk - Official MCP TypeScript SDK

  • discord.js - A powerful JavaScript library for interacting with the Discord API

  • Express - Fast, unopinionated, minimalist web framework for Node.js

  • Zod - TypeScript-first schema validation with static type inference

  • dotenv - Loads environment variables from .env file

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add some amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

License

ISC License - see the LICENSE file for details.

Author

Jacob Bowen - @scarecr0w12

Available Tools

76 tools
add_reactionC

Add a reaction to a message

Inputs: guildId (required), channelId (required), messageId (required), emoji (required).

add_thread_memberC

Add a member to a thread

Inputs: guildId (required), threadId (required), userId (required).

assign_roleC

Assign a role to a member

Inputs: guildId (required), memberId (required), roleId (required), reason.

ban_memberC

Ban a member from the server

Inputs: guildId (required), userId (required), deleteMessageSeconds, reason.

bulk_delete_messagesA

Bulk delete messages from a channel (up to 100, messages must be < 14 days old)

Inputs: guildId (required), channelId (required), messageIds (required), reason.

create_channelC

Create a new channel in a Discord server

Inputs: guildId (required), name (required), type (required), parentId, +7 more.

create_emojiC

Create a custom emoji in a server

Inputs: guildId (required), name (required), imageUrl (required), roles, +1 more.

create_eventC

Create a scheduled event in a server

Inputs: guildId (required), name (required), scheduledStartTime (required), entityType (required), +6 more.

create_forum_postC

Create a new post in a forum channel

Inputs: guildId (required), channelId (required), name (required), content (required), +3 more.

create_inviteC

Create an invite for a channel

Inputs: guildId (required), channelId (required), maxAge, maxUses, +3 more.

create_roleC

Create a new role in a Discord server

Inputs: guildId (required), name (required), color, hoist, +4 more.

create_stickerC

Create a custom sticker in a server

Inputs: guildId (required), name (required), description (required), tags (required), +2 more.

create_threadC

Create a new thread

Inputs: guildId (required), channelId (required), name (required), messageId, +3 more.

create_webhookC

Create a webhook in a channel

Inputs: guildId (required), channelId (required), name (required), avatar, +1 more.

delete_automod_ruleC

Delete an auto-moderation rule

Inputs: guildId (required), ruleId (required), reason.

delete_channelC

Delete a channel from a Discord server

Inputs: guildId (required), channelId (required), reason.

delete_channel_permissionB

Delete a permission overwrite for a role or member on a channel

Inputs: guildId (required), channelId (required), targetId (required), reason.

delete_emojiC

Delete a custom emoji from a server

Inputs: guildId (required), emojiId (required), reason.

delete_eventC

Delete a scheduled event

Inputs: guildId (required), eventId (required).

delete_inviteC

Delete an invite

Inputs: inviteCode (required), reason.

delete_messageC

Delete a message from a channel

Inputs: guildId (required), channelId (required), messageId (required), reason.

delete_roleC

Delete a role from a Discord server

Inputs: guildId (required), roleId (required), reason.

delete_stickerC

Delete a custom sticker from a server

Inputs: guildId (required), stickerId (required), reason.

delete_threadC

Delete a thread

Inputs: guildId (required), threadId (required), reason.

delete_webhookC

Delete a webhook

Inputs: webhookId (required), reason.

edit_messageC

Edit a message sent by the bot

Inputs: guildId (required), channelId (required), messageId (required), content (required).

get_audit_logsC

Get audit logs from a server

Inputs: guildId (required), limit, userId, actionType, +1 more.

get_automod_ruleB

Get details of a specific auto-moderation rule

Inputs: guildId (required), ruleId (required).

get_channel_infoC

Get detailed information about a specific channel

Inputs: guildId (required), channelId (required).

get_channel_permissionsC

Get all permission overwrites for a channel

Inputs: guildId (required), channelId (required).

get_event_infoC

Get detailed information about a scheduled event

Inputs: guildId (required), eventId (required).

get_event_subscribersC

Get users subscribed to a scheduled event

Inputs: guildId (required), eventId (required), limit.

get_invite_infoC

Get information about a specific invite

Inputs: inviteCode (required).

get_member_infoB

Get detailed information about a specific member

Inputs: guildId (required), memberId (required).

get_messagesC

Get messages from a channel

Inputs: guildId (required), channelId (required), limit, before, +1 more.

get_pinned_messagesB

Get all pinned messages in a channel

Inputs: guildId (required), channelId (required).

get_role_infoC

Get detailed information about a specific role

Inputs: guildId (required), roleId (required).

get_server_infoB

Get detailed information about a specific Discord server

Inputs: guildId (required).

join_threadC

Make the bot join a thread

Inputs: guildId (required), threadId (required).

kick_memberC

Kick a member from the server

Inputs: guildId (required), memberId (required), reason.

leave_threadC

Make the bot leave a thread

Inputs: guildId (required), threadId (required).

list_audit_log_typesB

List all available audit log action types

Inputs: no named parameters.

list_automod_rulesC

List all auto-moderation rules in a server

Inputs: guildId (required).

list_bansB

List all banned users in a server

Inputs: guildId (required).

list_channelsB

List all channels in a Discord server

Inputs: guildId (required).

list_channel_webhooksB

List all webhooks in a channel

Inputs: guildId (required), channelId (required).

list_emojisC

List all custom emojis in a server

Inputs: guildId (required).

list_eventsC

List all scheduled events in a server

Inputs: guildId (required), withUserCount.

list_guild_webhooksC

List all webhooks in a server

Inputs: guildId (required).

list_invitesC

List all invites in a server

Inputs: guildId (required).

list_membersB

List members in a Discord server (fetches up to 1000 members)

Inputs: guildId (required), limit.

list_permissionsA

List all available Discord permission names that can be used for roles and channel overwrites

Inputs: no named parameters.

list_rolesB

List all roles in a Discord server

Inputs: guildId (required).

list_serversB

List all Discord servers (guilds) the bot has access to

Inputs: no named parameters.

list_stickersB

List all custom stickers in a server

Inputs: guildId (required).

list_threadsC

List all threads in a channel

Inputs: guildId (required), channelId (required), archived.

modify_channelC

Modify channel settings (name, topic, permissions, position, etc.)

Inputs: guildId (required), channelId (required), name, topic, +7 more.

modify_emojiC

Modify a custom emoji in a server

Inputs: guildId (required), emojiId (required), name, roles, +1 more.

modify_eventC

Modify a scheduled event

Inputs: guildId (required), eventId (required), name, description, +5 more.

modify_memberC

Modify member properties (nickname, roles, timeout, etc.)

Inputs: guildId (required), memberId (required), nickname, roles, +5 more.

modify_roleC

Modify role properties (name, color, permissions, position, etc.)

Inputs: guildId (required), roleId (required), name, color, +5 more.

modify_serverC

Modify server settings (requires appropriate permissions)

Inputs: guildId (required), name, description, afkChannelId, +4 more.

modify_stickerC

Modify a custom sticker in a server

Inputs: guildId (required), stickerId (required), name, description, +2 more.

modify_threadD

Modify a thread

Inputs: guildId (required), threadId (required), name, archived, +5 more.

modify_webhookC

Modify a webhook

Inputs: webhookId (required), name, avatar, channelId, +1 more.

pin_messageC

Pin a message in a channel

Inputs: guildId (required), channelId (required), messageId (required), reason.

remove_reactionsC

Remove reactions from a message

Inputs: guildId (required), channelId (required), messageId (required), emoji, +1 more.

remove_roleC

Remove a role from a member

Inputs: guildId (required), memberId (required), roleId (required), reason.

remove_thread_memberC

Remove a member from a thread

Inputs: guildId (required), threadId (required), userId (required).

send_messageC

Send a message to a channel

Inputs: guildId (required), channelId (required), content (required), replyToMessageId.

send_webhook_messageC

Send a message using a webhook

Inputs: webhookId (required), webhookToken (required), content, username, +2 more.

set_channel_permissionC

Set permission overwrite for a role or member on a channel

Inputs: guildId (required), channelId (required), targetId (required), targetType (required), +3 more.

sync_channel_permissionsC

Sync a channel's permissions with its parent category

Inputs: guildId (required), channelId (required).

toggle_automod_ruleC

Enable or disable an auto-moderation rule

Inputs: guildId (required), ruleId (required), enabled (required), reason.

unban_memberC

Unban a user from the server

Inputs: guildId (required), userId (required), reason.

unpin_messageC

Unpin a message in a channel

Inputs: guildId (required), channelId (required), messageId (required), reason.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 76 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose targeting specific Discord resources and actions, with no significant overlap. For example, 'ban_member' and 'kick_member' are distinct operations, and 'create_channel' versus 'modify_channel' are clearly separated lifecycle stages.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern throughout (e.g., create_channel, delete_channel, modify_channel). The naming is highly predictable and organized, with no mixing of conventions or styles.

    Tool Count2/5

    With 76 tools, this is far too many for typical agent use, creating cognitive overload and selection difficulty. While Discord's API is extensive, this comprehensive coverage could be better organized into fewer, more generalized tools or a hierarchical structure.

    Completeness5/5

    The tool set provides complete CRUD/lifecycle coverage for Discord's domain, including channels, messages, members, roles, events, webhooks, and moderation. Every major Discord API endpoint appears to be represented with no obvious gaps in functionality.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers