Discord Server Setup MCP
An automation tool for macOS that uses AppleScript and JXA to manage Discord server setups through AI assistants. It enables the creation and configuration of servers, channels, roles, and settings using pre-built templates or custom commands.
README
Discord Server Setup MCP
An MCP (Model Context Protocol) server for automating Discord server setup on macOS using AppleScript/JXA. This server exposes tools for creating servers, channels, categories, roles, and configuring server settings through AI assistants like Claude.
Features
- Server Management: Create new Discord servers, check Discord status, and focus the Discord window
- Channel Management: Create, edit, and delete text, voice, announcement, stage, and forum channels
- Category Management: Create and organize channel categories
- Role Management: Create, edit, delete, and reorder server roles with full permission control
- Server Settings: Configure verification levels, content filters, and notification settings
- Pre-built Templates: 4 ready-to-use server templates for common use cases
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
- macOS (required for AppleScript automation)
- Node.js 18.0.0 or higher
- Discord Desktop App (not the web version)
Permissions Setup
This MCP server uses AppleScript to automate the Discord desktop application. For this to work, you must grant Accessibility permissions to the application running the MCP server.
- Open System Preferences (or System Settings on macOS Ventura+)
- Navigate to Privacy & Security > Accessibility
- Click the lock icon to make changes
- Add and enable the application that will run this MCP server:
- If using Claude Desktop: Add Claude Desktop
- If using Terminal: Add Terminal.app
- If using VS Code: Add Visual Studio Code
- If using a custom client: Add that application
Discord Setup
- Install Discord Desktop App from discord.com
- Log in to your Discord account
- Keep Discord visible on screen during automation
- Ensure Discord has a visible window (not minimized)
Installation
From npm (when published)
npm install -g discord-setup-mcp
From Source
# Clone the repository
git clone https://github.com/yourusername/discord-setup-mcp.git
cd discord-setup-mcp
# Install dependencies
npm install
# Build the project
npm run build
Configuration
Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"discord-setup": {
"command": "node",
"args": ["/path/to/discord-setup-mcp/dist/index.js"]
}
}
}
Or if installed globally:
{
"mcpServers": {
"discord-setup": {
"command": "discord-setup-mcp"
}
}
}
Other MCP Clients
For other MCP-compatible clients, configure the server with:
- Command:
node - Arguments:
["/path/to/discord-setup-mcp/dist/index.js"] - Transport:
stdio
Available Tools
Server Tools
| Tool | Description |
|---|---|
check_discord_status |
Check if Discord is running and focused |
create_server |
Create a new Discord server with optional template |
focus_discord |
Bring Discord to the foreground |
Channel Tools
| Tool | Description |
|---|---|
create_category |
Create a new category to organize channels |
create_channel |
Create a text, voice, announcement, stage, or forum channel |
edit_channel |
Modify channel settings (name, topic, slowmode, etc.) |
delete_channel |
Delete a channel (requires confirmation) |
Role Tools
| Tool | Description |
|---|---|
create_role |
Create a new role with custom color and permissions |
edit_role |
Modify an existing role's properties |
delete_role |
Delete a role (requires confirmation) |
reorder_roles |
Change the hierarchy order of roles |
Settings Tools
| Tool | Description |
|---|---|
open_server_settings |
Open the server settings panel |
set_verification_level |
Set member verification requirements |
set_content_filter |
Configure explicit content scanning |
set_default_notifications |
Set default notification preferences |
Template Tools
| Tool | Description |
|---|---|
list_templates |
List all available server templates |
preview_template |
Preview a template's roles and channels |
apply_template |
Apply a template to create a new server |
Usage Examples
Checking Discord Status
Before performing any operations, verify Discord is running:
User: Check if Discord is ready for automation
Claude: I'll check the Discord status for you.
[Uses check_discord_status tool]
Discord is running and focused with 1 window(s). Main window: "Discord"
Creating a Server from a Template
User: Create a new Discord server for my gaming community called "Epic Gamers Hub"
Claude: I'll help you create a gaming community server.
First, let me preview the gaming template to show you what it includes...
[Uses preview_template tool with templateId: "gaming"]
The gaming template includes:
- 10 roles (Owner, Admin, Moderator, Event Host, Streamer, VIP, etc.)
- 11 categories (Welcome, General, Gaming Discussion, Competitive, Voice Channels, etc.)
- 40+ channels organized by purpose
Now I'll create the server...
[Uses apply_template tool with templateId: "gaming", serverName: "Epic Gamers Hub"]
Creating Custom Channels
User: Add a voice channel called "Music Lounge" to my server
Claude: I'll create that voice channel for you.
[Uses create_channel tool with name: "Music Lounge", type: "voice"]
Voice channel 'Music Lounge' created successfully.
Managing Roles
User: Create a "Content Creator" role with a purple color that appears separately in the member list
Claude: I'll create that role for you.
[Uses create_role tool]
Role configuration:
- Name: Content Creator
- Color: #9B59B6 (purple)
- Hoist: true (displays separately)
- Mentionable: true
Successfully created role 'Content Creator'.
Configuring Server Settings
User: Set the verification level to medium and enable content scanning for all members
Claude: I'll configure those security settings.
First, opening server settings...
[Uses open_server_settings tool]
Setting verification level to medium (requires registered for 5+ minutes)...
[Uses set_verification_level tool with level: "medium"]
Enabling content scanning for all members...
[Uses set_content_filter tool with level: "all_members"]
Server security settings updated:
- Verification: Medium (registered 5+ minutes)
- Content filter: Scanning all members
Tool Reference
check_discord_status
Checks if Discord is running and ready for automation.
Parameters: None
Returns:
isRunning: Whether Discord is runningisFrontmost: Whether Discord is the active windowwindowCount: Number of Discord windowsmainWindowTitle: Title of the main window
create_server
Creates a new Discord server.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Server name (2-100 characters) |
templateChoice |
string | No | Discord template: gaming, friends, club, study, artists, local, or custom (default) |
create_channel
Creates a new channel in the server.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Channel name (1-100 characters) |
type |
string | No | Channel type: text (default), voice, announcement, stage, forum |
categoryName |
string | No | Category to place the channel in |
topic |
string | No | Channel topic (max 1024 characters) |
slowmode |
number | No | Slowmode in seconds (0-21600) |
nsfw |
boolean | No | Age-restricted channel |
bitrate |
number | No | Voice channel bitrate (8000-384000) |
userLimit |
number | No | Voice channel user limit (0-99) |
create_role
Creates a new role in the server.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
serverName |
string | Yes | Name of the server |
role.name |
string | Yes | Role name (1-100 characters) |
role.color |
string | No | Hex color code (e.g., #FF0000) |
role.hoist |
boolean | No | Display separately in member list |
role.mentionable |
boolean | No | Allow @mentioning this role |
role.permissions |
array | No | Array of permission names |
set_verification_level
Sets the server verification level.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
level |
string | Yes | One of: none, low, medium, high, highest |
Verification Levels:
none: No requirementslow: Verified email requiredmedium: Registered on Discord for 5+ minuteshigh: Member of server for 10+ minuteshighest: Verified phone number required
list_templates
Lists all available server templates.
Parameters: None
Returns: Array of templates with name, description, and counts
preview_template
Shows detailed information about a template.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
templateId |
string | Yes | Template ID: gaming, community, business, study_group |
includeChannels |
boolean | No | Include channel details (default: true) |
includeRoles |
boolean | No | Include role details (default: true) |
apply_template
Applies a template to create a server structure.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
templateId |
string | Yes | Template ID |
serverName |
string | Yes | Name for the new server |
customization.skipChannels |
array | No | Channel names to skip |
customization.skipRoles |
array | No | Role names to skip |
customization.roleColorOverrides |
object | No | Override role colors |
Troubleshooting
"Discord is not running" error
- Launch the Discord desktop application
- Make sure you're logged in
- Wait for Discord to fully load before retrying
"Could not find element" errors
- Ensure Discord is visible on screen (not minimized)
- Make sure the correct Discord view is open (server list visible)
- Try clicking on the Discord window manually first
- Wait a moment and retry the operation
Accessibility permission issues
If operations fail silently:
- Go to System Preferences > Privacy & Security > Accessibility
- Remove and re-add your application
- Restart the application
- Try the operation again
Automation is too fast/slow
The automation includes built-in delays for UI elements to load. If you experience issues:
- Discord's responsiveness varies with system load
- Complex operations may need more time
- Close unnecessary applications to improve performance
Development
Building from Source
# Install dependencies
npm install
# Build
npm run build
# Run in development mode (with file watching)
npm run dev
# Type checking
npm run typecheck
Project Structure
discord-setup-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── automation/ # AppleScript automation layer
│ │ ├── discord.ts # Discord-specific automation
│ │ ├── executor.ts # AppleScript execution
│ │ └── waiter.ts # Timing and delays
│ ├── tools/ # MCP tool implementations
│ │ ├── channels.ts # Channel management tools
│ │ ├── roles.ts # Role management tools
│ │ ├── server.ts # Server management tools
│ │ ├── settings.ts # Settings management tools
│ │ └── templates.ts # Template tools
│ ├── templates/ # Pre-built server templates
│ │ ├── gaming.ts # Gaming community template
│ │ ├── community.ts # General community template
│ │ ├── business.ts # Business/professional template
│ │ └── study-group.ts # Study group template
│ └── utils/ # Utility functions
│ ├── errors.ts # Error handling
│ └── validation.ts # Input validation
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.md
Known Limitations
- macOS Only: AppleScript automation is only available on macOS
- Desktop App Required: The web version of Discord cannot be automated
- Visual Automation: Discord must be visible on screen during operations
- UI Changes: Discord UI updates may temporarily break some automations
- Single Server: Operations work on the currently active/selected server
- Rate Limits: Rapid successive operations may fail; built-in delays help mitigate this
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - see the LICENSE file for details.
Acknowledgments
- Built with the Model Context Protocol SDK
- Uses Zod for runtime type validation
- Inspired by the need to streamline Discord server setup for communities
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.