Prepare the server locally
Run this once before adding it to Claude Code.
git clone https://github.com/lokeshpanthangi/Discord-MCP.git
cd Discord-MCP
npm install
npm startRegister it in Claude Code
claude mcp add -e "DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}" -e "MCP_API_KEY=${MCP_API_KEY}" discord-mcp-5b1e -- node /path/to/Discord-MCP/index.jsReplace any placeholder paths in the command with the real path on your machine.
DISCORD_BOT_TOKENMCP_API_KEY+ 4 optionalMake your agent remember this setup
discord-mcp-5b1e's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- 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
Tools 5
get_channel_infoRetrieve detailed channel informationget_messagesFetch messages with filtering optionssearch_messagesAdvanced message search capabilitiessend_messageSend messages by channel ID or namemoderate_contentDelete messages and moderate contentEnvironment Variables
DISCORD_BOT_TOKENrequiredDiscord Bot Token from Developer PortalMCP_API_KEYrequiredSecure API key for MCP server authenticationMCP_SERVER_NAMEName of the MCP serverNODE_ENVEnvironment mode (e.g., production)MCP_INSPECTOR_PORTPort for the MCP inspector dashboardLOG_LEVELLogging verbosity levelTry it
Original README from suvidha-2401/Discord-MCP
Features •
Quick Start •
Installation •
Configuration •
API Reference •
Contributing
📋 Table of Contents
- ✨ Features
- 🚀 Quick Start
- 📦 Installation
- ⚙️ Configuration
- 🔧 Setup Guide
- 🛠️ Available Tools
- 🔐 Authentication
- 📊 Monitoring
- 🧪 Testing
- 📚 API Reference
- 🛡️ Security
- 🤝 Contributing
- 📄 License
✨ 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
Clone the Repository
git clone https://github.com/lokeshpanthangi/Discord-MCP.git cd Discord-MCPInstall Dependencies
npm installEnvironment Setup
cp .env.example .envConfigure Environment Variables (see Configuration)
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
Create Discord Application
- Visit Discord Developer Portal
- Click "New Application" and give it a name
- Navigate to "Bot" section
- Click "Add Bot"
Configure Bot Permissions
✅ Send Messages ✅ Read Message History ✅ View Channels ✅ Manage Messages (for moderation) ✅ Read Messages/View ChannelsGet Bot Token
- In Bot section, click "Copy" under Token
- Add to your
.envfile asDISCORD_BOT_TOKEN
Invite Bot to Server
ht