npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@scarecr0w12/discord-mcp

v1.0.5

Published

A comprehensive MCP server for Discord API integration with 50+ tools for server management, messaging, moderation, and more

Downloads

374

Readme

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
  • HTTP Transport with StreamableHTTPServerTransport for easy integration
  • Session Management for concurrent MCP connections
  • Comprehensive Error Handling with detailed error messages
  • Graceful Shutdown handling

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

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