@uniquedivine/mcp-discord 0.0.0-stage → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/IMPORT.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "sourceRepository": "https://github.com/barryyip0625/mcp-discord",
3
+ "originalUpstream": "https://github.com/barryyip0625/mcp-discord",
4
+ "sourceCommit": "5c67e9d714971490aaedf8fab21753d7704bd4fa",
5
+ "sourceTag": "v1.4.0",
6
+ "importedAt": "2026-11-14",
7
+ "historyImported": false,
8
+ "excludedSourceFiles": [
9
+ ".github/FUNDING.yml",
10
+ ".github/workflows/docker-publish.yml",
11
+ "Dockerfile",
12
+ "Makefile",
13
+ "coverage/coverage-summary.json",
14
+ "package-lock.json",
15
+ "smithery.yaml"
16
+ ],
17
+ "license": "MIT",
18
+ "localModifications": "Jiyuu documentation and source metadata; published to npm from Jiyuu CI as @uniquedivine/mcp-discord. Bun runs the TypeScript entrypoints directly (bun shebang, executable src/index.ts, no tsc build); bun.lock migrated from the excluded package-lock.json with the same resolved versions. Tool type re-export in src/tools/tools.ts made type-only so Bun can load it. Jest suite ported to bun:test with explicit module mocks and per-file isolation; jest.config.js and __mocks__/errorHandler.js removed. Logger and client-state interval tests updated to the behavior of upstream 34882e8. HTTP transports bind to 127.0.0.1 by default, with --host or HTTP_HOST as an explicit override that logs a warning when not loopback; both HTTP entrypoints validate Host and Origin headers against the bound host and port (HTTP_ALLOWED_HOSTS adds names) and answer 403 otherwise; the HTTP entrypoint no longer logs request bodies. Stdio behavior and tool surface unchanged."
19
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BarryY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,16 @@
1
+ Discord MCP
2
+ Original project: https://github.com/barryyip0625/mcp-discord
3
+ Original author: Barry Yip, as named in package.json and LICENSE.
4
+
5
+ Imported into Unique-Divine/jiyuu from commit
6
+ 5c67e9d714971490aaedf8fab21753d7704bd4fa (tag v1.4.0) without Git history.
7
+ The upstream package.json at that commit still reports version 1.3.8.
8
+ Modified by Unique Divine in 2026. Changes include running on Bun from
9
+ TypeScript source, a type-only export fix, loopback-only HTTP binding by
10
+ default, Host and Origin validation on HTTP, no request-body logging, the bun:test port of the test suite,
11
+ installation metadata and documentation.
12
+
13
+ The original MIT License, with its copyright notice, is reproduced in LICENSE.
14
+ See IMPORT.json for snapshot provenance, exclusions and local modifications.
15
+ The Jiyuu root MIT license does not replace this component's license. This
16
+ import does not imply upstream endorsement.
package/README.md CHANGED
@@ -1,3 +1,252 @@
1
- # Temporary Holding Version
1
+ # Discord MCP
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Read and manage Discord servers through a bot account over MCP. The server
4
+ covers messages, channels, forums, reactions, webhooks, roles and members, with
5
+ stdio and streamable HTTP transports. It is maintained as part of Jiyuu.
6
+
7
+ Imported from [barryyip0625/mcp-discord](https://github.com/barryyip0625/mcp-discord)
8
+ at v1.4.0 and run from TypeScript source with Bun. Original source and license:
9
+ [IMPORT.json](IMPORT.json), [NOTICE](NOTICE) and [LICENSE](LICENSE).
10
+
11
+ ## Install
12
+
13
+ Requirements: [Bun](https://bun.sh) 1.4.3 or newer and a Discord bot token.
14
+ [Discord Bot Setup](#discord-bot-setup) explains how to get the token. Run the
15
+ published package with an exact version pin:
16
+
17
+ ```sh
18
+ DISCORD_TOKEN=your_discord_bot_token bunx @uniquedivine/mcp-discord@1.3.9
19
+ ```
20
+
21
+ CI in [Unique-Divine/jiyuu](https://github.com/Unique-Divine/jiyuu) builds and
22
+ publishes `@uniquedivine/mcp-discord` to npm from this directory when its
23
+ version changes on `main`. The version pin selects the exact reviewed release that runs.
24
+
25
+ ### Claude Code
26
+
27
+ ```sh
28
+ claude mcp add discord --env DISCORD_TOKEN=your_discord_bot_token \
29
+ -- bunx @uniquedivine/mcp-discord@1.3.9
30
+ ```
31
+
32
+ ### Codex
33
+
34
+ Add this entry to file `~/.codex/config.toml`:
35
+
36
+ ```toml
37
+ [mcp_servers.discord]
38
+ command = "bunx"
39
+ args = ["@uniquedivine/mcp-discord@1.3.9"]
40
+ env = { DISCORD_TOKEN = "your_discord_bot_token" }
41
+ ```
42
+
43
+ ### Cursor
44
+
45
+ Add this entry to file `~/.cursor/mcp.json`, or to file `.cursor/mcp.json` in
46
+ a project:
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "discord": {
52
+ "command": "bunx",
53
+ "args": ["@uniquedivine/mcp-discord@1.3.9"],
54
+ "env": { "DISCORD_TOKEN": "your_discord_bot_token" }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ### Update
61
+
62
+ 1. Find the newest version with command
63
+ `npm view @uniquedivine/mcp-discord version`.
64
+ 2. Change the `@1.3.9` pin in the client configuration to that version.
65
+ 3. Restart the MCP server in the client, or restart the client. In Claude
66
+ Code, run `/mcp` and reconnect the server. Command `bunx` downloads the new
67
+ version on the next launch.
68
+
69
+ ## Install From Source
70
+
71
+ Requirements: Git and Bun 1.4.3 or newer. No Node installation or build step
72
+ is needed; Bun runs the TypeScript entrypoints directly.
73
+
74
+ ```sh
75
+ git clone https://github.com/Unique-Divine/jiyuu.git
76
+ cd jiyuu
77
+ just --justfile mcp/discord/justfile install
78
+ ```
79
+
80
+ Without Just, run `bun install --frozen-lockfile` inside `mcp/discord`. To make
81
+ the `mcp-discord` command available, run `just link` in that directory. This
82
+ uses `bun link` and points the command at this source checkout.
83
+
84
+ ## Discord Bot Setup
85
+
86
+ - A Discord bot with appropriate permissions
87
+ - Bot token (obtainable from the [Discord Developer Portal](https://discord.com/developers/applications))
88
+ - Message Content Intent enabled
89
+ - Server Members Intent enabled
90
+ - Presence Intent enabled
91
+ - Permissions required in your Discord server:
92
+
93
+ #### Easiest Setup
94
+ - Administrator (Recommended for quick setup and full functionality)
95
+
96
+ #### Or, select only the required permissions:
97
+ - Send Messages
98
+ - Create Public Threads
99
+ - Send Messages in Threads
100
+ - Manage Messages
101
+ - Manage Threads
102
+ - Manage Channels
103
+ - Manage Webhooks
104
+ - Manage Roles
105
+ - Add Reactions
106
+ - View Channel
107
+
108
+ - Add your Discord bot to your server
109
+ - 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):
110
+ - **Administrator (full access):**
111
+ https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8
112
+ - **Custom permissions (minimum required):**
113
+ https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=52076489808
114
+
115
+ > **Note:**
116
+ > According to Discord's security model, a bot can only access information from servers it has been explicitly added to.
117
+ > If you want to use this MCP server to access a specific Discord server, you must add the bot to that server first.
118
+ > Use the invite link below to add the bot to your target server.
119
+
120
+ ## Configure
121
+
122
+ The server reads the bot token from `DISCORD_TOKEN`, from a `.env` file in the
123
+ working directory, or from `--config <token>`. Prefer the environment: command
124
+ line arguments are visible to other local processes. Do not commit tokens or
125
+ `.env` files. Without a token the server starts, reports that it skipped
126
+ auto-login, and `discord_login` can supply one later.
127
+
128
+ ### Stdio Transport
129
+
130
+ `src/index.ts` is the stdio entrypoint for command-based MCP clients. From a
131
+ source checkout:
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "discord": {
137
+ "command": "bun",
138
+ "args": ["/path/to/jiyuu/mcp/discord/src/index.ts"],
139
+ "env": { "DISCORD_TOKEN": "your_discord_bot_token" }
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ After `just link`, `"command": "mcp-discord"` with no arguments also works.
146
+ Unique-Divine/dotfiles manages this link itself starting with
147
+ [dotfiles PR #137](https://github.com/Unique-Divine/dotfiles/pull/137): its
148
+ `just bun-sync` links `mcp-discord` to this checkout's `src/index.ts`. On a
149
+ workstation with that change, don't also run `just link`.
150
+ `just run` starts the same entrypoint from this directory.
151
+
152
+ ### Streamable HTTP Transport
153
+
154
+ `src/app.ts` serves MCP over HTTP at `/mcp`. It does not speak stdio.
155
+
156
+ ```sh
157
+ DISCORD_TOKEN=your_discord_bot_token bun src/app.ts --transport http --port 3000
158
+ ```
159
+
160
+ The endpoint is then `http://127.0.0.1:3000/mcp`. `src/index.ts --transport http`
161
+ also serves HTTP, on port 8080 unless `--port` is given.
162
+
163
+ The HTTP transports have no authentication. Anyone who can reach the port can
164
+ call every tool with the bot's permissions, including sends and deletes. Both
165
+ entrypoints bind to `127.0.0.1` by default; keep them on loopback. `--host` or
166
+ `HTTP_HOST` overrides the address, and the server logs a warning for any
167
+ non-loopback host. Upstream bound to all interfaces.
168
+
169
+ Both entrypoints also reject requests whose `Host` header is not
170
+ `127.0.0.1`, `localhost` or `[::1]` on the bound port, or the explicit
171
+ `--host`, with HTTP 403. A browser `Origin`, when sent, must match one of those
172
+ too. This blocks DNS rebinding, where a web page points its own hostname at
173
+ 127.0.0.1. Requests without `Origin`, as MCP clients send them, are allowed.
174
+ `HTTP_ALLOWED_HOSTS` (comma-separated `host[:port]`) adds names, which a
175
+ wildcard bind such as `0.0.0.0` needs for remote clients.
176
+
177
+ ## Tools Documentation
178
+
179
+ ### Basic Functions
180
+
181
+ - `discord_login`: Login to Discord using the configured token
182
+ - `discord_list_servers`: List all Discord servers the bot is a member of
183
+ - `discord_send`: Send a message to a specified channel
184
+ - `discord_get_server_info`: Get Discord server information
185
+
186
+ ### Channel Management
187
+
188
+ - `discord_create_text_channel`: Create a text channel
189
+ - `discord_create_forum_channel`: Create a forum channel
190
+ - `discord_create_voice_channel`: Create a voice channel
191
+ - `discord_edit_channel`: Edit a channel name, topic, parent category, or position
192
+ - `discord_delete_channel`: Delete a channel
193
+ - `discord_create_category`: Create a channel category
194
+ - `discord_edit_category`: Edit a channel category
195
+ - `discord_delete_category`: Delete a channel category
196
+ - `discord_set_channel_permissions`: Set permission overrides for a role or user on a channel/category
197
+ - `discord_remove_channel_permissions`: Remove permission overrides from a channel/category
198
+
199
+ ### Forum Functions
200
+
201
+ - `discord_get_forum_channels`: Get a list of forum channels
202
+ - `discord_create_forum_post`: Create a forum post
203
+ - `discord_get_forum_post`: Get a forum post
204
+ - `discord_list_forum_threads`: List active and archived threads in a forum channel
205
+ - `discord_reply_to_forum`: Reply to a forum post
206
+ - `discord_get_forum_tags`: Get all available tags for a forum channel
207
+ - `discord_set_forum_tags`: Replace the available tags for a forum channel
208
+ - `discord_update_forum_post`: Update a forum post's title, tags, archived state, or locked state
209
+ - `discord_delete_forum_post`: Delete a forum post
210
+
211
+ ### Messages and Reactions
212
+
213
+ - `discord_search_messages`: Search messages in a server
214
+ - `discord_read_messages`: Read channel messages (supports `before`, `after`, `around` params — accepts snowflake IDs or ISO 8601 dates like `"2025-03-01T00:00:00Z"`)
215
+ - `discord_edit_message`: Edit a bot-authored message
216
+ - `discord_add_reaction`: Add a reaction to a message
217
+ - `discord_add_multiple_reactions`: Add multiple reactions to a message
218
+ - `discord_remove_reaction`: Remove a reaction from a message
219
+ - `discord_delete_message`: Delete a specific message from a channel
220
+
221
+ ### Webhook Management
222
+
223
+ - `discord_create_webhook`: Creates a new webhook for a Discord channel
224
+ - `discord_send_webhook_message`: Sends a message to a Discord channel using a webhook
225
+ - `discord_edit_webhook`: Edits an existing webhook for a Discord channel
226
+ - `discord_delete_webhook`: Deletes an existing webhook for a Discord channel
227
+
228
+ ### Role Management
229
+
230
+ - `discord_list_roles`: List all roles in a server
231
+ - `discord_create_role`: Create a role with color, hoist, mentionable, and permission options
232
+ - `discord_edit_role`: Edit an existing role
233
+ - `discord_delete_role`: Delete a role
234
+ - `discord_assign_role`: Assign a role to a member
235
+ - `discord_remove_role`: Remove a role from a member
236
+
237
+ ### Member Management
238
+
239
+ - `discord_list_members`: List members in a server with roles
240
+ - `discord_get_member`: Get detailed information about a specific member
241
+
242
+ ## Development
243
+
244
+ ```sh
245
+ just test # bun:test suite, each file isolated so module mocks do not leak
246
+ just check # bun check, then a Bun build of both entrypoints
247
+ ```
248
+
249
+ ## License
250
+
251
+ MIT. See [LICENSE](LICENSE) for the original copyright notice and
252
+ [NOTICE](NOTICE) for provenance.
package/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "@uniquedivine/mcp-discord",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "mcpName": "io.github.unique-divine/mcp-discord",
4
+ "version": "1.3.9",
5
+ "description": "Discord MCP server maintained in Jiyuu. Manages channels, forums, messages, reactions, roles, and webhooks through a Discord bot.",
6
+ "main": "src/index.ts",
7
+ "bin": {
8
+ "mcp-discord": "src/index.ts"
9
+ },
10
+ "files": [
11
+ "src/",
12
+ "!src/**/*.test.ts",
13
+ "!src/test-support/",
14
+ "IMPORT.json",
15
+ "NOTICE"
16
+ ],
17
+ "type": "module",
18
+ "scripts": {
19
+ "test": "bun test --isolate ./src",
20
+ "start": "bun src/index.ts",
21
+ "start-app": "bun src/app.ts"
22
+ },
23
+ "keywords": [
24
+ "mcp",
25
+ "model-context-protocol",
26
+ "discord",
27
+ "claude",
28
+ "ai",
29
+ "chatbot",
30
+ "automation"
31
+ ],
32
+ "author": "Barry Yip <barry99625@gmail.com>",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/Unique-Divine/jiyuu.git",
37
+ "directory": "mcp/discord"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/Unique-Divine/jiyuu/issues"
41
+ },
42
+ "homepage": "https://github.com/Unique-Divine/jiyuu/tree/main/mcp/discord",
43
+ "engines": {
44
+ "bun": ">=1.4.3"
45
+ },
46
+ "devDependencies": {
47
+ "@types/bun": "1.4.3",
48
+ "@types/express": "^5.0.1",
49
+ "@types/node": "^20.17.50"
50
+ },
51
+ "dependencies": {
52
+ "@modelcontextprotocol/sdk": "^1.11.0",
53
+ "discord.js": "^14.19.3",
54
+ "dotenv": "^16.5.0",
55
+ "express": "^5.1.0",
56
+ "zod": "^3.25.13"
57
+ },
58
+ "packageManager": "bun@1.4.3",
59
+ "private": false,
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "jiyuu": {
64
+ "upstream": {
65
+ "repository": "barryyip0625/mcp-discord",
66
+ "package": "mcp-discord",
67
+ "version": "1.3.8",
68
+ "tag": "v1.4.0",
69
+ "commit": "5c67e9d714971490aaedf8fab21753d7704bd4fa"
70
+ },
71
+ "site": {
72
+ "tools": [
73
+ "src/toolList.ts#toolList",
74
+ "src/jiyuuMcpInfo.ts#MCP_INFO_TOOL"
75
+ ],
76
+ "env": [
77
+ {
78
+ "name": "DISCORD_TOKEN",
79
+ "required": false,
80
+ "secret": true
81
+ },
82
+ {
83
+ "name": "JIYUU_MCP_NO_UPDATE_CHECK",
84
+ "required": false,
85
+ "secret": false
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ }