Skip to content
Back to search

mcp-discord

Implement Discord MCP server enabling AI assistants to interact with the Discord platform.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/barryyip0625--mcp-discord/badge.svg)](/listings/barryyip0625--mcp-discord)

HTML

<a href="/listings/barryyip0625--mcp-discord"><img src="/api/listings/barryyip0625--mcp-discord/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installing via NPM

You can use it with the following command:

npx mcp-discord --config ${DISCORD_TOKEN}

For more details, you can check out the [NPM Package](https://www.npmjs.com/package/mcp-discord).

Installing via Smithery

To install mcp-discord automatically via [Smithery](https://smithery.ai/server/@barryyip0625/mcp-discord)

Installing via Docker

You can run mcp-discord using Docker. The Docker images are automatically built and published to Docker Hub.

**Docker Hub Repository**: [barryy625/mcp-discord](https://hub.docker.com/r/barryy625/mcp-discord)

Docker uses the streamable HTTP server by default via `build/app.js`.

# Pull the latest image
docker pull barryy625/mcp-discord:latest

# Run HTTP server on port 8080
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest

# Override the listening port if needed
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 3000:3000 barryy625/mcp-discord:latest --transport http --port 3000

**Available Tags:** - `latest` - Latest stable version from main branch - `v1.3.8`, etc. - Specific version releases

Manual Installation

# Clone the repository
git clone https://github.com/barryyip0625/mcp-discord.git
cd mcp-discord

# Install dependencies
npm install

# Compile TypeScript
npm run build

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 351 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # MCP-Discord
  2. [![MCP Toplist](https://mcptoplist.com/badge/smithery%2Fbarryyip0625%2Fmcp-discord.svg)](https://mcptoplist.com/server/smithery%2Fbarryyip0625%2Fmcp-discord)
  3. ![](https://badge.mcpx.dev?type=server 'MCP Server') [![Docker Hub](https://img.shields.io/docker/v/barryy625/mcp-discord?logo=docker&label=Docker%20Hub)](https://hub.docker.com/r/barryy625/mcp-discord)
  4. A Discord MCP (Model Context Protocol) server that enables AI assistants to interact with the Discord platform.
  5. <a href="https://glama.ai/mcp/servers/@barryyip0625/mcp-discord">
  6. <img width="380" height="200" src="https://glama.ai/mcp/servers/@barryyip0625/mcp-discord/badge" alt="MCP-Discord MCP server" />
  7. </a>
  8. ## Overview
  9. MCP-Discord provides the following Discord-related functionalities:
  10. - Login to Discord bot
  11. - List servers the bot is a member of
  12. - Get server information
  13. - List members and inspect member details
  14. - List, create, edit, delete, assign, and remove roles
  15. - Search messages in a server
  16. - Read, edit, and delete channel messages
  17. - Send messages to specified channels
  18. - Retrieve forum channel lists
  19. - Create, update, delete, and reply to forum posts
  20. - List forum threads and manage forum tags
  21. - Create, edit, and delete text, forum, voice channels, and categories
  22. - Set and remove channel permission overrides
  23. - Add/remove message reactions
  24. - Create/edit/delete/use webhooks
  25. ## Table of Contents
  26. - [Prerequisites](#prerequisites)
  27. - [Installation](#installation)
  28. - [Configuration](#configuration)
  29. - [Tools Documentation](#tools-documentation)
  30. - [Basic Functions](#basic-functions)
  31. - [Channel Management](#channel-management)
  32. - [Forum Functions](#forum-functions)
  33. - [Messages and Reactions](#messages-and-reactions)
  34. - [Webhook Management](#webhook-management)
  35. - [Role Management](#role-management)
  36. - [Member Management](#member-management)
  37. - [Development](#development)
  38. - [License](#license)
  39. ## Prerequisites
  40. - Node.js (v18.0.0 or higher)
  41. - npm (v7.0.0 or higher)
  42. - A Discord bot with appropriate permissions
  43. - Bot token (obtainable from the [Discord Developer Portal](https://discord.com/developers/applications))
  44. - Message Content Intent enabled
  45. - Server Members Intent enabled
  46. - Presence Intent enabled
  47. - Permissions required in your Discord server:
  48. #### Easiest Setup
  49. - Administrator (Recommended for quick setup and full functionality)
  50. #### Or, select only the required permissions:
  51. - Send Messages
  52. - Create Public Threads
  53. - Send Messages in Threads
  54. - Manage Messages
  55. - Manage Threads
  56. - Manage Channels
  57. - Manage Webhooks
  58. - Manage Roles
  59. - Add Reactions
  60. - View Channel
  61. - Add your Discord bot to your server
  62. - To add your Discord bot to your server, use one of the following invite links (replace `INSERT_CLIENT_ID_HERE` with your bot's client ID):
  63. - **Administrator (full access):**
  64. https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8
  65. - **Custom permissions (minimum required):**
  66. https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=52076489808
  67. > **Note:**
  68. > According to Discord's security model, a bot can only access information from servers it has been explicitly added to.
  69. > If you want to use this MCP server to access a specific Discord server, you must add the bot to that server first.
  70. > Use the invite link below to add the bot to your target server.
  71. ## Installation
  72. ### Installing via NPM
  73. Set `DISCORD_TOKEN` in the environment, then start the server:
  74. ```bash
  75. export DISCORD_TOKEN=your_discord_bot_token
  76. npx mcp-discord
  77. ```
  78. On Windows PowerShell:
  79. ```powershell
  80. $env:DISCORD_TOKEN="your_discord_bot_token"
  81. npx mcp-discord
  82. ```
  83. The server reads that variable itself. An environment variable is still visible to some local readers; this form keeps the token out of the process argument list.
  84. `--config` still accepts a raw token or JSON with `DISCORD_TOKEN`. The value is part of the process arguments, so tools that can read the process list will show it. Prefer the environment variable above.
  85. For more details, you can check out the [NPM Package](https://www.npmjs.com/package/mcp-discord).
  86. ### Installing via Smithery
  87. To install mcp-discord automatically via [Smithery](https://smithery.ai/server/@barryyip0625/mcp-discord)
  88. ### Installing via Docker
  89. You can run mcp-discord using Docker. The Docker images are automatically built and published to Docker Hub.
  90. **Docker Hub Repository**: [barryy625/mcp-discord](https://hub.docker.com/r/barryy625/mcp-discord)
  91. Docker uses the streamable HTTP server by default via `build/app.js`.
  92. ```bash
  93. # Pull the latest image
  94. docker pull barryy625/mcp-discord:latest
  95. # Run HTTP server on port 8080
  96. docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest
  97. # Override the listening port if needed
  98. docker run -e DISCORD_TOKEN=your_discord_bot_token -p 3000:3000 barryy625/mcp-discord:latest --transport http --port 3000
  99. ```
  100. **Available Tags:**
  101. - `latest` - Latest stable version from main branch
  102. - `v1.3.8`, etc. - Specific version releases
  103. ### Manual Installation
  104. ```bash
  105. # Clone the repository
  106. git clone https://github.com/barryyip0625/mcp-discord.git
  107. cd mcp-discord
  108. # Install dependencies
  109. npm install
  110. # Compile TypeScript
  111. npm run build
  112. ```
  113. ## Configuration
  114. A Discord bot token is required for proper operation. The server supports two transport methods: stdio and streamable HTTP.
  115. ### Transport Methods
  116. 1. **stdio** (Default)
  117. - Traditional stdio transport for basic usage
  118. - Suitable for simple integrations
  119. 2. **streamable HTTP**
  120. - HTTP-based transport for more advanced scenarios
  121. - Supports stateless operation
  122. - Configurable port number
  123. ### Configuration Options
  124. You can provide configuration in two ways:
  125. 1. Environment variables (preferred). The token stays out of the process argument list:
  126. ```bash
  127. export DISCORD_TOKEN=your_discord_bot_token
  128. node build/index.js
  129. ```
  130. 2. Command line arguments. The value after `--config` is visible to process listings and monitoring tools that can read arguments:
  131. ```bash
  132. # For stdio transport (default)
  133. node build/index.js --config "your_discord_bot_token"
  134. # For streamable HTTP transport
  135. node build/app.js --transport http --port 3000 --config "your_discord_bot_token"
  136. ```
  137. ## Usage with Claude/Cursor
  138. ### 1. Use Stdio Transport with Claude/Cursor
  139. Use `build/index.js` when your MCP client expects a command-based stdio server.
  140. #### Claude Desktop / Claude Code
  141. ```json
  142. {
  143. "mcpServers": {
  144. "discord": {
  145. "command": "node",
  146. "args": [
  147. "path/to/mcp-discord/build/index.js"
  148. ],
  149. "env": {
  150. "DISCORD_TOKEN": "your_discord_bot_token"
  151. }
  152. }
  153. }
  154. }
  155. ```
  156. #### Cursor
  157. ```json
  158. {
  159. "mcpServers": {
  160. "discord": {
  161. "command": "node",
  162. "args": [
  163. "path/to/mcp-discord/build/index.js"
  164. ],
  165. "env": {
  166. "DISCORD_TOKEN": "your_discord_bot_token"
  167. }
  168. }
  169. }
  170. }
  171. ```
  172. This is the recommended setup for local command-based MCP clients.
  173. ### 2. Self-Host the Streamable HTTP Server
  174. Use `build/app.js` when you want to run mcp-discord as an HTTP MCP server.
  175. #### Run with Node.js
  176. ```bash
  177. DISCORD_TOKEN=your_discord_bot_token node build/app.js --transport http --port 3000
  178. ```
  179. On Windows PowerShell:
  180. ```powershell
  181. $env:DISCORD_TOKEN="your_discord_bot_token"
  182. node build/app.js --transport http --port 3000
  183. ```
  184. #### Run with Docker
  185. ```bash
  186. docker run -e DISCORD_TOKEN=your_discord_bot_token -p 3000:3000 barryy625/mcp-discord:latest --transport http --port 3000
  187. ```
  188. Once started, the MCP HTTP endpoint is:
  189. ```text
  190. http://localhost:3000/mcp
  191. ```
  192. ### 3. Connect to a Hosted HTTP MCP Server
  193. If you already host mcp-discord elsewhere, point your MCP client at the server's `/mcp` endpoint instead of launching `build/app.js` as a command.
  194. Example endpoint:
  195. ```text
  196. https://your-server.example.com/mcp
  197. ```
  198. Important notes:
  199. - `build/app.js` starts an HTTP server. It does not speak stdio.
  200. - `build/index.js` is the correct entrypoint for command-based stdio MCP clients.
  201. - For hosted HTTP usage, configure your MCP client to connect to the HTTP endpoint URL provided by your deployment.
  202. - The exact HTTP-client configuration format depends on the MCP client you use.
  203. ## Tools Documentation
  204. ### Basic Functions
  205. - `discord_login`: Login to Discord using the configured token
  206. - `discord_list_servers`: List all Discord servers the bot is a member of
  207. - `discord_send`: Send a message to a specified channel
  208. - `discord_get_server_info`: Get Discord server information
  209. ### Channel Management
  210. - `discord_create_text_channel`: Create a text channel
  211. - `discord_create_forum_channel`: Create a forum channel
  212. - `discord_create_voice_channel`: Create a voice channel
  213. - `discord_edit_channel`: Edit a channel name, topic, parent category, or position
  214. - `discord_delete_channel`: Delete a channel
  215. - `discord_create_category`: Create a channel category
  216. - `discord_edit_category`: Edit a channel category
  217. - `discord_delete_category`: Delete a channel category
  218. - `discord_set_channel_permissions`: Set permission overrides for a role or user on a channel/category
  219. - `discord_remove_channel_permissions`: Remove permission overrides from a channel/category
  220. ### Forum Functions
  221. - `discord_get_forum_channels`: Get a list of forum channels
  222. - `discord_create_forum_post`: Create a forum post (optionally pinned to the top of the channel)
  223. - `discord_get_forum_post`: Get a forum post
  224. - `discord_list_forum_threads`: List active and archived threads in a forum channel
  225. - `discord_reply_to_forum`: Reply to a forum post
  226. - `discord_get_forum_tags`: Get all available tags for a forum channel
  227. - `discord_set_forum_tags`: Replace the available tags for a forum channel
  228. - `discord_update_forum_post`: Update a forum post's title, tags, archived state, locked state, or pinned state
  229. - `discord_delete_forum_post`: Delete a forum post
  230. ### Messages and Reactions
  231. - `discord_search_messages`: Search messages in a server
  232. - `discord_read_messages`: Read channel messages (supports `before`, `after`, `around` params — accepts snowflake IDs or ISO 8601 dates like `"2025-03-01T00:00:00Z"`)
  233. - `discord_edit_message`: Edit a bot-authored message
  234. - `discord_add_reaction`: Add a reaction to a message
  235. - `discord_add_multiple_reactions`: Add multiple reactions to a message
  236. - `discord_remove_reaction`: Remove a reaction from a message
  237. - `discord_delete_message`: Delete a specific message from a channel
  238. - `discord_pin_message`: Pin a message to its channel (max 50 pins per channel)
  239. - `discord_unpin_message`: Remove a message from its channel's pinned messages
  240. - `discord_list_pinned_messages`: List a channel's pinned messages, newest pin first
  241. ### Webhook Management
  242. - `discord_create_webhook`: Creates a new webhook for a Discord channel
  243. - `discord_send_webhook_message`: Sends a message to a Discord channel using a webhook
  244. - `discord_edit_webhook`: Edits an existing webhook for a Discord channel
  245. - `discord_delete_webhook`: Deletes an existing webhook for a Discord channel
  246. ### Role Management
  247. - `discord_list_roles`: List all roles in a server
  248. - `discord_create_role`: Create a role with color, hoist, mentionable, and permission options
  249. - `discord_edit_role`: Edit an existing role
  250. - `discord_delete_role`: Delete a role
  251. - `discord_assign_role`: Assign a role to a member
  252. - `discord_remove_role`: Remove a role from a member
  253. ### Member Management
  254. - `discord_list_members`: List members in a server with roles
  255. - `discord_get_member`: Get detailed information about a specific member
  256. ## Development
  257. ```bash
  258. # Development mode
  259. npm run dev
  260. ```
  261. ## License
  262. [MIT License](https://github.com/barryyip0625/mcp-discord?tab=MIT-1-ov-file)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.