Automate Discord server setup using the Discord Bot API
Discord Server Setup MCP
An MCP (Model Context Protocol) server for automating Discord server setup using the Discord Bot API. This server enables AI assistants like Claude to manage servers, channels, roles, permissions, and apply templates through a Discord bot.
Features
- Cross-Platform: Works on Windows, Linux, and macOS
- No Discord App Required: Operates via Discord Bot API (headless)
- Guild Management: Discover, select, and manage multiple Discord servers
- Channel Management: Create, edit, and delete channels and categories with permission overwrites
- Role Management: Create, edit, delete, and reorder roles with full permission control
- Permission Overwrites: Make channels/categories private, grant specific role access
- Server Settings: Configure verification levels, content filters, and notification settings
- Pre-built Templates: Apply ready-to-use server templates for common use cases
- Fast & Reliable: Direct API calls with proper error handling
Pre-built Templates
| Template | Description | Roles | Categories | Channels |
|---|---|---|---|---|
| Gaming | Comprehensive gaming community with competitive, streaming, and events sections | 10 | 11 | 40+ |
| Community | General community server for discussions and social interaction | 6 | 6 | 20+ |
| Business | Professional workspace for teams and organizations | 6 | 6 | 18+ |
| Study Group | Academic collaboration space for study groups and classes | 5 | 5 | 15+ |
Prerequisites
System Requirements
- Node.js 18.0.0 or higher
- Discord Bot with appropriate permissions
Discord Bot Setup
- Create an application at https://discord.com/developers/applications
- Add a bot user and copy the bot token
- Enable ALL Privileged Gateway Intents in bot settings (Bot → Privileged Gateway Intents):
- Presence Intent
- Server Members Intent
- Message Content Intent
- Generate an OAuth2 invite URL:
- Go to OAuth2 → URL Generator
- Select scopes:
botandapplications.commands - Select Administrator permission (required for full server management)
- Invite the bot to your Discord server(s) using the generated URL
Important: The bot requires Administrator permission to manage all server settings, roles, channels, and permissions without restrictions.
Installation
Quick Install (One-Liner)
curl -fsSL https://raw.githubusercontent.com/cj-vana/discord-setup-mcp/main/install.sh | bash
This installs to ~/.discord-setup-mcp by default. Set DISCORD_MCP_DIR to customize:
DISCORD_MCP_DIR=/custom/path curl -fsSL https://raw.githubusercontent.com/cj-vana/discord-setup-mcp/main/install.sh | bash
Manual Install
# Clone the repository
git clone https://github.com/cj-vana/discord-setup-mcp.git
cd discord-setup-mcp
# Install dependencies
npm install
# Build the project
npm run build
Configuration
Set Bot Token
Option A: Environment Variable
macOS/Linux (temporary - current session only):
export DISCORD_BOT_TOKEN="your-bot-token-here"
macOS/Linux (permanent - add to shell profile):
# For zsh (default on macOS)
echo 'export DISCORD_BOT_TOKEN="your-bot-token-here"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export DISCORD_BOT_TOKEN="your-bot-token-here"' >> ~/.bashrc
source ~/.bashrc
Windows Command Prompt (temporary):
set DISCORD_BOT_TOKEN=your-bot-token-here
Windows PowerShell (temporary):
$env:DISCORD_BOT_TOKEN = "your-bot-token-here"
Windows (permanent - System Environment Variables):
- Press
Win + R, typesysdm.cpl, press Enter - Go to Advanced tab → Environment Variables
- Under "User variables", click New
- Variable name:
DISCORD_BOT_TOKEN - Variable value:
your-bot-token-here - Click OK and restart your terminal
Option B: Configuration File
Create ~/.discord-mcp/config.json:
# Create the directory
mkdir -p ~/.discord-mcp
# Create the config file (replace with your actual token)
cat > ~/.discord-mcp/config.json << 'EOF'
{
"discordToken": "your-bot-token-here",
"defaultGuildId": "optional-default-server-id"
}
EOF
# Secure the file (recommended)
chmod 600 ~/.discord-mcp/config.json
On Windows, create %USERPROFILE%\.discord-mcp\config.json with the same JSON content.
Claude Desktop Configuration (Recommended)
The easiest method is to set the token directly in your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"discord-setup": {
"command": "node",
"args": ["/path/to/discord-setup-mcp/dist/index.js"],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here"
}
}
}
}
Replace /path/to/discord-setup-mcp with the actual path w
Tools (4)
guild_managementDiscover, select, and manage multiple Discord servers.channel_managementCreate, edit, and delete channels and categories with permission overwrites.role_managementCreate, edit, delete, and reorder roles with full permission control.apply_templateApply ready-to-use server templates for common use cases like Gaming or Business.Environment Variables
DISCORD_BOT_TOKENrequiredThe token for your Discord Bot applicationConfiguration
{
"mcpServers": {
"discord-setup": {
"command": "node",
"args": ["/path/to/discord-setup-mcp/dist/index.js"],
"env": {
"DISCORD_BOT_TOKEN": "your-bot-token-here"
}
}
}
}