
Discord Management Mcp
io.github.TheStreamCodePublished by GitHub account TheStreamCodev0.2.0Updated Nov 7, 2026
Safe-by-default Discord management MCP with JSON backups, restore planning, and guarded mutations.
Overview
Local stdio MCP server that lets an assistant inspect, back up and manage Discord servers, with confirmation and backup guards on every change.
- What you can do
- Inspect guilds, members and audit logs, and list channels and roles
- Create, diff and plan restores from local JSON backups
- Apply guarded changes to channels, roles and server settings
- Run moderation and AutoMod actions, and set emergency incident actions
- Manage server configuration such as community and discovery settings
- When to use it
- Use it when you want an assistant to audit a Discord server, take a snapshot before risky edits, or carry out channel, role and moderation changes from a local MCP client with an explicit confirmation and backup trail.
- Requirements
- Node.js 24 or newer and the npm package run via npx. A Discord bot token in DISCORD_TOKEN, plus a bot invited to the target guild with the permissions the intended tools need. Optional BACKUP_DIR, LOG_LEVEL, ENABLE_MESSAGE_CONTENT and ENABLE_GUILD_MEMBERS; the last two also need matching privileged intents enabled in the Discord Developer Portal.
Installation
In SourceWeft
- Open Discord Management Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Discord Management MCP
Safe-by-default Discord management from any MCP client
Discord Management MCP is a local Model Context Protocol (MCP) server for inspecting, backing up, and managing Discord guilds. It runs over stdio, keeps the bot token and backup files on the operator's machine, and places confirmation, backup, and restore guards in front of every mutation. The server exposes 54 tools across guild inventory, moderation, roles, channels, server settings, backups, and restore planning.
It works with any MCP client that supports local stdio servers, including Claude Desktop, Claude Code, Cursor, VS Code, Codex, Windsurf, and Cline. This independently developed project is not affiliated with, endorsed by, sponsored by, or approved by Discord Inc.
New to Discord bots? The setup and first use guide walks through creating the application, inviting the bot with the right permissions, copying the server ID, registering the client, verifying the connection, and running the first safe backup and restore.
Install
The published package runs with one command:
The package is published on npm as discord-management-mcp and declares MCP registry metadata for io.github.TheStreamCode/discord-management-mcp through package.json and server.json.
Register with your client
Every client needs the same command, arguments, and DISCORD_TOKEN environment variable. Paste the equivalent of this entry into the client's MCP configuration:
Claude Desktop, Cursor, Windsurf, and Cline accept the mcpServers JSON shape shown above. Clients that use a different configuration schema accept the same command, args, and env values. See each client's own documentation for the exact file or command.
Set up
The short version, with the full walkthrough in setup and first use:
- Create the bot. Developer Portal > New Application > Bot > Reset Token. That token is the only credential the server needs. Do not use the Application ID, Public Key, or OAuth2 client secret.
- Invite it. OAuth2 > URL Generator > scope
botplus the permissions you need. Start with View Channels, Manage Channels, Manage Roles, Manage Server, View Audit Log, and the moderation permissions you plan to use. Then drag the bot role above the roles it must edit. - Copy the server ID. Enable Developer Mode, right-click the server icon, Copy Server ID. This number is the
guildIdargument, not the bot's application ID. - Register the client. Use the configuration in Register with your client with
DISCORD_TOKENinenv, or put the token in.env.localin the working directory. - Verify and back up. Ask the client to run
discord_list_guilds, thendiscord_backup_createfor your server, and readcoverage.channels.complete.
Example first request:
Then change things only through the guarded path: create a backup, review the target objects, apply one small change, and confirm the result. Every mutation needs an audit reason:
High-impact operations also require a guild-matched backupId unless the operator explicitly accepts allowWithoutBackup: true. The tool catalog lists the exact policy for every mutating tool.
Why this one
Many Discord MCP servers stop at read-only inspection or previewing a change, and some route the bot token through a hosted service. Discord Management MCP executes changes locally, but only through a guard and recovery path:
What that means in practice:
- Local by design. The bot token, snapshots, restore plans, and stdio transport stay on the operator's machine. There is no hosted relay and no public HTTP listener.
- Preview, then apply. Backups can be diffed and turned into a restore plan before anything changes, and plans carry a hash that apply can verify.
- Backup to restore promise. A risky change can point at a same-guild snapshot; restore apply writes a fresh pre-restore backup before its first Discord mutation.
- An explicit safety matrix. Every Discord mutation needs
confirm: trueand a reason. The listed high-impact tools need a same-guild backup. Emergency incident actions stay available without one. - Truthful recovery. Restore reports skipped, lossy, applied, and failed operations instead of promising an impossible full rollback.
Backup to restore
The recovery path has three steps:
discord_backup_createwrites a JSON snapshot toBACKUP_DIRatomically, strips invite codes, webhook tokens, and other secrets, and records channel coverage incoverage.channels.discord_backup_diffanddiscord_backup_restore_planshow what would change. A plan includes aplanHashandNOT_RESTOREDwarnings for captured sections that Discord cannot recreate.discord_backup_restore_applycan verify anexpectedPlanHash, creates a pre-restore backup, then applies supported role and channel fields conservatively. Deletes remain opt-in.
Discord cannot restore original IDs after delete and recreate, message or audit-log history, exact invite codes, webhook tokens, or every community and discovery setting. The server reports those limits instead of hiding them. See safety and backups for the full model.
Tool coverage
The server registers 54 tools. See the tool catalog for every name and the guard matrix for the backup policy.
Read-only tools are annotated as read-only and never require confirmation. Mutating Discord tools require confirm: true plus a non-empty audit reason, and mutations run through a shared queue so they cannot interleave. discord_backup_create only writes a local snapshot and does not require confirmation.
Safety model
- Every Discord mutation requires
confirm: trueand a non-emptyreason; the reason is passed to Discord where audit-log reasons are supported. - High-impact tools require a backup from the same guild, or an explicit
allowWithoutBackup: trueacknowledgement. discord_set_incident_actionsis intentionally exempt: it is used during raids, and its changes are reversible.- Restore apply creates its own pre-restore backup and retains its ID on every error path.
- Backup writes are atomic, and backup paths are confined to the project directory with symlink and junction rejection.
- Read-only tools are implemented and annotated as read-only.
See safety and backups for the guard matrix, channel coverage, and restore behavior, and design and trust boundaries for the runtime model. Report vulnerabilities privately through SECURITY.md.
Requirements
- Node.js 24 or newer.
- A Discord application with a bot token.
- The bot invited to the target guild with only the permissions required for the intended tools.
ENABLE_MESSAGE_CONTENT and ENABLE_GUILD_MEMBERS are opt-in and require the matching privileged intents in the Discord Developer Portal. Since 2026-06-10, Discord reviews privileged intent usage at 10,000 users rather than 100 servers, and approved apps must reapply annually. See configuration for details.
Configuration
Configuration is read from the process environment first, then from .env.local in the working directory. Boolean values accept true/false, yes/no, on/off, or 1/0.
See the configuration reference for token rules, logging behavior, and privileged-intent setup.
Privacy and security
Everything runs locally over stdio: the bot token, backup files, restore plans, and the server process itself never leave the operator's machine. Mutations are guarded by explicit confirmation and by backups that are validated for size, depth, structure, symlinks, and guild identity before planning or restore. A restore creates a pre-restore backup before its first Discord mutation and stops truthfully on operation failure. See design and trust boundaries and safety and backups for the full model, and SECURITY.md for private vulnerability reporting.
Troubleshooting
The server exits because DISCORD_TOKEN is missing or invalid
Set the Bot Token in the process environment or in .env.local in the working directory. A value that looks like a Discord Application Public Key is rejected with an explicit message: use the Bot Token, not the Application ID, Public Key, or OAuth2 client secret.
Message content comes back empty
Message-content tools need both ENABLE_MESSAGE_CONTENT=true and the Message Content Intent enabled in the Discord Developer Portal. Without both, Discord can return empty content, embeds, and attachments fields. Restart the server after changing either side. If the app is approaching the review threshold, remember that privileged intent access is reviewed at 10,000 users and must be renewed annually.
A mutation is rejected before it reaches Discord
Mutating tools require confirm: true and a non-empty reason. High-impact tools additionally require a backupId from the same guild, or an explicit allowWithoutBackup: true acknowledgement. discord_set_incident_actions is the exception for emergency use. Check the guard matrix before retrying.
Channels are missing from a backup or channel list
The bot can only back up channels it can view. Starting 2026-11-16, Discord omits channels the bot cannot view from GET /guilds/{id}/channels, and gateway payloads can carry obfuscated channel objects. Backups record this in coverage.channels and warn when coverage is incomplete. Grant VIEW_CHANNEL where the channels matter, and treat complete: false as a partial rollback point. See channel coverage and obfuscation.
Restore reports skipped or lossy operations
Discord cannot recreate original IDs, message or audit-log history, exact invite codes, webhook tokens, managed integration objects, or every community and discovery setting. Check the plan's planHash and its NOT_RESTORED warnings, then review the reported operations before retrying.
Logs are too quiet or too noisy
Set LOG_LEVEL to error, warn, info, or debug. Logs are JSON lines on stderr, so stdout stays reserved for MCP protocol traffic. Use debug while diagnosing a tool call and error for quiet hosts.
Development
Requirements: Node.js 24 or newer and npm from the lockfile.
npm run verify:mcp starts the built server over stdio with a placeholder token and checks the advertised MCP surface: 54 tools, deterministic tool listing, titles, descriptions, input and output schemas, and annotation hints. It never calls the Discord API.
Tests use mocks and must not contact Discord. Live mutations are never part of routine verification. The repository keeps its engineering guidance in AGENTS.md; it is not shipped in the npm package. See CONTRIBUTING.md for contribution rules.
Support
See SUPPORT.md. Use GitHub Issues for reproducible bugs and feature proposals, and report vulnerabilities privately through GitHub Security Advisories.
Contributing
See CONTRIBUTING.md. Pull requests must pass npm run preflight, npm run verify:mcp, and the required CI checks.
License
MIT, see LICENSE. Copyright (c) 2026 Michael Gasperini (Mikesoft).
This independently developed project is not affiliated with, endorsed by, sponsored by, or approved by Discord Inc. Discord is a trademark of Discord Inc. See NOTICE for the applicable Discord terms and policies.
Maintained by Michael Gasperini (Mikesoft). If this project helps you manage Discord communities safely, consider sponsoring its maintenance.
Source: README.md at commit 42cb7b3
Tools
0Version history
1- v0.2.0LatestOct 31, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts