BM

braindao/mcp-discord

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

5 stars 5 forks 质量 76 趋势 17MIT

Model Context Protocol Server for interacting with Discord Servers

概览

The Discord MCP Server enables AI agents to interact with the Discord platform through the Model Context Protocol (MCP). This server provides comprehensive access to Discord's features including messaging, channel management, forum operations, reactions, and webhook management. By implementing MCP, this server allows Large Language Models (LLMs) to read and send messages, manage channels and forums, handle reactions, and interact with webhooks directly through their context window, bridging the gap between AI and Discord communities. The server supports bi-directional communication through a Sampling feature, allowing the bot to listen to messages and respond automatically when mentioned.

README

以下为原文 README 节选,完整内容请查看原文。

💬 Discord MCP Server

Overview

The Discord MCP Server enables AI agents to interact with the Discord platform through the Model Context Protocol (MCP). This server provides comprehensive access to Discord’s features including messaging, channel management, forum operations, reactions, and webhook management.

By implementing MCP, this server allows Large Language Models (LLMs) to read and send messages, manage channels and forums, handle reactions, and interact with webhooks directly through their context window, bridging the gap between AI and Discord communities.

The server supports bi-directional communication through a Sampling feature, allowing the bot to listen to messages and respond automatically when mentioned.

Features

  • Message Management: Send, read, and delete messages in Discord channels
  • Channel Operations: Create and delete text channels with custom topics
  • Forum Support: Create, read, reply to, and delete forum posts with tag support
  • Reaction Handling: Add single or multiple reactions to messages
  • Webhook Integration: Create, edit, delete, and send messages via webhooks
  • Server Information: Retrieve detailed server information including channels and member counts

Installation

To use this server without installing it globally:

npx @iqai/mcp-discord --config ${DISCORD_TOKEN}

Build from Source

git clone https://github.com/IQAIcom/mcp-discord.git
cd mcp-discord
pnpm install
pnpm run build

Running with an MCP Client

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).

Minimal Configuration

{
  "mcpServers": {
    "discord": {
      "command": "npx",
      "args": ["-y", "@iqai/mcp-discord", "--config", "YOUR_DISCORD_TOKEN"]
    }
  }
}

Advanced Configuration (Local Build)

{
  "mcpServers": {
    "discord": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-discord/dist/index.js"],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token",
        "SAMPLING_ENABLED": "true",
        "TRANSPORT": "stdio"
      }
    }
  }
}

Configuration (Environment Variables)

Variable Required Description Default
DISCORD_TOKEN Yes Discord bot token from the Developer Portal -
SAMPLING_ENABLED No Enables bi-directional message sampling true
TRANSPORT No Transport method: stdio or http stdio
HTTP_PORT No Port for HTTP transport 8080
DEFAULT_RATE_LIMIT_SECONDS No Rate limit (seconds) for sampling requests per user 2
在 GitHub 查看完整 README

安装

npx -y @iqai/mcp-discord --config YOUR_DISCORD_TOKEN
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "discord": { "command": "npx", "args": ["-y", "@iqai/mcp-discord", "--config", "YOUR_DISCORD_TOKEN"] } } }