Discord MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/lokeshpanthangi/Discord-MCP.git
cd Discord-MCP
npm install
npm start
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}" -e "MCP_API_KEY=${MCP_API_KEY}" discord-mcp-5b1e -- node "<FULL_PATH_TO_DISCORD_MCP>/dist/index.js"

Replace <FULL_PATH_TO_DISCORD_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:DISCORD_BOT_TOKENMCP_API_KEY+ 4 optional
README.md

A comprehensive Model Context Protocol server for Discord integration

๐Ÿค– Discord MCP Server

A comprehensive Model Context Protocol server for Discord integration
Features โ€ข
Quick Start โ€ข
Installation โ€ข
Configuration โ€ข
API Reference โ€ข
Contributing

๐Ÿ“‹ Table of Contents

โœจ Features

๐ŸŽฏ Core Capabilities

  • ๐Ÿ”— Discord Integration: Full Discord API support with 5 powerful tools
  • ๐Ÿ” Enterprise Security: Multi-tenant authentication with API key management
  • โšก Rate Limiting: Configurable rate limits (30/min, 500/hour, 5000/day)
  • ๐Ÿ“Š Real-time Monitoring: Built-in MCP Inspector dashboard
  • ๐Ÿ” Comprehensive Logging: Audit trails and security event tracking
  • ๐Ÿงช Testing Ready: Jest framework with 80%+ coverage threshold

๐Ÿ› ๏ธ Discord Tools

Tool Description Use Case
get_channel_info Retrieve detailed channel information Channel analytics, moderation
get_messages Fetch messages with filtering options Content analysis, history
search_messages Advanced message search capabilities Content discovery, compliance
send_message Send messages by channel ID or name Automated notifications, responses
moderate_content Delete messages and moderate content Community management, safety

๐Ÿ—๏ธ Architecture Highlights

  • ๐Ÿ”„ MCP Protocol: Full Model Context Protocol compliance
  • ๐Ÿข Multi-tenancy: Isolated client management per API key
  • ๐Ÿ›ก๏ธ Security First: Token hashing, no persistent storage
  • ๐Ÿ“ˆ Scalable: Automatic client cleanup and resource management
# Clone the repository
git clone https://github.com/lokeshpanthangi/Discord-MCP.git
cd Discord-MCP

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env with your credentials

# Start the server
npm start

# Open MCP Inspector (optional)
# Visit http://localhost:3001

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 8.0.0
  • Discord Bot Token (Create one here)
  • Discord Server with bot permissions

Step-by-Step Installation

  1. Clone the Repository

    git clone https://github.com/lokeshpanthangi/Discord-MCP.git
    cd Discord-MCP
    
  2. Install Dependencies

    npm install
    
  3. Environment Setup

    cp .env.example .env
    
  4. Configure Environment Variables (see Configuration)

  5. Start the Server

    npm start
    

โš™๏ธ Configuration

Environment Variables

Create a .env file in the root directory:

# Required: Discord Bot Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token_here

# Required: MCP Server Authentication
MCP_API_KEY=your_secure_api_key_here

# Optional: Server Configuration
MCP_SERVER_NAME=discord-mcp-server
NODE_ENV=production

# Optional: Monitoring
MCP_INSPECTOR_PORT=3001

# Optional: Logging
LOG_LEVEL=info

Discord Bot Setup

  1. Create Discord Application

  2. Configure Bot Permissions

    โœ… Send Messages
    โœ… Read Message History
    โœ… View Channels
    โœ… Manage Messages (for moderation)
    โœ… Read Messages/View Channels
    
  3. Get Bot Token

    • In Bot section, click "Copy" under Token
    • Add to your .env file as DISCORD_BOT_TOKEN
  4. Invite Bot to Server

    ht
    

Tools (5)

get_channel_infoRetrieve detailed channel information
get_messagesFetch messages with filtering options
search_messagesAdvanced message search capabilities
send_messageSend messages by channel ID or name
moderate_contentDelete messages and moderate content

Environment Variables

DISCORD_BOT_TOKENrequiredDiscord Bot Token from Developer Portal
MCP_API_KEYrequiredSecure API key for MCP server authentication
MCP_SERVER_NAMEName of the MCP server
NODE_ENVEnvironment mode (e.g., production)
MCP_INSPECTOR_PORTPort for the MCP inspector dashboard
LOG_LEVELLogging verbosity level

Configuration

claude_desktop_config.json
{"mcpServers": {"discord": {"command": "node", "args": ["/path/to/Discord-MCP/index.js"], "env": {"DISCORD_BOT_TOKEN": "your_token", "MCP_API_KEY": "your_key"}}}}

Try it

โ†’Get the latest information for the channel with ID 123456789.
โ†’Fetch the last 50 messages from the general channel to summarize recent discussions.
โ†’Search for all messages containing 'urgent' in the support channel.
โ†’Send a message to the announcements channel saying 'The server maintenance is complete'.
โ†’Delete the message with ID 987654321 due to policy violation.

Frequently Asked Questions

What are the key features of Discord MCP Server?

Full Discord API support with 5 powerful tools. Multi-tenant authentication with API key management. Configurable rate limiting for API requests. Built-in MCP Inspector dashboard for real-time monitoring. Comprehensive audit trails and security event tracking.

What can I use Discord MCP Server for?

Automating community notifications and responses within Discord channels. Performing content analysis and history retrieval for community moderation. Managing Discord server channels through natural language commands. Enforcing community safety by programmatically moderating content.

How do I install Discord MCP Server?

Install Discord MCP Server by running: git clone https://github.com/lokeshpanthangi/Discord-MCP.git && cd Discord-MCP && npm install && npm start

What MCP clients work with Discord MCP Server?

Discord MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Discord MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare