Skip to main content
Glama
669px

Dc-MCP

by 669px

Dc-MCP

Discord 管理 MCP 服务器,适用于 Cursor。

Dc-MCP 通过模型上下文协议 (stdio) 将 Cursor 连接到 Discord 机器人。Cursor 可以检查服务器的完整结构,并通过明确的工具执行精确的管理操作——而不是一个自由形式的 Discord API 执行器。

Cursor  ──MCP (stdio)──▶  Dc-MCP  ──discord.py──▶  Discord API

功能

  • 为 Cursor 提供完整的服务器地图(discord_analyze_server / discord_server_structure

  • 用于频道、角色、成员、消息、管理、邀请、Webhook 和审计日志的精细工具

  • 集中权限 + 层级检查(不针对所有者,不高于机器人的角色)

  • 破坏性操作保护(confirm=true + 可选硬禁用)

  • 结构化 JSON 结果;绝不返回或记录机密信息

  • 与 Cursor 的 MCP 客户端兼容的 Stdio 传输

Related MCP server: Discord MCP Server

要求

  • Python 3.11+

  • 一个 Discord 应用程序 + 机器人

  • 特权意图:服务器成员意图消息内容意图

快速开始

git clone https://github.com/669px/Dc-MCP.git
cd Dc-MCP
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
cp .env.example .env

编辑 .env

DISCORD_BOT_TOKEN=your_bot_token
DISCORD_GUILD_ID=your_guild_id
ALLOW_DANGEROUS_ACTIONS=true
REQUIRE_CONFIRMATION=true
LOG_LEVEL=INFO

运行:

python -m src.main

日志输出到 stderrstdout 保留给 MCP JSON-RPC。

Discord 机器人设置

  1. Discord 开发者门户 创建一个应用程序

  2. 添加一个机器人并将令牌复制到 DISCORD_BOT_TOKEN

  3. 启用 服务器成员意图消息内容意图

  4. 邀请机器人并授予权限,例如管理频道/角色/消息、踢出/封禁、管理成员、查看审计日志、管理 Webhook/服务器、发送消息、嵌入链接、添加反应、读取消息历史、创建即时邀请

  5. 将机器人角色放置在足够高的位置,以便管理您打算管理的角色/成员

  6. 设置 DISCORD_GUILD_ID 以将所有操作限制在一个服务器内

Cursor MCP 配置

项目或用户 mcp.json

{
  "mcpServers": {
    "discord-admin": {
      "command": "/ABSOLUTE/PATH/TO/Dc-MCP/.venv/bin/python",
      "args": ["-m", "src.main"],
      "cwd": "/ABSOLUTE/PATH/TO/Dc-MCP"
    }
  }
}

机密信息从 cwd 中的 .env 加载。保存后,在 设置 → 工具和 MCP 下启用/刷新 discord-admin

命令行:

agent mcp enable discord-admin
agent mcp list

核心工具

工具

用途

discord_analyze_server

为 Cursor 提供完整的服务器地图 + 摘要

discord_server_structure

更轻量的类别/频道/角色树

discord_server_info

服务器元数据

discord_list_channels / discord_list_roles / discord_list_members

清单

discord_get_audit_log

过滤的审计条目

还包括:频道 CRUD + 权限、角色 CRUD + 分配/移除、成员管理(踢出/封禁/超时/昵称)、消息(发送/编辑/删除/置顶/反应)、邀请、Webhook 和 discord_purge_messages

REQUIRE_CONFIRMATION=true 时,破坏性工具需要 confirm=true

安全

  • 绝不提交 .env

  • 建议使用 REQUIRE_CONFIRMATION=true

  • 使用 DISCORD_GUILD_ID 限定范围

  • 提及默认受限(除非允许,否则 @everyone / 大量角色关闭)

  • 没有 shell、eval、HTTP 代理或通用 API 执行器工具

  • 绝不返回 Webhook 令牌

项目结构

src/
  main.py              MCP entrypoint (stdio)
  config.py            Environment settings
  discord_client.py    discord.py client
  permissions.py       Guild / hierarchy / confirmation gates
  errors.py            Structured error mapping
  responses.py         Success / failure payloads
  server_map.py        Full guild analysis for Cursor
  tools/               Granular MCP tools
tests/                 Unit tests (mocked Discord)

开发

source .venv/bin/activate
python -m compileall src
python -m pytest
python -c "import discord; print(discord.__version__)"

Discord 限制

  • 批量删除仅适用于 14 天以内的消息

  • 批量/清除上限默认为 100

  • 无法管理服务器所有者或位于机器人最高角色之上/之下的目标

  • 无法编辑托管/集成角色

  • 成员列表/搜索需要服务器成员意图

许可证

MIT

Install Server
A
license - permissive license
C
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Provides comprehensive administrative control over Discord communities through 128 operations covering moderation, messaging, and channel management. It enables AI assistants to manage server roles, events, and automations via the Model Context Protocol.
    3
    35
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI clients to manage Discord servers through natural language, offering tools for guilds, channels, messages, roles, members, webhooks, invites, and automations. Includes a conversational agent that responds to @mentions in Discord.
    8
    Apache 2.0
  • A
    license
    B
    quality
    A
    maintenance
    Gives your AI assistant full control of a Discord server: 148 tools for chat, moderation, automod, events, and administration, up to building a complete community server from one paragraph. Every destructive action previews first and waits for your confirmation.
    100
    377
    6
    Elastic 2.0
  • F
    license
    Not graded
    quality
    B
    maintenance
    Gives AI agents full control over Discord server creation and configuration. Exposes 36 tools covering guild lifecycle, channels, roles, members, content, messages, templates, and a declarative blueprint engine.

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • Shared, permission-aware company context for AI agents, with provenance, approvals and audit.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/669px/Dc-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server