Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I didn't want a stranger's code holding my Discord bot token, so I wrote my own MCP server

说明与用途

作者构建了一个自托管的 MCP 服务器,以在不将令牌暴露给第三方代码的情况下管理 Discord 机器人。该服务器在 Docker 中运行,提供 67 个工具、安全设置和清晰的错误报告。

问题

The author needed a Discord bot management tool that did not expose the bot token to third‑party code, while still providing a wide range of administrative functions.

结果

The self‑hosted MCP server provides 67 Discord management tools, strict safety settings, and clear error reporting, allowing the author to manage a real Discord server without exposing the bot token to external code.

工作流

  • 1. Create a Discord bot with desired permissions. 2. Pull the discord‑mcp Docker image. 3. Store the bot token in a .env file. 4. Add the MCP server to Claude Code with the docker run command. 5. Optionally set READ_ONLY=true to inspect the server before enabling write tools.
  • 6. Use the MCP client to invoke tools such as audit_permissions, export_template, apply_template, etc.
  • 7. Monitor logs for permission errors or rate‑limit issues.
  • 8. Adjust configuration (READ_ONLY, ALLOWED_GUILD_IDS, DISABLED_TOOLS) as needed.

证据

I wanted Claude Code to manage my Discord server. Create channels, sort out roles, clean up messages, check the audit log, the boring admin stuff.

来源

Every one of them needs your bot token. My bot has admin-level permissions on a server with real people in it.

来源

It's small enough to read end to end, it runs locally in Docker, and it only does what I put in it.

来源

Three settings narrow down what the bot can do beyond its Discord permissions: READ_ONLY, ALLOWED_GUILD_IDS, DISABLED_TOOLS.

来源

The first release with write tools came after a release that was only safety rails.

来源

The README walks through that.

来源

  • 记录日期: 2026-11-02T03:44:00.557Z