Discord Mcp
概覽
什麼是 Discord-MCP?
Discord-MCP 是一個強大的伺服器,旨在與 Discord 整合,實現 AI 助手與 Discord 平台之間的無縫互動。這個工具通過自動化各種任務和提供先進的功能,提升用戶體驗,簡化 Discord 社區內的溝通和互動。
Discord-MCP 的功能
- AI 整合:允許 AI 助手直接與 Discord 互動,提供即時回應和協助。
- 自動化能力:自動化重複性任務,使用戶更容易管理他們的 Discord 伺服器。
- 友好的介面:以簡單為設計理念,讓所有技能水平的用戶都能輕鬆使用。
- 開源:作為一個公共庫,用戶可以參與其開發並根據需要進行自定義。
- 社區支持:一個不斷增長的用戶和開發者社區,分享使用 Discord-MCP 的技巧、竅門和支持。
如何使用 Discord-MCP
- 安裝:從 GitHub 克隆庫並按照 README 文件中的安裝說明進行操作。
- 配置:設置你的 Discord 機器人並配置必要的權限,以允許其與你的伺服器互動。
- 整合:將你的 AI 助手連接到 Discord-MCP,使其能夠回應命令和消息。
- 自定義:根據需要修改代碼,以調整功能以符合你的具體要求。
- 互動:開始在 Discord 中使用你的 AI 助手,增強互動並自動化任務,提供更流暢的體驗。
常見問題
問:Discord-MCP 是免費使用的嗎?
答:是的,Discord-MCP 是一個開源項目,免費使用。
問:我可以為這個項目做貢獻嗎?
答:當然可以!歡迎貢獻。你可以分叉庫,進行更改,並提交拉取請求。
問:Discord-MCP 使用了哪些編程語言?
答:Discord-MCP 主要使用 JavaScript 和 Node.js 構建。
問:我該如何報告問題或錯誤?
答:你可以通過在 GitHub 庫的 "Issues" 標籤下創建新問題來報告問題。
問:我可以在哪裡找到 Discord-MCP 的文檔?
答:文檔可在庫的 README 文件中找到,並通過社區論壇和討論獲得。
通過使用 Discord-MCP,用戶可以顯著提升他們的 Discord 體驗,使互動更加高效和愉快。
詳細
📖 Description
A Model Context Protocol (MCP) server for the Discord API (JDA), allowing seamless integration of Discord Bot with MCP-compatible applications like Claude Desktop.
Enable your AI assistants to seamlessly interact with Discord. Manage channels, send messages, and retrieve server information effortlessly. Enhance your Discord experience with powerful automation capabilities.
🔬 Installation
► 🐳 Docker Installation (Recommended)
NOTE: Docker installation is required. Full instructions can be found on docker.com.
{
"mcpServers": {
"mcp-server": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "DISCORD_TOKEN=<YOUR_DISCORD_BOT_TOKEN>",
"-e", "DISCORD_GUILD_ID=<OPTIONAL_DEFAULT_SERVER_ID>",
"saseq/discord-mcp:latest"
]
}
}
}
<details>
<summary style="font-size: 1.35em; font-weight: bold;">
🔧 Manual Installation
</summary>
Clone the repository
git clone https://github.com/SaseQ/discord-mcp
Build the project
NOTE: Maven installation is required to use the mvn command. Full instructions can be found here.
cd discord-mcp
mvn clean package # The jar file will be available in the /target directory
Configure AI client
Many code editors and other AI clients use a configuration file to manage MCP servers.
The Discord MPC server can be configured by adding the following to your configuration file.
NOTE: You will need to create a Discord Bot token to use this server. Instructions on how to create a Discord Bot token can be found here.
{
"mcpServers": {
"discord-mcp": {
"command": "java",
"args": [
"-jar",
"/absolute/path/to/discord-mcp-0.0.1-SNAPSHOT.jar"
],
"env": {
"DISCORD_TOKEN": "YOUR_DISCORD_BOT_TOKEN",
"DISCORD_GUILD_ID": "OPTIONAL_DEFAULT_SERVER_ID"
}
}
}
}
The DISCORD_GUILD_ID
environment variable is optional. When provided, it sets a default Discord server ID so any tool that accepts a guildId
parameter can omit it.
Install Discord MCP Server automatically via Smithery:
npx -y @smithery/cli@latest install @SaseQ/discord-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>
</details>
<details>
<summary style="font-size: 1.35em; font-weight: bold;">
🖲 Cursor Installation
</summary>
Go to: Settings
-> Cursor Settings
-> MCP
-> Add new global MCP server
Pasting the following configuration into your Cursor ~/.cursor/mcp.json
file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json
in your project folder. See Cursor MCP docs for more info.
{
"mcpServers": {
"mcp-server": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "DISCORD_TOKEN=<YOUR_DISCORD_BOT_TOKEN>",
"-e", "DISCORD_GUILD_ID=<OPTIONAL_DEFAULT_SERVER_ID>",
"saseq/discord-mcp:latest"
]
}
}
}
</details>
<details>
<summary style="font-size: 1.35em; font-weight: bold;">
⌨️ Claude Code Installation
</summary>
Run this command. See Claude Code MCP docs for more info.
claude mcp add mcp-server -- docker run --rm -i -e DISCORD_TOKEN=<YOUR_DISCORD_BOT_TOKEN> -e DISCORD_GUILD_ID=<OPTIONAL_DEFAULT_SERVER_ID> saseq/discord-mcp:latest
</details>
🛠️ Available Tools
Server Information
get_server_info
: Get detailed discord server information
User Management
get_user_id_by_name
: Get a Discord user's ID by username in a guild for ping usage<@id>
send_private_message
: Send a private message to a specific useredit_private_message
: Edit a private message from a specific userdelete_private_message
: Delete a private message from a specific userread_private_messages
: Read recent message history from a specific user
Message Management
send_message
: Send a message to a specific channeledit_message
: Edit a message from a specific channeldelete_message
: Delete a message from a specific channelread_messages
: Read recent message history from a specific channeladd_reaction
: Add a reaction (emoji) to a specific messageremove_reaction
: Remove a specified reaction (emoji) from a message
Channel Management
create_text_channel
: Create text a channeldelete_channel
: Delete a channelfind_channel
: Find a channel type and ID using name and server IDlist_channels
: List of all channels
Category Management
create_category
: Create a new category for channelsdelete_category
: Delete a categoryfind_category
: Find a category ID using name and server IDlist_channels_in_category
: List of channels in a specific category
Webhook Management
create_webhook
: Create a new webhook on a specific channeldelete_webhook
: Delete a webhooklist_webhooks
: List of webhooks on a specific channelsend_webhook_message
: Send a message via webhook
<hr>If
DISCORD_GUILD_ID
is set, theguildId
parameter becomes optional for all tools above.
A more detailed examples can be found in the Wiki.
伺服器配置
{
"mcpServers": {
"discord-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--saseq--discord-mcp--discord-mcp",
"java -Dserver.port=$PORT $JAVA_OPTS -jar target/*jar"
],
"env": {
"DISCORD_TOKEN": "discord-token"
}
}
}
}