diserverbuilder-mcp
Enables an AI assistant to build and reorganize a Discord server via the Discord REST API using a bot token: create, edit, reorder, clone and delete categories and channels, manage roles and permission overwrites, apply whole layouts with dry-run and snapshot/restore, and manage emojis, invites, webhooks, events, audit logs and messages.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
diserverbuilder-mcp
An MCP server that lets an AI assistant (Claude, etc.) build and reorganize a Discord server through a bot you own: categories, channels, roles, and permission overwrites.
It talks to the Discord REST API only. It does not log in to the gateway, so it needs no privileged intents and the bot does not have to stay online.
Tools (95)
Area | Tools |
Overview |
|
Channels |
|
Permissions |
|
Roles |
|
Layout |
|
Backup |
|
Members |
|
AutoMod |
|
Community |
|
Emojis and stickers |
|
Invites, webhooks, events |
|
Messages |
|
Access audit |
|
Templates (local) |
|
Server templates (Discord) |
|
Activity |
|
Stages |
|
Threads and forums |
|
Buttons are limited to link buttons. The server has no gateway connection, so nothing could receive a click on any other kind.
Listing members (search_members, list_role_members, snapshot with includeMembers) needs the Server Members Intent. Turn it on in the Developer Portal (Bot, Privileged Gateway Intents). The tool tells you so if it is off.
Related MCP server: discord-mcp
Setup
1. Create a bot
Open the Discord Developer Portal, create an application, and add a bot.
Copy the bot token (Bot, then Reset Token). Keep it secret.
Invite the bot to your server with one of these URLs (replace
YOUR_CLIENT_ID).
Structure only (View Channels, Manage Channels, Manage Roles):
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=268436496All tools (adds Manage Server, Manage Webhooks, Manage Events, Manage and Create Expressions, Create Invite, View Audit Log, Send Messages, Embed Links, Read Message History, Manage Messages, Pin Messages, Create Public Threads, Send Messages in Threads, Manage Threads, Kick Members, Ban Members, Moderate Members, Move Members, Mute Members, Add Reactions, Send Polls, Manage Nicknames):
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=2824982413536503A tool fails with a clear error if the bot lacks the permission it needs, so you can start with the smaller set.
Move the bot's role above any role it should manage. Discord does not let a bot edit roles above its own, or grant permissions it does not have.
2. Add the server to your MCP client
Claude Code:
claude mcp add -s user diserverbuilder -- npx -y diserverbuilder-mcpClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"diserverbuilder": {
"command": "npx",
"args": ["-y", "diserverbuilder-mcp"]
}
}
}3. Save the bot token
npx diserverbuilder-mcp authIt asks for the token (the input is hidden), checks it with Discord, and saves it to ~/.diserverbuilder/config.json, readable only by you. The token never appears in your shell history, your MCP config or a chat. Run it again whenever you reset the token. auth status shows which token is in use, and auth logout deletes the saved one.
You can also set the DISCORD_BOT_TOKEN environment variable instead (for example in the env of the MCP entry). It takes priority over the saved token.
Requires Node.js 20 or later.
Troubleshooting
Message | Cause and fix |
| The token is wrong or was reset. Copy a fresh one from the Developer Portal (Bot, Reset Token) and run |
| Re-invite the bot with the permissions above, and move its role above any role it edits. |
| The bot is not in that server or cannot view the channel, or the action needs the Administrator permission (Discord templates, Community). |
| The ID is wrong or belongs to another server. Look it up with |
| Run |
If a token ever ends up in a chat, a log or a repository, reset it in the Developer Portal right away.
Environment variables
Name | Required | Description |
| No | Bot token. Takes priority over the one saved by |
| No | Default server ID. If unset, pass |
| No | Where |
| No | Where snapshots are saved. Default |
| No | Set to |
| No | Comma-separated tool groups to register, for example |
Safety
apply_layoutis a dry run unless you passdryRun: false. It matches existing channels by name, so it moves and updates them instead of duplicating.Channels missing from the layout are left alone. They are deleted only with
prune: trueanddryRun: false.A real
apply_layoutrun saves a snapshot first. Callsnapshotyourself before other large changes.Set
DISERVERBUILDER_READONLY=1to let an assistant look around without being able to change anything.send_messageandedit_messagesuppress@everyoneand other mentions unless you passallowMentions: true.apply_layoutleaves the permissions of existing channels alone by default.syncPermissions: "merge"adds the declared bits (declared bits win, everything else stays)."replace"makes role overwrites match exactly: undeclared role overwrites are removed and member overwrites stay. The dry run shows each change.export_layoutincludes uncategorized channels, slowmode, voice limits, forum tags and role overwrites, so exporting and applying an unchanged server reports "Nothing to change". Member overwrites are skipped unlessincludeMembers: true, and unsupported channel types are skipped and listed. Do not apply an export withprune: trueif it lists skipped types, or those channels are deleted.Role names are matched without case. If several roles share a name, tools stop and ask for the role ID instead of guessing, and
apply_rolesskips that role.snapshotalso records server settings, emojis, stickers, scheduled events, AutoMod rules, onboarding and the welcome screen. Parts the bot cannot read are skipped with a note.diff_snapshotshows what changed since one.kick_member,ban_memberandtimeout_memberact immediately and have no dry run. A timeout lasts at most 28 days, and a ban can delete up to 7 days of the user's messages. Reasons go to the audit log.purge_messagesis a dry run by default. It looks at the newest messages (up to 500), keeps pinned ones unless told otherwise, and leaves messages older than 14 days, which Discord cannot bulk-delete. Deleted messages cannot be restored.edit_onboardingreplaces all questions with the list you pass, so read them withget_onboardingfirst. It needs the Community feature.execute_webhooktakes only the webhook ID. The secret token is fetched inside the tool and never shown, including in error messages.apply_rolesandsync_permissionsalso default to a dry run.apply_rolesnever deletes roles.restore_snapshotonly recreates what is missing (matched by name) and never changes or deletes existing items. It is a dry run by default.Discord changes the parent of only one channel per bulk call, so
reordercannot move several channels between categories at once.apply_layouthandles that for you.delete_channelanddelete_roleneed the exact current name anddelete_channelchecks that the channel belongs to the given server. Deleted channels and their messages cannot be restored. Snapshots do not include messages.apply_templatebuilds a local template: it creates the template's roles and channels that are missing and keeps everything else. It is a dry run by default, saves a snapshot before a real run, takes more than a minute for a large template (Discord rate limits), so an MCP client with a 60-second timeout may report a timeout while the run continues, and a second run reports nothing to change. The bot can only give a role permissions it holds itself, so a template that asks for more is refused before anything changes; the built-in roles stay within the "All tools" invite. Stage channels need a Community server, so runenable_communityfirst (the dry run says so, and a real run is refused without it).list_templatesandsave_templatehandle files on your computer only; the Discord server templates (discord.newlinks) are the*_guild_templatetools, and Discord allows only one per server (a second create fails with code 30031).check_accessandaudit_permissionsonly read.check_accessfollows Discord's order (owner and Administrator first, then @everyone and roles, then channel overwrites, then the member). Overwrites on a category do not reach its channels by themselves, so check the channel.inactive_channelsandactivity_reportnever return message text. The report's optional sample reads at most 100 messages from each of 25 channels, so counts in busy channels are lower bounds.enable_communityanddisable_communityare dry runs by default. Enabling can raise the verification level and turn the explicit content filter on, because Discord requires both. Turning Community on or off, and the*_guild_templatetools, need the Administrator permission on the bot's role; only the server owner can grant it. The stage tools need a Community server.end_stageanddelete_guild_templateneed the exact current topic or name.The token has full channel and role management rights on the server. Keep it out of repositories and shared configs.
authstores it in a file only you can read.
Development
pnpm install
pnpm run typecheck
pnpm test # needs Bun; no Discord access or token required
pnpm run build # bundles src/ to dist/index.js (needs Bun)
pnpm start # runs dist/index.js over stdioLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Build Discord communities with AI: roles, channels, modules, automations and reviewed announcements.
The AI admin for Discord: manage channels, roles, members, moderation and automations.
Build and change Discord bots by describing them: slash commands, events, embeds, modals and data.
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage a Discord server, including creating channels, categories, roles, setting permissions, and assigning roles through natural language commands.-
- FlicenseAqualityCmaintenanceEnables AI clients to manage Discord servers, including channels, messages, roles, members, permissions, threads, invites, events, webhooks, and emoji, through natural language commands.551-
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Discord through the REST API, supporting message reading and sending, channel and guild management, threads, pins, and reactions.17MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with the Discord platform for managing servers, channels, messages, roles, members, forums, and webhooks through natural language.1,578 npmMIT