V3

v-3/discordmcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

243 stars 108 forks 品質 58 トレンド 18

v-3/DiscordMCPは、https://github.com/v-3/discordmcp.からインポートされたMCPサーバー候補です。

概要

v-3/DiscordMCPは、https://github.com/v-3/discordmcp.からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

モデルコンテキストプロトコル(MCP)サーバーで、LLMがDiscordチャンネルとやり取りできるようにし、DiscordのAPIを通じてメッセージの送信や読み取れます。このサーバーを使えば、ClaudeのようなLLMはユーザーのコントロールとセキュリティを維持しつつ、Discordチャンネルと直接やり取りできます。

特徴

  • Discordチャンネルへのメッセージ送信
  • チャンネルからの最近のメッセージを読む
  • 自動サーバーおよびチャネルの発見
  • チャンネル名とIDの両方のサポート
  • 適切なエラー処理と検証

前提条件

  • Node.js 16.x以上
  • Discordボットトークン
  • ボットは適切な許可を得てサーバーに招待されなければなりません:
  • メッセージの読み取り/チャンネル表示
  • メッセージ送信
  • メッセージ履歴を読む

セットアップ

  1. このリポジトリのクローン:

  2. 依存関係のインストール:

  3. Discordボットトークンでルートディレクトリに.envファイルを作成します:

  4. サーバーの構築:

デスクトップ向けClaudeでの使用

  1. Claude for Desktopの設定ファイルを開く:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • ウィンドウズ:%APPDATA%\Claude\claude_desktop_config.json
  1. Discord MCPサーバー構成の追加:

  2. デスクトップ版のClaude再起動

利用可能なツール

メッセージ送信

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Discord MCP Server

A Model Context Protocol (MCP) server that enables LLMs to interact with Discord channels, allowing them to send and read messages through Discord’s API. Using this server, LLMs like Claude can directly interact with Discord channels while maintaining user control and security.

Features

  • Send messages to Discord channels
  • Read recent messages from channels
  • Automatic server and channel discovery
  • Support for both channel names and IDs
  • Proper error handling and validation

Prerequisites

  • Node.js 16.x or higher
  • A Discord bot token
  • The bot must be invited to your server with proper permissions:
    • Read Messages/View Channels
    • Send Messages
    • Read Message History

Setup

  1. Clone this repository:
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with your Discord bot token:
DISCORD_TOKEN=your_discord_bot_token_here
  1. Build the server:
npm run build

Usage with Claude for Desktop

  1. Open your Claude for Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the Discord MCP server configuration:

{
  "mcpServers": {
    "discord": {
      "command": "node",
      "args": ["path/to/discordmcp/build/index.js"],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token_here"
      }
    }
  }
}
  1. Restart Claude for Desktop

Available Tools

send-message

Sends a message to a specified Discord channel.

Parameters:

  • server (optional): Server name or ID (required if bot is in multiple servers)
  • channel: Channel name (e.g., “general”) or ID
  • message: Message content to send

Example:

{
  "channel": "general",
  "message": "Hello from MCP!"
}

read-messages

Reads recent messages from a specified Discord channel.

Parameters:

  • server (optional): Server name or ID (required if bot is in multiple servers)
  • channel: Channel name (e.g., “general”) or ID
  • limit (optional): Number of messages to fetch (default: 50, max: 100)

Example:

{
  "channel": "general",
  "limit": 10
}

Development

  1. Install development dependencies:
npm install --save-dev typescript @types/node
  1. Start the server in development mode:
npm run dev

Testing

You can test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

Examples

Here are some example interactions you can try with Claude after setting up the Discord MCP server:

  1. “Can you read the last 5 messages from the general channel?”
  2. “Please send a message to the announcements channel saying ‘Meeting starts in 10 minutes’”
  3. “What were the most recent messages in the development channel about the latest release?”
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector node build/index.js
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "discord": { "command": "node", "args": ["path/to/discordmcp/build/index.js"], "env": { "DISCORD_TOKEN": "your_discord_bot_token_here" } } } }