@quadslab.io/discord-mcp 2.0.0 → 2.1.0

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.
Files changed (61) hide show
  1. package/.claude/.quadcode-version +1 -0
  2. package/.claude/settings.local.json +154 -0
  3. package/.claude/skills/architect/SKILL.md +111 -0
  4. package/.claude/skills/assign-environment/SKILL.md +71 -0
  5. package/.claude/skills/brainstorm/SKILL.md +114 -0
  6. package/.claude/skills/brainstorm-spec/SKILL.md +72 -0
  7. package/.claude/skills/check-implemented/SKILL.md +59 -0
  8. package/.claude/skills/check-issue-progress/SKILL.md +66 -0
  9. package/.claude/skills/create-rich-plan/SKILL.md +90 -0
  10. package/.claude/skills/decompose-spec/SKILL.md +32 -0
  11. package/.claude/skills/detect-environments/SKILL.md +61 -0
  12. package/.claude/skills/dispatch/SKILL.md +90 -0
  13. package/.claude/skills/estimate-complexity/SKILL.md +118 -0
  14. package/.claude/skills/expand-epic/SKILL.md +38 -0
  15. package/.claude/skills/find-duplicate-issues/SKILL.md +91 -0
  16. package/.claude/skills/find-duplicates/SKILL.md +77 -0
  17. package/.claude/skills/find-related-code/SKILL.md +145 -0
  18. package/.claude/skills/idea-summary/SKILL.md +57 -0
  19. package/.claude/skills/idea-to-prompt/SKILL.md +98 -0
  20. package/.claude/skills/ideas-maintenance/SKILL.md +98 -0
  21. package/.claude/skills/ideas-to-issues/SKILL.md +108 -0
  22. package/.claude/skills/issue-summary/SKILL.md +64 -0
  23. package/.claude/skills/issue-to-prompt/SKILL.md +98 -0
  24. package/.claude/skills/launch-team/SKILL.md +69 -0
  25. package/.claude/skills/list-environments/SKILL.md +60 -0
  26. package/.claude/skills/new-spec/SKILL.md +37 -0
  27. package/.claude/skills/organize-ideas/SKILL.md +47 -0
  28. package/.claude/skills/organize-issues/SKILL.md +56 -0
  29. package/.claude/skills/organize-plans/SKILL.md +47 -0
  30. package/.claude/skills/plan-from-idea/SKILL.md +102 -0
  31. package/.claude/skills/plan-summary/SKILL.md +53 -0
  32. package/.claude/skills/plan-to-issues/SKILL.md +63 -0
  33. package/.claude/skills/preview-promotion/SKILL.md +47 -0
  34. package/.claude/skills/review-spec/SKILL.md +53 -0
  35. package/.claude/skills/run-script/SKILL.md +43 -0
  36. package/.claude/skills/script-summary/SKILL.md +67 -0
  37. package/.claude/skills/setup-environment/SKILL.md +78 -0
  38. package/.claude/skills/setup-python/SKILL.md +123 -0
  39. package/.claude/skills/setup-scripts/SKILL.md +82 -0
  40. package/.claude/skills/suggest-improvements/SKILL.md +66 -0
  41. package/.claude/skills/team-status/SKILL.md +68 -0
  42. package/.claude/skills/triage-issues/SKILL.md +51 -0
  43. package/.claude/skills/update-plan-progress/SKILL.md +102 -0
  44. package/.claude/skills/verify-plan/SKILL.md +54 -0
  45. package/.claude/skills/weekly-digest/SKILL.md +149 -0
  46. package/.mcp.json +7 -0
  47. package/.quadcode/config.json +6 -0
  48. package/CHANGELOG.md +174 -174
  49. package/CLAUDE.md +40 -0
  50. package/LICENSE +21 -21
  51. package/README.md +678 -668
  52. package/assets/demo.svg +470 -0
  53. package/assets/social-preview.html +14 -0
  54. package/assets/social-preview.svg +98 -0
  55. package/dist/cli.js +16 -12
  56. package/dist/cli.js.map +1 -1
  57. package/dist/tools/threads.js +299 -0
  58. package/dist/tools/threads.js.map +1 -1
  59. package/dist/tools/utils.js +48 -3
  60. package/dist/tools/utils.js.map +1 -1
  61. package/package.json +58 -58
