TheeDiscordMCP

TheeDiscordMCP

Local MCP server for inspecting and managing an allowlisted Discord server via Discord's REST API, with safety modes, idempotent JSON blueprints, and destructive-operation safeguards.

Category
访问服务器

README

TheeDiscordMCP

A local MCP server for inspecting and managing an allowlisted Discord server through Discord's official REST API. It covers day-to-day administration, dry-run planning, local resource tracking, audit reasons, and explicit safeguards around high-impact actions.

What it manages

  • Guild settings, roles, role order, and member role assignment
  • Categories, text/announcement/voice/stage/forum/media channels, ordering, and permission overwrites
  • Forum tags, posting guidelines, sorting, and layout
  • Messages: list, send, edit, delete, pin, unpin, and bulk delete
  • Members: list/search, timeout, kick, ban, and unban
  • AutoMod rules, onboarding, welcome screen, emojis, and audit-log reads
  • Idempotent JSON blueprints with a dry-run planner
  • Bot and application profile management, including avatar and banner data URIs
  • A tightly scoped raw REST escape hatch for new Discord endpoints and guild-owned resources

There are 27 MCP tools. Every server call is limited to guild IDs in the local allowlist. The raw escape hatch accepts routes under an allowed guild, its verified channels, webhooks, invites, stage instances, and the operator's commands for that guild. This keeps broad Discord API coverage without exposing unrelated servers.

Safety modes

Mode Reads Create/update Delete, ban, kick, raw writes
read-only yes no no
safe-write yes yes no
full yes yes only with destructive opt-in and exact confirmation

The default is read-only. Blueprint application never deletes resources. It creates or updates matching resources and tracks their Discord IDs in .data/state.json so reruns do not create duplicates.

1. Create the Discord operator

Create a dedicated application in the Discord Developer Portal, add a bot, and invite it only to the server you want to manage. Never use a personal/user token.

For the full tool set, the bot may need:

  • View Channels, Read Message History, Send Messages, Manage Messages, Manage Threads
  • Manage Channels, Manage Roles
  • Moderate Members, Kick Members, Ban Members
  • Manage Guild, View Audit Log
  • Manage Webhooks / Manage Emojis and Stickers only if you use related operations

Administrator is convenient but not required or recommended. Discord role hierarchy still applies: the operator can manage only roles and members below its highest role.

2. Install and configure

Requires Node.js 20.19 or newer and pnpm.

cd TheeDiscordMCP
pnpm install
Copy-Item .env.example .env

Open .env locally and set:

DISCORD_BOT_TOKEN=your_dedicated_bot_token
DISCORD_ALLOWED_GUILD_IDS=123456789012345678
DISCORD_MODE=read-only

Do not paste the token into messages, issue reports, or committed files. To copy a Discord server ID, enable Developer Mode in Discord, right-click the server, and choose Copy Server ID.

Build and verify:

pnpm check

3. Connect an MCP client

Add the server to your MCP client configuration. An editable example is included as mcp.config.example.toml:

[mcp_servers.thee-discord]
command = "node"
args = ["C:/path/to/TheeDiscordMCP/dist/index.js"]
cwd = "C:/path/to/TheeDiscordMCP"
startup_timeout_sec = 20
tool_timeout_sec = 120

Restart the client and export a snapshot before making changes. Review the channels, roles, forums, and permission overwrites while the server is still in read-only mode.

Once the snapshot looks right, set DISCORD_MODE=safe-write, restart the MCP server, and apply ordinary changes. Keep destructive mode disabled until a specific deletion or moderation action is needed.

Blueprint workflow

examples/elalem.blueprint.json provides an English ELALEM support and community layout with restrained category styling, a welcome message, two forum templates, tags, staff privacy, and practical channel names.

Recommended flow:

  1. discord_export_snapshot
  2. Adjust the blueprint to preserve intentional existing resources.
  3. discord_plan_blueprint or discord_apply_blueprint with dryRun: true.
  4. Review every planned action.
  5. Switch to safe-write and run discord_apply_blueprint with dryRun: false.
  6. Export another snapshot and verify the result.

Blueprint channel mentions use {{channel:key}}; they are resolved to real clickable Discord mentions when a message is sent.

The blueprint deliberately performs no deletion. Existing channels or roles with different names are left alone unless their tracked key points to them. Review duplicate or obsolete resources separately before removing anything.

Destructive operations

To permit a specific destructive action temporarily:

DISCORD_MODE=full
DISCORD_ENABLE_DESTRUCTIVE=true

Each destructive tool returns or documents the exact confirmation text it expects, such as DELETE CHANNEL <id>. The confirmation is checked again inside the MCP server. Return to safe-write or read-only afterward.

The raw REST tool treats every non-GET request as destructive. This keeps an unfamiliar endpoint from bypassing the named safety gates.

Development

pnpm typecheck
pnpm test
pnpm build

The server uses stdio, so stdout is reserved for MCP protocol traffic; operational messages go to stderr. Discord rate limits are handled by @discordjs/rest.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选