package/README.md CHANGED
@@ -1,668 +1,678 @@
1
- # @quadslab.io/discord-mcp
2
-
3
- [![npm version](https://img.shields.io/npm/v/@quadslab.io/discord-mcp)](https://www.npmjs.com/package/@quadslab.io/discord-mcp)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
6
-
7
- **Manage your entire Discord server from Claude Code.** 134 admin tools across 20 categories — roles, channels, members, messages, moderation, forums, stages, webhooks, events, polls, DMs, and more. Just talk to Claude in plain English.
8
-
9
- Built by [QuadsLab.io](https://quadslab.io) with [Discord.js v14](https://discord.js.org/) and the [MCP SDK](https://github.com/modelcontextprotocol/sdk).
10
-
11
- ---
12
-
13
- ## Setup in 60 Seconds
14
-
15
- One command. No manual config files. No copying IDs.
16
-
17
- ```bash
18
- npx @quadslab.io/discord-mcp init
19
- ```
20
-
21
- The interactive wizard walks you through everything:
22
-
23
- ```
24
- ____ __ __ __
25
- / __ \__ ______ _____/ /____/ / ____ _/ /_
26
- / / / / / / / __ `/ __ / ___/ / / __ `/ __ \
27
- / /_/ / /_/ / /_/ / /_/ (__ ) /___/ /_/ / /_/ /
28
- \___\_\__,_/\__,_/\__,_/____/_____/\__,_/_.___/
29
- .io
30
-
31
- ┌────────────────────────────────────────────────────────┐
32
- Discord MCP Server — Interactive Setup │
33
- 134 admin tools for managing Discord from Claude Code │
34
- └────────────────────────────────────────────────────────┘
35
-
36
- ○ (3/6)
37
- Connecting to Discord
38
-
39
- Authenticated as MyBot#1234
40
- Application ID: 123456789
41
- Servers: 2 found
42
- ```
43
-
44
- It will:
45
- 1. Guide you through creating a Discord bot (or use an existing one)
46
- 2. Validate your bot token live
47
- 3. Auto-generate the invite URL with all required permissions
48
- 4. Let you pick which server to manage
49
- 5. Auto-detect your installed MCP clients and write the config for you
50
-
51
- ### Works With Every MCP Client
52
-
53
- The wizard auto-detects which clients you have installed:
54
-
55
- ```
56
- Detected MCP clients:
57
-
58
- ● Claude Code .mcp.json
59
- ● Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json
60
- Cursor ~/.cursor/mcp.json
61
- ○ Windsurf (not detected)
62
-
63
- ? Which client(s) to configure?
64
- 1. Claude Code (detected)
65
- 2. Claude Desktop (detected)
66
- 3. Cursor (detected)
67
- 4. Windsurf (not found)
68
- 5. All detected (3 clients)
69
- 6. Skip (show config to copy manually)
70
- ```
71
-
72
- Select one, multiple, or "All detected" to configure everything at once.
73
-
74
- ### Verify Your Setup
75
-
76
- ```bash
77
- npx @quadslab.io/discord-mcp check
78
- ```
79
-
80
- ```
81
- QuadsLab.io [discord-mcp] Health Check
82
- ────────────────────────────────────────────────────
83
-
84
- Token ............ present
85
- Bot .............. MyBot#1234
86
- Server ........... My Gaming Server (1,024 members)
87
-
88
- Permissions
89
- ────────────────────────────────────────────────────
90
-
91
- Manage Roles .............. yes
92
- ✔ Manage Channels ........... yes
93
- ✔ Kick Members .............. yes
94
- ✔ Ban Members ............... yes
95
- ...
96
-
97
- ██████████████████████████████ 100% (24/24)
98
-
99
- All 24 permissions granted
100
-
101
- ┌──────────────────────────────────────────────────┐
102
- MCP server is ready! │
103
- Run discord-mcp or use via .mcp.json in Claude │
104
- └──────────────────────────────────────────────────┘
105
- ```
106
-
107
- ---
108
-
109
- ## What Can You Do With It?
110
-
111
- Once connected to Claude Code, just ask in natural language:
112
-
113
- - *"Send a welcome message in #general"*
114
- - *"Lock down the #announcements channel"*
115
- - *"Who reacted to the last message in #server-guide?"*
116
- - *"Create a role called VIP with a gold color and assign it to @john"*
117
- - *"Show me the audit log for the last 24 hours"*
118
- - *"Set up an automod rule to block links in #general"*
119
- - *"Create a forum post in #feedback titled Bug Reports"*
120
- - *"Timeout @spammer for 1 hour for spamming"*
121
- - *"List all webhooks and delete the unused ones"*
122
- - *"Schedule a community event for Friday at 8pm in the Stage channel"*
123
- - *"Bulk delete the last 50 messages in #bot-testing"*
124
- - *"Give everyone with the Member role access to #private-channel"*
125
- - *"Create a poll in #general asking which game to play Friday"*
126
- - *"DM all moderators about the upcoming server event"*
127
- - *"Set the bot's status to 'Watching over 500 members'"*
128
- - *"Show me who's in the Gaming voice channel right now"*
129
-
130
- Claude automatically resolves channel, role, and member names using fuzzy matching no need to look up IDs.
131
-
132
- ---
133
-
134
- ## Features
135
-
136
- - **134 tools across 20 categories** — comprehensive Discord server administration without leaving the terminal
137
- - **Interactive setup wizard** — `npx init` walks you through bot creation, token validation, and config in under a minute
138
- - **Health check & permission audit** — `npx check` verifies your token, server access, and all 24 required permissions with a visual progress bar
139
- - **Fuzzy name resolution** — type `"bot testing"`, `"bot-testing"`, or `"bottesting"` and it resolves correctly; no need to look up IDs
140
- - **Zero-config name matching** — channels, roles, and members are all resolved by name, ID, or mention format automatically
141
- - **Pre-cached server data** — all channels, roles, and members are cached on startup for instant lookups without extra API calls
142
- - **Structured JSON responses** — every tool returns consistent, pretty-printed JSON
143
- - **Audit log integration** all modifying operations accept a `reason` parameter that appears in the Discord audit log
144
- - **Helpful error recovery** — failed lookups return suggestions (e.g., "Did you mean: #general, #bot-testing?")
145
- - **MCP resources** — three read-only resources for server overview data
146
-
147
- ---
148
-
149
- ## Alternative Setup (Manual)
150
-
151
- If you prefer to configure things manually instead of using the wizard:
152
-
153
- <details>
154
- <summary><strong>Manual setup steps</strong></summary>
155
-
156
- ### 1. Create a Discord bot
157
-
158
- Follow the [Bot Setup Guide](docs/bot-setup-guide.md) to create a bot in the Discord Developer Portal and get your token.
159
-
160
- ### 2. Add to your MCP config
161
-
162
- Add the following `discord` entry to your client's config file:
163
-
164
- ```json
165
- {
166
- "mcpServers": {
167
- "discord": {
168
- "command": "npx",
169
- "args": ["-y", "@quadslab.io/discord-mcp"],
170
- "env": {
171
- "DISCORD_TOKEN": "your-bot-token",
172
- "DISCORD_GUILD_ID": "your-server-id"
173
- }
174
- }
175
- }
176
- }
177
- ```
178
-
179
- | Client | Config file location |
180
- |--------|---------------------|
181
- | **Claude Code** | `.mcp.json` in your project root |
182
- | **Claude Desktop** | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows) |
183
- | **Cursor** | `~/.cursor/mcp.json` |
184
- | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |
185
-
186
- ### 3. Connect
187
-
188
- - **Claude Code:** Type `/mcp` to connect
189
- - **Claude Desktop:** Restart the app
190
- - **Cursor / Windsurf:** Reload the window
191
-
192
- </details>
193
-
194
- <details>
195
- <summary><strong>Run from source</strong></summary>
196
-
197
- ```bash
198
- git clone https://github.com/HardHeadHackerHead/discord-mcp.git
199
- cd discord-mcp
200
- npm install
201
- cp .env.example .env
202
- # Edit .env with your DISCORD_TOKEN and DISCORD_GUILD_ID
203
- npm run build
204
- npm start
205
- ```
206
-
207
- </details>
208
-
209
- ---
210
-
211
- ## CLI Reference
212
-
213
- ```
214
- $ npx @quadslab.io/discord-mcp [command]
215
- ```
216
-
217
- | Command | Description |
218
- |---------|-------------|
219
- | `init` | Interactive setup wizard — creates bot, validates token, auto-configures Claude Code / Desktop / Cursor / Windsurf |
220
- | `check` | Health check — verifies token, server access, and permission audit |
221
- | `start` | Start the MCP server (default when no command given) |
222
- | `help` | Show help message |
223
- | `version` | Show version |
224
-
225
- When launched via `.mcp.json` (stdin is not a TTY), the server starts automatically — no subcommand needed.
226
-
227
- ---
228
-
229
- ## Tools Overview
230
-
231
- ### Summary
232
-
233
- | Category | Tools | Description |
234
- |----------|------:|-------------|
235
- | Guild | 2 | Server information and metadata |
236
- | Roles | 11 | Role creation, editing, permissions, and assignment |
237
- | Channels | 20 | Channel creation, editing, permissions, and organization |
238
- | Members | 15 | Member management, moderation, and bulk operations |
239
- | Messages | 14 | Send, edit, delete, pin, and react to messages |
240
- | Reactions | 1 | Detailed reaction data with reactor info |
241
- | Server Admin | 16 | Server settings, invites, bans, audit log, and integrations |
242
- | Threads | 10 | Thread creation, archiving, locking, and deletion |
243
- | Forums | 5 | Forum posts and tag management |
244
- | Emojis & Stickers | 7 | Custom emoji and sticker management |
245
- | Webhooks | 4 | Webhook creation, deletion, and messaging |
246
- | Scheduled Events | 5 | Event creation, editing, and deletion |
247
- | Stage Instances | 3 | Stage channel management |
248
- | Auto-Moderation | 4 | Automod rule creation, editing, and deletion |
249
- | Polls | 3 | Create polls, get results, end polls early |
250
- | Direct Messages | 2 | Send DMs and embed DMs to server members |
251
- | Bot Presence | 2 | Set bot status/activity, get bot info |
252
- | Server Templates | 4 | List, create, delete, sync server templates |
253
- | Application Commands | 4 | Manage slash commands (CRUD) |
254
- | Onboarding | 2 | Get and edit server onboarding configuration |
255
- | **Total** | **134** | |
256
-
257
- ---
258
-
259
- <details>
260
- <summary><strong>Full tool reference (click to expand)</strong></summary>
261
-
262
- ### Guild (2 tools)
263
-
264
- | Tool | Description |
265
- |------|-------------|
266
- | `list_guilds` | List all servers the bot is a member of |
267
- | `get_guild_info` | Detailed server info member count, channels, roles, features, boost tier |
268
-
269
- ### Roles (11 tools)
270
-
271
- | Tool | Description |
272
- |------|-------------|
273
- | `list_roles` | List all roles sorted by position with colors and member counts |
274
- | `create_role` | Create a new role with name, color, hoist, and mentionable options |
275
- | `delete_role` | Delete a role (with managed role protection) |
276
- | `modify_role` | Change a role's name, color, hoist, mentionable, or position |
277
- | `get_role_permissions` | View all permissions granted to a role |
278
- | `modify_role_permissions` | Grant or revoke specific permissions on a role |
279
- | `set_role_icon` | Set a Unicode emoji or image as the role icon (requires boost level 2+) |
280
- | `assign_role` | Add a role to a member |
281
- | `remove_role` | Remove a role from a member |
282
- | `get_role_members` | List all members who have a specific role |
283
- | `clone_role` | Duplicate a role with all its permissions and settings |
284
-
285
- ### Channels (20 tools)
286
-
287
- | Tool | Description |
288
- |------|-------------|
289
- | `list_channels` | List all channels organized by category |
290
- | `create_text_channel` | Create a new text channel, optionally in a category |
291
- | `create_voice_channel` | Create a new voice channel with bitrate and user limit |
292
- | `create_category` | Create a new channel category |
293
- | `create_forum_channel` | Create a new forum channel with optional tags and default settings |
294
- | `delete_channel` | Delete any channel type |
295
- | `modify_channel` | Change name, topic, category, NSFW, position, user limit |
296
- | `set_channel_permissions` | Set permission overwrites for a role or user on a channel |
297
- | `view_channel_permissions` | View all permission overwrites on a channel |
298
- | `lock_channel` | Deny SendMessages for @everyone (quick lock) |
299
- | `unlock_channel` | Remove SendMessages deny for @everyone |
300
- | `set_slowmode` | Set rate limit (0–21600 seconds) on a text channel |
301
- | `clone_channel` | Duplicate a channel with all permissions and settings |
302
- | `reorder_channels` | Reorder channels by specifying new positions |
303
- | `set_voice_region` | Set the RTC region for a voice channel |
304
- | `follow_announcement_channel` | Follow an announcement channel to cross-post into another channel |
305
- | `create_stage_channel` | Create a new stage channel |
306
- | `get_channel_invites` | List all invites for a specific channel |
307
- | `set_channel_topic` | Set or clear a channel's topic/description |
308
- | `get_voice_members` | List all members currently in a voice or stage channel |
309
-
310
- ### Members (15 tools)
311
-
312
- | Tool | Description |
313
- |------|-------------|
314
- | `list_members` | List members with optional role and search filters |
315
- | `get_member` | Detailed member info roles, join date, account age, permissions |
316
- | `kick_member` | Kick a member from the server |
317
- | `ban_member` | Ban a member with optional message deletion (0–7 days) |
318
- | `unban_member` | Remove a ban by username or user ID |
319
- | `timeout_member` | Apply a timeout (10m, 1h, 1d, 1w) or remove one |
320
- | `prune_members` | Remove inactive members (supports dry run and role filtering) |
321
- | `bulk_assign_role` | Assign a role to multiple members at once |
322
- | `bulk_remove_role` | Remove a role from multiple members at once |
323
- | `set_nickname` | Change a member's nickname or reset it |
324
- | `move_to_voice` | Move a member to a different voice channel |
325
- | `disconnect_from_voice` | Disconnect a member from their voice channel |
326
- | `get_member_permissions` | Get a member's effective permissions in a specific channel |
327
- | `search_members` | Search members by username, nickname, or role with advanced filters |
328
- | `bulk_timeout_members` | Apply a timeout to multiple members at once |
329
-
330
- ### Messages (14 tools)
331
-
332
- | Tool | Description |
333
- |------|-------------|
334
- | `get_messages` | Fetch recent messages from a text or voice channel |
335
- | `get_message` | Fetch a single message by ID with full details |
336
- | `send_message` | Send a text message, optionally as a reply |
337
- | `send_embed` | Send a rich embed with title, fields, images, and footer |
338
- | `edit_message` | Edit a message previously sent by the bot |
339
- | `delete_message` | Delete a single message by ID |
340
- | `bulk_delete_messages` | Delete 2–100 messages at once (< 14 days old), optionally filtered by user |
341
- | `crosspost_message` | Publish a message in an announcement channel to all following channels |
342
- | `pin_message` | Pin a message |
343
- | `unpin_message` | Unpin a message |
344
- | `list_pinned_messages` | Get all pinned messages in a channel |
345
- | `add_reaction` | Add a reaction from the bot to a message |
346
- | `remove_reaction` | Remove the bot's reaction from a message |
347
- | `search_messages` | Search messages in a channel by content, author, or date range |
348
-
349
- ### Reactions (1 tool)
350
-
351
- | Tool | Description |
352
- |------|-------------|
353
- | `get_reactions` | Get all reactions on a message with full reactor details — account creation date, server join date, roles, avatar, boost status. Optionally filter by emoji. |
354
-
355
- ### Server Admin (16 tools)
356
-
357
- | Tool | Description |
358
- |------|-------------|
359
- | `edit_server` | Modify server name, description, verification level, notification defaults |
360
- | `list_invites` | List all active invite links with usage stats and expiration |
361
- | `create_invite` | Generate a new invite with configurable max age, uses, and temporary flag |
362
- | `delete_invite` | Revoke an invite by code |
363
- | `get_audit_log` | Fetch audit log entries, optionally filtered by action type or user |
364
- | `list_bans` | View all banned users with reasons |
365
- | `get_welcome_screen` | Get the server welcome screen configuration |
366
- | `set_welcome_screen` | Configure the welcome screen with description and featured channels |
367
- | `get_widget` | Get the server widget settings |
368
- | `set_widget` | Configure the server widget (enable/disable, set channel) |
369
- | `get_vanity_url` | Get the server vanity URL (requires VANITY_URL feature) |
370
- | `list_integrations` | List all integrations (bots, apps) connected to the server |
371
- | `delete_integration` | Remove an integration from the server |
372
- | `get_server_preview` | Get the server's public preview information |
373
- | `set_server_icon` | Set or remove the server icon from a URL |
374
- | `set_server_banner` | Set or remove the server banner image (requires boost level 2+) |
375
-
376
- ### Threads (10 tools)
377
-
378
- | Tool | Description |
379
- |------|-------------|
380
- | `list_threads` | List active threads, optionally filtered to a channel |
381
- | `create_thread` | Start a thread from a message or as a standalone public thread |
382
- | `archive_thread` | Archive a thread |
383
- | `unarchive_thread` | Unarchive a thread |
384
- | `delete_thread` | Delete a thread |
385
- | `lock_thread` | Lock a thread (prevent new messages without archiving) |
386
- | `unlock_thread` | Unlock a thread |
387
- | `get_thread_members` | List all members of a thread |
388
- | `add_thread_member` | Add a member to a thread |
389
- | `remove_thread_member` | Remove a member from a thread |
390
-
391
- ### Forums (5 tools)
392
-
393
- | Tool | Description |
394
- |------|-------------|
395
- | `create_forum_post` | Create a new post (thread) in a forum channel with optional tags |
396
- | `list_forum_tags` | List all available tags on a forum channel |
397
- | `create_forum_tag` | Add a new tag to a forum channel (max 20 per channel) |
398
- | `edit_forum_tag` | Edit an existing forum tag's name, emoji, or moderated status |
399
- | `delete_forum_tag` | Remove a tag from a forum channel |
400
-
401
- ### Emojis & Stickers (7 tools)
402
-
403
- | Tool | Description |
404
- |------|-------------|
405
- | `list_emojis` | List all custom emojis with names, IDs, animated status, and URLs |
406
- | `create_emoji` | Upload a new custom emoji from a URL |
407
- | `delete_emoji` | Remove a custom emoji by name or ID |
408
- | `rename_emoji` | Rename a custom emoji |
409
- | `list_stickers` | List all custom stickers with descriptions and format info |
410
- | `create_sticker` | Upload a new custom sticker from a URL |
411
- | `delete_sticker` | Remove a custom sticker by name or ID |
412
-
413
- ### Webhooks (4 tools)
414
-
415
- | Tool | Description |
416
- |------|-------------|
417
- | `list_webhooks` | List all webhooks, optionally filtered to a channel |
418
- | `create_webhook` | Create a webhook on a channel with name and optional avatar |
419
- | `delete_webhook` | Delete a webhook by ID |
420
- | `send_webhook_message` | Send a message via webhook with optional name/avatar override |
421
-
422
- ### Scheduled Events (5 tools)
423
-
424
- | Tool | Description |
425
- |------|-------------|
426
- | `list_events` | List all scheduled events with times, status, type, and attendee count |
427
- | `create_event` | Create a voice, stage, or external event with start/end times |
428
- | `edit_event` | Modify an event's name, description, times, or status |
429
- | `delete_event` | Delete a scheduled event |
430
- | `get_event_users` | List users who have expressed interest in an event |
431
-
432
- ### Stage Instances (3 tools)
433
-
434
- | Tool | Description |
435
- |------|-------------|
436
- | `list_stage_instances` | List all active stage instances with topic and channel info |
437
- | `start_stage` | Start a new stage instance on a stage channel with a topic |
438
- | `end_stage` | End an active stage instance |
439
-
440
- ### Auto-Moderation (4 tools)
441
-
442
- | Tool | Description |
443
- |------|-------------|
444
- | `list_automod_rules` | List all automod rules with triggers, actions, and exemptions |
445
- | `create_automod_rule` | Create a rule — keyword filter, spam detection, keyword presets, or mention spam |
446
- | `edit_automod_rule` | Modify a rule's keywords, actions, exemptions, or enabled state |
447
- | `delete_automod_rule` | Delete an automod rule |
448
-
449
- ### Polls (3 tools)
450
-
451
- | Tool | Description |
452
- |------|-------------|
453
- | `create_poll` | Create a poll in a channel with multiple choice options and duration |
454
- | `get_poll_results` | Get the current results and vote counts for a poll |
455
- | `end_poll` | End a poll early and finalize the results |
456
-
457
- ### Direct Messages (2 tools)
458
-
459
- | Tool | Description |
460
- |------|-------------|
461
- | `send_dm` | Send a direct message to a server member |
462
- | `send_dm_embed` | Send a rich embed as a direct message to a server member |
463
-
464
- ### Bot Presence (2 tools)
465
-
466
- | Tool | Description |
467
- |------|-------------|
468
- | `set_bot_presence` | Set the bot's status and activity (playing, watching, listening, etc.) |
469
- | `get_bot_info` | Get the bot's current user info, status, and connection details |
470
-
471
- ### Server Templates (4 tools)
472
-
473
- | Tool | Description |
474
- |------|-------------|
475
- | `list_templates` | List all templates for the server |
476
- | `create_template` | Create a new server template from the current server configuration |
477
- | `delete_template` | Delete a server template by code |
478
- | `sync_template` | Sync a server template with the current server state |
479
-
480
- ### Application Commands (4 tools)
481
-
482
- | Tool | Description |
483
- |------|-------------|
484
- | `list_commands` | List all registered application (slash) commands |
485
- | `create_command` | Register a new slash command with name, description, and options |
486
- | `edit_command` | Modify an existing slash command |
487
- | `delete_command` | Remove a registered slash command |
488
-
489
- ### Onboarding (2 tools)
490
-
491
- | Tool | Description |
492
- |------|-------------|
493
- | `get_onboarding` | Get the server's onboarding configuration and prompts |
494
- | `edit_onboarding` | Edit the server onboarding settings, prompts, and default channels |
495
-
496
- </details>
497
-
498
- ---
499
-
500
- ## Fuzzy Matching
501
-
502
- All tools that accept channel, role, or member names use smart fuzzy matching. You never need to look up IDs manually. The resolution order is:
503
-
504
- 1. **Exact ID match** — pass a Discord snowflake ID directly
505
- 2. **Exact name match** — case-insensitive
506
- 3. **Normalized match** — ignores hyphens, spaces, and underscores (`"bot testing"` matches `"bot-testing"`)
507
- 4. **Substring match** — partial name matches at 0.7+ similarity threshold
508
-
509
- Mention formats are also handled automatically:
510
-
511
- - Channels: `#name` or `<#id>`
512
- - Roles: `@name` or `<@&id>`
513
- - Members: `@name` or `<@id>` or `<@!id>`
514
-
515
- If no match is found, the error message includes suggestions of similar names to help you correct the input.
516
-
517
- ---
518
-
519
- ## MCP Resources
520
-
521
- Three read-only resources are exposed for quick server overview data:
522
-
523
- | URI | Description |
524
- |-----|-------------|
525
- | `discord://server/summary` | Text overview of the server (channels, roles, members) |
526
- | `discord://server/channels` | JSON list of all channels organized by category |
527
- | `discord://server/roles` | JSON list of all roles sorted by position |
528
-
529
- ---
530
-
531
- ## Required Permissions
532
-
533
- The Discord bot needs the following permissions for full functionality:
534
-
535
- | Category | Permissions |
536
- |----------|-------------|
537
- | **General** | Manage Server, Manage Roles, Manage Channels, View Audit Log, Manage Webhooks, Manage Events, Manage Emojis and Stickers |
538
- | **Text** | Send Messages, Manage Messages, Read Message History, Add Reactions, Use External Emojis |
539
- | **Voice** | Move Members, Disconnect Members |
540
- | **Moderation** | Kick Members, Ban Members, Moderate Members, Manage Auto Moderation |
541
-
542
- The `init` wizard auto-generates an invite URL with all of these. If you set up manually, see the [Bot Setup Guide](docs/bot-setup-guide.md) for which checkboxes to select.
543
-
544
- The bot can only act within its role hierarchy — it cannot manage roles positioned higher than its own highest role.
545
-
546
- ### Gateway Intents
547
-
548
- These privileged intents must be enabled in the [Discord Developer Portal](https://discord.com/developers/applications):
549
-
550
- - **Server Members Intent** — required for member management
551
- - **Message Content Intent** — required for reading message content
552
-
553
- ---
554
-
555
- ## Troubleshooting
556
-
557
- Run the health check to diagnose issues:
558
-
559
- ```bash
560
- npx @quadslab.io/discord-mcp check
561
- ```
562
-
563
- <details>
564
- <summary><strong>Common issues and fixes</strong></summary>
565
-
566
- ### "DISCORD_TOKEN is not set"
567
-
568
- The MCP server can't find your bot token. Either:
569
- - Run `npx @quadslab.io/discord-mcp init` to set up automatically
570
- - Or check that your `.mcp.json` / MCP client config has the `DISCORD_TOKEN` in the `env` block
571
-
572
- ### "Request with opcode 8 was rate limited"
573
-
574
- Discord rate-limited the gateway connection (usually from member caching on large servers). The server retries automatically — if you're still seeing this, wait 30 seconds and try again. This is a Discord-side limit, not a bug.
575
-
576
- ### "Role @everyone not found"
577
-
578
- Fixed in v1.2.2+. Update to the latest version:
579
- ```bash
580
- npx @quadslab.io/discord-mcp@latest init
581
- ```
582
-
583
- ### "Missing Access" or "Missing Permissions"
584
-
585
- The bot's role doesn't have the required permissions. Either:
586
- - Re-invite the bot using the URL from `npx @quadslab.io/discord-mcp init` (it includes all permissions)
587
- - Or go to **Server Settings > Roles** and grant the missing permissions to the bot's role
588
- - Run `npx @quadslab.io/discord-mcp check` to see exactly which permissions are missing
589
-
590
- ### Bot can't manage a specific role
591
-
592
- Discord enforces role hierarchy — the bot can only manage roles **below** its own highest role. Move the bot's role higher in **Server Settings > Roles**.
593
-
594
- ### Bot can't read messages
595
-
596
- Enable **Message Content Intent** in the [Discord Developer Portal](https://discord.com/developers/applications) > Bot tab.
597
-
598
- ### "Used disallowed intents"
599
-
600
- Enable **Server Members Intent** and **Message Content Intent** in the [Discord Developer Portal](https://discord.com/developers/applications) > Bot tab. Both are required.
601
-
602
- ### Tools work but are slow
603
-
604
- The first tool call after startup may be slow due to caching. Subsequent calls use the cached data and should be instant. If all calls are slow, check your network connection to Discord.
605
-
606
- ### `.mcp.json` was created in the wrong directory
607
-
608
- If you ran `init` from Desktop or Downloads, update to v1.2.3+ which auto-detects this and writes to `~/.claude.json` (global config) instead. Or move the `.mcp.json` file to your project root.
609
-
610
- </details>
611
-
612
- ---
613
-
614
- ## Architecture
615
-
616
- ```
617
- @quadslab.io/discord-mcp/
618
- ├── package.json
619
- ├── tsconfig.json
620
- ├── README.md
621
- ├── LICENSE
622
- ├── .env.example
623
- ├── docs/
624
- ├── discord-mcp-server.md # Full tool reference documentation
625
- └── bot-setup-guide.md # Step-by-step bot creation guide
626
- └── src/
627
- ├── cli.ts # CLI — init wizard, health check, server start
628
- ├── mcp-server.ts # MCP server entry validates env, exports main()
629
- ├── index.ts # Tool/resource registration and MCP request routing
630
- ├── discord-client.ts # Discord.js client intents, caching, rate limit retry
631
- └── tools/
632
- ├── index.ts # Tool registry — routes calls to category handlers
633
- ├── utils.ts # Fuzzy matching for channels, roles, members
634
- ├── guild.ts # Server info (2)
635
- ├── roles.ts # Role management (11)
636
- ├── channels.ts # Channel management (20)
637
- ├── members.ts # Member management (15)
638
- ├── messages.ts # Messaging (14)
639
- ├── reactions.ts # Reactions (1)
640
- ├── server.ts # Server admin (16)
641
- ├── threads.ts # Thread management (10)
642
- ├── forums.ts # Forum channels (5)
643
- ├── emojis.ts # Emoji & stickers (7)
644
- ├── webhooks.ts # Webhooks (4)
645
- ├── events.ts # Scheduled events (5)
646
- ├── stage.ts # Stage instances (3)
647
- ├── automod.ts # Auto-moderation (4)
648
- ├── polls.ts # Polls (3)
649
- ├── dms.ts # Direct messages (2)
650
- ├── presence.ts # Bot presence (2)
651
- ├── templates.ts # Server templates (4)
652
- ├── commands.ts # Application commands (4)
653
- └── onboarding.ts # Onboarding (2)
654
- ```
655
-
656
- ---
657
-
658
- ## Contributing
659
-
660
- Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style, and guidelines.
661
-
662
- ---
663
-
664
- ## License
665
-
666
- MIT License. Copyright (c) 2026 [QuadsLab.io](https://quadslab.io).
667
-
668
- See [LICENSE](LICENSE) for the full text.
1
+ # @quadslab.io/discord-mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@quadslab.io/discord-mcp)](https://www.npmjs.com/package/@quadslab.io/discord-mcp)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@quadslab.io/discord-mcp)](https://www.npmjs.com/package/@quadslab.io/discord-mcp)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
7
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white)](https://discord.gg/sjnb8wWGCJ)
8
+ [![GitHub stars](https://img.shields.io/github/stars/HardHeadHackerHead/discord-mcp?style=social)](https://github.com/HardHeadHackerHead/discord-mcp)
9
+
10
+ **Manage your entire Discord server from Claude Code, Claude Desktop, Cursor, or Windsurf.** 139 admin tools across 20 categories — roles, channels, members, messages, threads, moderation, forums, stages, webhooks, events, polls, DMs, and more. Just talk to your AI in plain English.
11
+
12
+ Built by [QuadsLab.io](https://quadslab.io) | [Discord](https://discord.gg/sjnb8wWGCJ) | [npm](https://www.npmjs.com/package/@quadslab.io/discord-mcp)
13
+
14
+ > If you find this useful, consider giving it a star on GitHub — it helps others discover the project!
15
+
16
+ ---
17
+
18
+ ## Setup in 60 Seconds
19
+
20
+ One command. No manual config files. No copying IDs.
21
+
22
+ ```bash
23
+ npx @quadslab.io/discord-mcp init
24
+ ```
25
+
26
+ The interactive wizard walks you through everything:
27
+
28
+ <p align="center">
29
+ <img src="assets/demo.svg" alt="npx @quadslab.io/discord-mcp init — interactive setup wizard" width="800">
30
+ </p>
31
+
32
+ It will:
33
+ 1. Guide you through creating a Discord bot (or use an existing one)
34
+ 2. Validate your bot token live
35
+ 3. Auto-generate the invite URL with all required permissions
36
+ 4. Let you pick which server to manage
37
+ 5. Auto-detect your installed MCP clients and write the config for you
38
+
39
+ ### Works With Every MCP Client
40
+
41
+ The wizard auto-detects which clients you have installed:
42
+
43
+ ```
44
+ Detected MCP clients:
45
+
46
+ Claude Code .mcp.json
47
+ Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json
48
+ ● Cursor ~/.cursor/mcp.json
49
+ Windsurf (not detected)
50
+
51
+ ? Which client(s) to configure?
52
+ 1. Claude Code (detected)
53
+ 2. Claude Desktop (detected)
54
+ 3. Cursor (detected)
55
+ 4. Windsurf (not found)
56
+ 5. All detected (3 clients)
57
+ 6. Skip (show config to copy manually)
58
+ ```
59
+
60
+ Select one, multiple, or "All detected" to configure everything at once.
61
+
62
+ ### Verify Your Setup
63
+
64
+ ```bash
65
+ npx @quadslab.io/discord-mcp check
66
+ ```
67
+
68
+ ```
69
+ QuadsLab.io [discord-mcp] Health Check
70
+ ────────────────────────────────────────────────────
71
+
72
+ Token ............ present
73
+ Bot .............. MyBot#1234
74
+ Server ........... My Gaming Server (1,024 members)
75
+
76
+ Permissions
77
+ ────────────────────────────────────────────────────
78
+
79
+ ✔ Manage Roles .............. yes
80
+ ✔ Manage Channels ........... yes
81
+ Kick Members .............. yes
82
+ ✔ Ban Members ............... yes
83
+ ...
84
+
85
+ ██████████████████████████████ 100% (24/24)
86
+
87
+ ✔ All 24 permissions granted
88
+
89
+ ┌──────────────────────────────────────────────────┐
90
+ │ MCP server is ready! │
91
+ Run discord-mcp or use via .mcp.json in Claude │
92
+ └──────────────────────────────────────────────────┘
93
+ ```
94
+
95
+ ---
96
+
97
+ ## What Can You Do With It?
98
+
99
+ Once connected to Claude Code, just ask in natural language:
100
+
101
+ - *"Send a welcome message in #general"*
102
+ - *"Lock down the #announcements channel"*
103
+ - *"Who reacted to the last message in #server-guide?"*
104
+ - *"Create a role called VIP with a gold color and assign it to @john"*
105
+ - *"Show me the audit log for the last 24 hours"*
106
+ - *"Set up an automod rule to block links in #general"*
107
+ - *"Show me the last 20 messages in the 'API Discussion' thread"*
108
+ - *"Send a reply in the 'bug-report' thread saying we're looking into it"*
109
+ - *"List all archived threads in #general"*
110
+ - *"Create a forum post in #feedback titled Bug Reports"*
111
+ - *"Timeout @spammer for 1 hour for spamming"*
112
+ - *"List all webhooks and delete the unused ones"*
113
+ - *"Schedule a community event for Friday at 8pm in the Stage channel"*
114
+ - *"Bulk delete the last 50 messages in #bot-testing"*
115
+ - *"Give everyone with the Member role access to #private-channel"*
116
+ - *"Create a poll in #general asking which game to play Friday"*
117
+ - *"DM all moderators about the upcoming server event"*
118
+ - *"Set the bot's status to 'Watching over 500 members'"*
119
+ - *"Show me who's in the Gaming voice channel right now"*
120
+
121
+ Claude automatically resolves channel, role, and member names using fuzzy matching — no need to look up IDs.
122
+
123
+ ---
124
+
125
+ ## Features
126
+
127
+ - **139 tools across 20 categories** comprehensive Discord server administration without leaving the terminal
128
+ - **Interactive setup wizard** `npx init` walks you through bot creation, token validation, and config in under a minute
129
+ - **Health check & permission audit** — `npx check` verifies your token, server access, and all 24 required permissions with a visual progress bar
130
+ - **Fuzzy name resolution** type `"bot testing"`, `"bot-testing"`, or `"bottesting"` and it resolves correctly; no need to look up IDs
131
+ - **Thread-aware messaging** — all message tools (send, edit, pin, react, etc.) work in threads and channels alike — no separate tools needed
132
+ - **Zero-config name matching** — channels, roles, and members are all resolved by name, ID, or mention format automatically
133
+ - **Pre-cached server data** — all channels, roles, and members are cached on startup for instant lookups without extra API calls
134
+ - **Structured JSON responses** — every tool returns consistent, pretty-printed JSON
135
+ - **Audit log integration** — all modifying operations accept a `reason` parameter that appears in the Discord audit log
136
+ - **Helpful error recovery** — failed lookups return suggestions (e.g., "Did you mean: #general, #bot-testing?")
137
+ - **MCP resources** — three read-only resources for server overview data
138
+
139
+ ---
140
+
141
+ ## Alternative Setup (Manual)
142
+
143
+ If you prefer to configure things manually instead of using the wizard:
144
+
145
+ <details>
146
+ <summary><strong>Manual setup steps</strong></summary>
147
+
148
+ ### 1. Create a Discord bot
149
+
150
+ Follow the [Bot Setup Guide](docs/bot-setup-guide.md) to create a bot in the Discord Developer Portal and get your token.
151
+
152
+ ### 2. Add to your MCP config
153
+
154
+ Add the following `discord` entry to your client's config file:
155
+
156
+ ```json
157
+ {
158
+ "mcpServers": {
159
+ "discord": {
160
+ "command": "npx",
161
+ "args": ["-y", "@quadslab.io/discord-mcp"],
162
+ "env": {
163
+ "DISCORD_TOKEN": "your-bot-token",
164
+ "DISCORD_GUILD_ID": "your-server-id"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ ```
170
+
171
+ | Client | Config file location |
172
+ |--------|---------------------|
173
+ | **Claude Code** | `.mcp.json` in your project root |
174
+ | **Claude Desktop** | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows) |
175
+ | **Cursor** | `~/.cursor/mcp.json` |
176
+ | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |
177
+
178
+ ### 3. Connect
179
+
180
+ - **Claude Code:** Type `/mcp` to connect
181
+ - **Claude Desktop:** Restart the app
182
+ - **Cursor / Windsurf:** Reload the window
183
+
184
+ </details>
185
+
186
+ <details>
187
+ <summary><strong>Run from source</strong></summary>
188
+
189
+ ```bash
190
+ git clone https://github.com/HardHeadHackerHead/discord-mcp.git
191
+ cd discord-mcp
192
+ npm install
193
+ cp .env.example .env
194
+ # Edit .env with your DISCORD_TOKEN and DISCORD_GUILD_ID
195
+ npm run build
196
+ npm start
197
+ ```
198
+
199
+ </details>
200
+
201
+ ---
202
+
203
+ ## CLI Reference
204
+
205
+ ```
206
+ $ npx @quadslab.io/discord-mcp [command]
207
+ ```
208
+
209
+ | Command | Description |
210
+ |---------|-------------|
211
+ | `init` | Interactive setup wizard — creates bot, validates token, auto-configures Claude Code / Desktop / Cursor / Windsurf |
212
+ | `check` | Health check — verifies token, server access, and permission audit |
213
+ | `start` | Start the MCP server (default when no command given) |
214
+ | `help` | Show help message |
215
+ | `version` | Show version |
216
+
217
+ When launched via `.mcp.json` (stdin is not a TTY), the server starts automatically — no subcommand needed.
218
+
219
+ ---
220
+
221
+ ## Tools Overview
222
+
223
+ ### Summary
224
+
225
+ | Category | Tools | Description |
226
+ |----------|------:|-------------|
227
+ | Guild | 2 | Server information and metadata |
228
+ | Roles | 11 | Role creation, editing, permissions, and assignment |
229
+ | Channels | 20 | Channel creation, editing, permissions, and organization |
230
+ | Members | 15 | Member management, moderation, and bulk operations |
231
+ | Messages | 14 | Send, edit, delete, pin, and react to messages (works in threads too) |
232
+ | Reactions | 1 | Detailed reaction data with reactor info |
233
+ | Server Admin | 16 | Server settings, invites, bans, audit log, and integrations |
234
+ | Threads | 15 | Thread creation, reading, editing, archiving, and member management |
235
+ | Forums | 5 | Forum posts and tag management |
236
+ | Emojis & Stickers | 7 | Custom emoji and sticker management |
237
+ | Webhooks | 4 | Webhook creation, deletion, and messaging |
238
+ | Scheduled Events | 5 | Event creation, editing, and deletion |
239
+ | Stage Instances | 3 | Stage channel management |
240
+ | Auto-Moderation | 4 | Automod rule creation, editing, and deletion |
241
+ | Polls | 3 | Create polls, get results, end polls early |
242
+ | Direct Messages | 2 | Send DMs and embed DMs to server members |
243
+ | Bot Presence | 2 | Set bot status/activity, get bot info |
244
+ | Server Templates | 4 | List, create, delete, sync server templates |
245
+ | Application Commands | 4 | Manage slash commands (CRUD) |
246
+ | Onboarding | 2 | Get and edit server onboarding configuration |
247
+ | **Total** | **139** | |
248
+
249
+ ---
250
+
251
+ <details>
252
+ <summary><strong>Full tool reference (click to expand)</strong></summary>
253
+
254
+ ### Guild (2 tools)
255
+
256
+ | Tool | Description |
257
+ |------|-------------|
258
+ | `list_guilds` | List all servers the bot is a member of |
259
+ | `get_guild_info` | Detailed server info — member count, channels, roles, features, boost tier |
260
+
261
+ ### Roles (11 tools)
262
+
263
+ | Tool | Description |
264
+ |------|-------------|
265
+ | `list_roles` | List all roles sorted by position with colors and member counts |
266
+ | `create_role` | Create a new role with name, color, hoist, and mentionable options |
267
+ | `delete_role` | Delete a role (with managed role protection) |
268
+ | `modify_role` | Change a role's name, color, hoist, mentionable, or position |
269
+ | `get_role_permissions` | View all permissions granted to a role |
270
+ | `modify_role_permissions` | Grant or revoke specific permissions on a role |
271
+ | `set_role_icon` | Set a Unicode emoji or image as the role icon (requires boost level 2+) |
272
+ | `assign_role` | Add a role to a member |
273
+ | `remove_role` | Remove a role from a member |
274
+ | `get_role_members` | List all members who have a specific role |
275
+ | `clone_role` | Duplicate a role with all its permissions and settings |
276
+
277
+ ### Channels (20 tools)
278
+
279
+ | Tool | Description |
280
+ |------|-------------|
281
+ | `list_channels` | List all channels organized by category |
282
+ | `create_text_channel` | Create a new text channel, optionally in a category |
283
+ | `create_voice_channel` | Create a new voice channel with bitrate and user limit |
284
+ | `create_category` | Create a new channel category |
285
+ | `create_forum_channel` | Create a new forum channel with optional tags and default settings |
286
+ | `delete_channel` | Delete any channel type |
287
+ | `modify_channel` | Change name, topic, category, NSFW, position, user limit |
288
+ | `set_channel_permissions` | Set permission overwrites for a role or user on a channel |
289
+ | `view_channel_permissions` | View all permission overwrites on a channel |
290
+ | `lock_channel` | Deny SendMessages for @everyone (quick lock) |
291
+ | `unlock_channel` | Remove SendMessages deny for @everyone |
292
+ | `set_slowmode` | Set rate limit (0–21600 seconds) on a text channel |
293
+ | `clone_channel` | Duplicate a channel with all permissions and settings |
294
+ | `reorder_channels` | Reorder channels by specifying new positions |
295
+ | `set_voice_region` | Set the RTC region for a voice channel |
296
+ | `follow_announcement_channel` | Follow an announcement channel to cross-post into another channel |
297
+ | `create_stage_channel` | Create a new stage channel |
298
+ | `get_channel_invites` | List all invites for a specific channel |
299
+ | `set_channel_topic` | Set or clear a channel's topic/description |
300
+ | `get_voice_members` | List all members currently in a voice or stage channel |
301
+
302
+ ### Members (15 tools)
303
+
304
+ | Tool | Description |
305
+ |------|-------------|
306
+ | `list_members` | List members with optional role and search filters |
307
+ | `get_member` | Detailed member info roles, join date, account age, permissions |
308
+ | `kick_member` | Kick a member from the server |
309
+ | `ban_member` | Ban a member with optional message deletion (0–7 days) |
310
+ | `unban_member` | Remove a ban by username or user ID |
311
+ | `timeout_member` | Apply a timeout (10m, 1h, 1d, 1w) or remove one |
312
+ | `prune_members` | Remove inactive members (supports dry run and role filtering) |
313
+ | `bulk_assign_role` | Assign a role to multiple members at once |
314
+ | `bulk_remove_role` | Remove a role from multiple members at once |
315
+ | `set_nickname` | Change a member's nickname or reset it |
316
+ | `move_to_voice` | Move a member to a different voice channel |
317
+ | `disconnect_from_voice` | Disconnect a member from their voice channel |
318
+ | `get_member_permissions` | Get a member's effective permissions in a specific channel |
319
+ | `search_members` | Search members by username, nickname, or role with advanced filters |
320
+ | `bulk_timeout_members` | Apply a timeout to multiple members at once |
321
+
322
+ ### Messages (14 tools)
323
+
324
+ All message tools work in both regular channels **and** threads — just pass the thread name or ID as the channel.
325
+
326
+ | Tool | Description |
327
+ |------|-------------|
328
+ | `get_messages` | Fetch recent messages from a text channel, voice channel, or thread |
329
+ | `get_message` | Fetch a single message by ID with full details |
330
+ | `send_message` | Send a text message, optionally as a reply |
331
+ | `send_embed` | Send a rich embed with title, fields, images, and footer |
332
+ | `edit_message` | Edit a message previously sent by the bot |
333
+ | `delete_message` | Delete a single message by ID |
334
+ | `bulk_delete_messages` | Delete 2–100 messages at once (< 14 days old), optionally filtered by user |
335
+ | `crosspost_message` | Publish a message in an announcement channel to all following channels |
336
+ | `pin_message` | Pin a message |
337
+ | `unpin_message` | Unpin a message |
338
+ | `list_pinned_messages` | Get all pinned messages in a channel |
339
+ | `add_reaction` | Add a reaction from the bot to a message |
340
+ | `remove_reaction` | Remove the bot's reaction from a message |
341
+ | `search_messages` | Search messages in a channel by content, author, or date range |
342
+
343
+ ### Reactions (1 tool)
344
+
345
+ | Tool | Description |
346
+ |------|-------------|
347
+ | `get_reactions` | Get all reactions on a message with full reactor details — account creation date, server join date, roles, avatar, boost status. Optionally filter by emoji. |
348
+
349
+ ### Server Admin (16 tools)
350
+
351
+ | Tool | Description |
352
+ |------|-------------|
353
+ | `edit_server` | Modify server name, description, verification level, notification defaults |
354
+ | `list_invites` | List all active invite links with usage stats and expiration |
355
+ | `create_invite` | Generate a new invite with configurable max age, uses, and temporary flag |
356
+ | `delete_invite` | Revoke an invite by code |
357
+ | `get_audit_log` | Fetch audit log entries, optionally filtered by action type or user |
358
+ | `list_bans` | View all banned users with reasons |
359
+ | `get_welcome_screen` | Get the server welcome screen configuration |
360
+ | `set_welcome_screen` | Configure the welcome screen with description and featured channels |
361
+ | `get_widget` | Get the server widget settings |
362
+ | `set_widget` | Configure the server widget (enable/disable, set channel) |
363
+ | `get_vanity_url` | Get the server vanity URL (requires VANITY_URL feature) |
364
+ | `list_integrations` | List all integrations (bots, apps) connected to the server |
365
+ | `delete_integration` | Remove an integration from the server |
366
+ | `get_server_preview` | Get the server's public preview information |
367
+ | `set_server_icon` | Set or remove the server icon from a URL |
368
+ | `set_server_banner` | Set or remove the server banner image (requires boost level 2+) |
369
+
370
+ ### Threads (15 tools)
371
+
372
+ | Tool | Description |
373
+ |------|-------------|
374
+ | `list_threads` | List active threads, optionally filtered to a channel |
375
+ | `list_archived_threads` | List public or private archived threads in a channel with pagination |
376
+ | `get_thread` | Get detailed thread info — type, slowmode, auto-archive, owner, URL |
377
+ | `get_thread_messages` | Fetch messages from a thread with before/after pagination |
378
+ | `get_thread_pinned_messages` | Get all pinned messages in a thread |
379
+ | `create_thread` | Start a thread from a message or as a standalone public thread |
380
+ | `edit_thread` | Edit thread name, auto-archive duration, slowmode, or locked/archived status |
381
+ | `archive_thread` | Archive a thread |
382
+ | `unarchive_thread` | Unarchive a thread |
383
+ | `delete_thread` | Delete a thread |
384
+ | `lock_thread` | Lock a thread (prevent new messages without archiving) |
385
+ | `unlock_thread` | Unlock a thread |
386
+ | `list_thread_members` | List all members of a thread |
387
+ | `add_thread_member` | Add a member to a thread |
388
+ | `remove_thread_member` | Remove a member from a thread |
389
+
390
+ ### Forums (5 tools)
391
+
392
+ | Tool | Description |
393
+ |------|-------------|
394
+ | `create_forum_post` | Create a new post (thread) in a forum channel with optional tags |
395
+ | `list_forum_tags` | List all available tags on a forum channel |
396
+ | `create_forum_tag` | Add a new tag to a forum channel (max 20 per channel) |
397
+ | `edit_forum_tag` | Edit an existing forum tag's name, emoji, or moderated status |
398
+ | `delete_forum_tag` | Remove a tag from a forum channel |
399
+
400
+ ### Emojis & Stickers (7 tools)
401
+
402
+ | Tool | Description |
403
+ |------|-------------|
404
+ | `list_emojis` | List all custom emojis with names, IDs, animated status, and URLs |
405
+ | `create_emoji` | Upload a new custom emoji from a URL |
406
+ | `delete_emoji` | Remove a custom emoji by name or ID |
407
+ | `rename_emoji` | Rename a custom emoji |
408
+ | `list_stickers` | List all custom stickers with descriptions and format info |
409
+ | `create_sticker` | Upload a new custom sticker from a URL |
410
+ | `delete_sticker` | Remove a custom sticker by name or ID |
411
+
412
+ ### Webhooks (4 tools)
413
+
414
+ | Tool | Description |
415
+ |------|-------------|
416
+ | `list_webhooks` | List all webhooks, optionally filtered to a channel |
417
+ | `create_webhook` | Create a webhook on a channel with name and optional avatar |
418
+ | `delete_webhook` | Delete a webhook by ID |
419
+ | `send_webhook_message` | Send a message via webhook with optional name/avatar override |
420
+
421
+ ### Scheduled Events (5 tools)
422
+
423
+ | Tool | Description |
424
+ |------|-------------|
425
+ | `list_events` | List all scheduled events with times, status, type, and attendee count |
426
+ | `create_event` | Create a voice, stage, or external event with start/end times |
427
+ | `edit_event` | Modify an event's name, description, times, or status |
428
+ | `delete_event` | Delete a scheduled event |
429
+ | `get_event_users` | List users who have expressed interest in an event |
430
+
431
+ ### Stage Instances (3 tools)
432
+
433
+ | Tool | Description |
434
+ |------|-------------|
435
+ | `list_stage_instances` | List all active stage instances with topic and channel info |
436
+ | `start_stage` | Start a new stage instance on a stage channel with a topic |
437
+ | `end_stage` | End an active stage instance |
438
+
439
+ ### Auto-Moderation (4 tools)
440
+
441
+ | Tool | Description |
442
+ |------|-------------|
443
+ | `list_automod_rules` | List all automod rules with triggers, actions, and exemptions |
444
+ | `create_automod_rule` | Create a rule keyword filter, spam detection, keyword presets, or mention spam |
445
+ | `edit_automod_rule` | Modify a rule's keywords, actions, exemptions, or enabled state |
446
+ | `delete_automod_rule` | Delete an automod rule |
447
+
448
+ ### Polls (3 tools)
449
+
450
+ | Tool | Description |
451
+ |------|-------------|
452
+ | `create_poll` | Create a poll in a channel with multiple choice options and duration |
453
+ | `get_poll_results` | Get the current results and vote counts for a poll |
454
+ | `end_poll` | End a poll early and finalize the results |
455
+
456
+ ### Direct Messages (2 tools)
457
+
458
+ | Tool | Description |
459
+ |------|-------------|
460
+ | `send_dm` | Send a direct message to a server member |
461
+ | `send_dm_embed` | Send a rich embed as a direct message to a server member |
462
+
463
+ ### Bot Presence (2 tools)
464
+
465
+ | Tool | Description |
466
+ |------|-------------|
467
+ | `set_bot_presence` | Set the bot's status and activity (playing, watching, listening, etc.) |
468
+ | `get_bot_info` | Get the bot's current user info, status, and connection details |
469
+
470
+ ### Server Templates (4 tools)
471
+
472
+ | Tool | Description |
473
+ |------|-------------|
474
+ | `list_templates` | List all templates for the server |
475
+ | `create_template` | Create a new server template from the current server configuration |
476
+ | `delete_template` | Delete a server template by code |
477
+ | `sync_template` | Sync a server template with the current server state |
478
+
479
+ ### Application Commands (4 tools)
480
+
481
+ | Tool | Description |
482
+ |------|-------------|
483
+ | `list_commands` | List all registered application (slash) commands |
484
+ | `create_command` | Register a new slash command with name, description, and options |
485
+ | `edit_command` | Modify an existing slash command |
486
+ | `delete_command` | Remove a registered slash command |
487
+
488
+ ### Onboarding (2 tools)
489
+
490
+ | Tool | Description |
491
+ |------|-------------|
492
+ | `get_onboarding` | Get the server's onboarding configuration and prompts |
493
+ | `edit_onboarding` | Edit the server onboarding settings, prompts, and default channels |
494
+
495
+ </details>
496
+
497
+ ---
498
+
499
+ ## Fuzzy Matching
500
+
501
+ All tools that accept channel, role, or member names use smart fuzzy matching. You never need to look up IDs manually. The resolution order is:
502
+
503
+ 1. **Exact ID match** — pass a Discord snowflake ID directly
504
+ 2. **Exact name match** — case-insensitive
505
+ 3. **Normalized match** — ignores hyphens, spaces, and underscores (`"bot testing"` matches `"bot-testing"`)
506
+ 4. **Substring match** — partial name matches at 0.7+ similarity threshold
507
+ 5. **Thread fallback** — if no channel matches, active threads are searched using the same steps above
508
+ 6. **Archived thread fallback** — if an ID is provided and not found in active threads, the thread is fetched directly (covers archived threads)
509
+
510
+ Mention formats are also handled automatically:
511
+
512
+ - Channels: `#name` or `<#id>`
513
+ - Roles: `@name` or `<@&id>`
514
+ - Members: `@name` or `<@id>` or `<@!id>`
515
+
516
+ If no match is found, the error message includes suggestions of similar names to help you correct the input.
517
+
518
+ ---
519
+
520
+ ## MCP Resources
521
+
522
+ Three read-only resources are exposed for quick server overview data:
523
+
524
+ | URI | Description |
525
+ |-----|-------------|
526
+ | `discord://server/summary` | Text overview of the server (channels, roles, members) |
527
+ | `discord://server/channels` | JSON list of all channels organized by category |
528
+ | `discord://server/roles` | JSON list of all roles sorted by position |
529
+
530
+ ---
531
+
532
+ ## Required Permissions
533
+
534
+ The Discord bot needs the following permissions for full functionality:
535
+
536
+ | Category | Permissions |
537
+ |----------|-------------|
538
+ | **General** | Manage Server, Manage Roles, Manage Channels, View Audit Log, Manage Webhooks, Manage Events, Manage Emojis and Stickers |
539
+ | **Text** | Send Messages, Manage Messages, Read Message History, Add Reactions, Use External Emojis |
540
+ | **Voice** | Move Members, Disconnect Members |
541
+ | **Moderation** | Kick Members, Ban Members, Moderate Members, Manage Auto Moderation |
542
+
543
+ The `init` wizard auto-generates an invite URL with all of these. If you set up manually, see the [Bot Setup Guide](docs/bot-setup-guide.md) for which checkboxes to select.
544
+
545
+ The bot can only act within its role hierarchy — it cannot manage roles positioned higher than its own highest role.
546
+
547
+ ### Gateway Intents
548
+
549
+ These privileged intents must be enabled in the [Discord Developer Portal](https://discord.com/developers/applications):
550
+
551
+ - **Server Members Intent** — required for member management
552
+ - **Message Content Intent** — required for reading message content
553
+
554
+ ---
555
+
556
+ ## Troubleshooting
557
+
558
+ Run the health check to diagnose issues:
559
+
560
+ ```bash
561
+ npx @quadslab.io/discord-mcp check
562
+ ```
563
+
564
+ <details>
565
+ <summary><strong>Common issues and fixes</strong></summary>
566
+
567
+ ### "DISCORD_TOKEN is not set"
568
+
569
+ The MCP server can't find your bot token. Either:
570
+ - Run `npx @quadslab.io/discord-mcp init` to set up automatically
571
+ - Or check that your `.mcp.json` / MCP client config has the `DISCORD_TOKEN` in the `env` block
572
+
573
+ ### "Request with opcode 8 was rate limited"
574
+
575
+ Discord rate-limited the gateway connection (usually from member caching on large servers). The server retries automatically — if you're still seeing this, wait 30 seconds and try again. This is a Discord-side limit, not a bug.
576
+
577
+ ### "Role @everyone not found"
578
+
579
+ Fixed in v1.2.2+. Update to the latest version:
580
+ ```bash
581
+ npx @quadslab.io/discord-mcp@latest init
582
+ ```
583
+
584
+ ### "Missing Access" or "Missing Permissions"
585
+
586
+ The bot's role doesn't have the required permissions. Either:
587
+ - Re-invite the bot using the URL from `npx @quadslab.io/discord-mcp init` (it includes all permissions)
588
+ - Or go to **Server Settings > Roles** and grant the missing permissions to the bot's role
589
+ - Run `npx @quadslab.io/discord-mcp check` to see exactly which permissions are missing
590
+
591
+ ### Bot can't manage a specific role
592
+
593
+ Discord enforces role hierarchy — the bot can only manage roles **below** its own highest role. Move the bot's role higher in **Server Settings > Roles**.
594
+
595
+ ### Bot can't read messages
596
+
597
+ Enable **Message Content Intent** in the [Discord Developer Portal](https://discord.com/developers/applications) > Bot tab.
598
+
599
+ ### "Used disallowed intents"
600
+
601
+ Enable **Server Members Intent** and **Message Content Intent** in the [Discord Developer Portal](https://discord.com/developers/applications) > Bot tab. Both are required.
602
+
603
+ ### Tools work but are slow
604
+
605
+ The first tool call after startup may be slow due to caching. Subsequent calls use the cached data and should be instant. If all calls are slow, check your network connection to Discord.
606
+
607
+ ### `.mcp.json` was created in the wrong directory
608
+
609
+ If you ran `init` from Desktop or Downloads, update to v1.2.3+ which auto-detects this and writes to `~/.claude.json` (global config) instead. Or move the `.mcp.json` file to your project root.
610
+
611
+ </details>
612
+
613
+ ---
614
+
615
+ ## Architecture
616
+
617
+ ```
618
+ @quadslab.io/discord-mcp/
619
+ ├── package.json
620
+ ├── tsconfig.json
621
+ ├── README.md
622
+ ├── LICENSE
623
+ ├── .env.example
624
+ ├── docs/
625
+ ├── discord-mcp-server.md # Full tool reference documentation
626
+ └── bot-setup-guide.md # Step-by-step bot creation guide
627
+ └── src/
628
+ ├── cli.ts # CLI init wizard, health check, server start
629
+ ├── mcp-server.ts # MCP server entry validates env, exports main()
630
+ ├── index.ts # Tool/resource registration and MCP request routing
631
+ ├── discord-client.ts # Discord.js client — intents, caching, rate limit retry
632
+ └── tools/
633
+ ├── index.ts # Tool registry routes calls to category handlers
634
+ ├── utils.ts # Fuzzy matching for channels, roles, members
635
+ ├── guild.ts # Server info (2)
636
+ ├── roles.ts # Role management (11)
637
+ ├── channels.ts # Channel management (20)
638
+ ├── members.ts # Member management (15)
639
+ ├── messages.ts # Messaging (14)
640
+ ├── reactions.ts # Reactions (1)
641
+ ├── server.ts # Server admin (16)
642
+ ├── threads.ts # Thread management (15)
643
+ ├── forums.ts # Forum channels (5)
644
+ ├── emojis.ts # Emoji & stickers (7)
645
+ ├── webhooks.ts # Webhooks (4)
646
+ ├── events.ts # Scheduled events (5)
647
+ ├── stage.ts # Stage instances (3)
648
+ ├── automod.ts # Auto-moderation (4)
649
+ ├── polls.ts # Polls (3)
650
+ ├── dms.ts # Direct messages (2)
651
+ ├── presence.ts # Bot presence (2)
652
+ ├── templates.ts # Server templates (4)
653
+ ├── commands.ts # Application commands (4)
654
+ └── onboarding.ts # Onboarding (2)
655
+ ```
656
+
657
+ ---
658
+
659
+ ## Community
660
+
661
+ - [Discord Server](https://discord.gg/sjnb8wWGCJ) — get help, share feedback, see what others are building
662
+ - [GitHub Issues](https://github.com/HardHeadHackerHead/discord-mcp/issues) — bug reports and feature requests
663
+ - [GitHub Discussions](https://github.com/HardHeadHackerHead/discord-mcp/discussions) — questions, ideas, and show & tell
664
+ - [QuadsLab.io](https://quadslab.io) — more tools from the team
665
+
666
+ ---
667
+
668
+ ## Contributing
669
+
670
+ Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style, and guidelines.
671
+
672
+ ---
673
+
674
+ ## License
675
+
676
+ MIT License. Copyright (c) 2026 [QuadsLab.io](https://quadslab.io).
677
+
678
+ See [LICENSE](LICENSE) for the full text.