{"_id":"@el4cteo/discord-mcp","_rev":"4-08247a99ce085150979bd9e2dff55342","name":"@el4cteo/discord-mcp","dist-tags":{"latest":"1.5.1"},"versions":{"1.0.0":{"name":"@el4cteo/discord-mcp","version":"1.0.0","keywords":["mcp","model-context-protocol","discord","discord-bot","claude","claude-code","ai-agent","llm-tools","discord-api","chatops","moderation","anthropic","mcp-server","typescript"],"author":{"name":"EL4CTEO"},"license":"MIT","_id":"@el4cteo/discord-mcp@1.0.0","maintainers":[{"name":"el4cteo","email":"miyabi101@proton.me"}],"homepage":"https://github.com/EL4CTEO/discord-mcp#readme","bugs":{"url":"https://github.com/EL4CTEO/discord-mcp/issues"},"bin":{"discord-mcp":"dist/index.js"},"dist":{"shasum":"e4e794b530b196f72588b844ce6344c1d011ece8","tarball":"https://registry.npmjs.org/@el4cteo/discord-mcp/-/discord-mcp-1.0.0.tgz","fileCount":30,"integrity":"sha512-lSjmNpDzMfHFJMJejmlOj3ANJo0+yBZnhhmE+a/e2mWG872Kf6Shgd420E3ddoEoDQX/zKSctXj+mkk0xmRgjw==","signatures":[{"sig":"MEQCIFS3vSVxHVZAevywNkNZVGSAZregS+zBerBQgQxk9Vl3AiBrJNhRsbNz8U0UppdNB4b74L3aZ3Yvgxd12/3Q2KVlcg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":216256},"main":"dist/index.js","type":"module","engines":{"node":">=20.10.0"},"gitHead":"caf53196e4878ca64344da1f6378506cee056312","scripts":{"dev":"tsx watch src/index.ts","test":"vitest run","build":"tsc -p tsconfig.build.json","start":"node dist/index.js","prepare":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"el4cteo","email":"miyabi101@proton.me"},"repository":{"url":"git+https://github.com/EL4CTEO/discord-mcp.git","type":"git"},"_npmVersion":"11.4.1","description":"MCP server that lets AI agents run a Discord bot: messages, DMs, channels, threads, roles, members, moderation, live events and bulk operations.","directories":{},"_nodeVersion":"24.19.0","dependencies":{"zod":"^4.6.5","@discordjs/ws":"^2.0.4","@discordjs/rest":"^2.6.3","discord-api-types":"^0.38.55","@modelcontextprotocol/sdk":"^1.30.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.15","vitest":"^5.0.2","typescript":"^7.0.2","@types/node":"^26.6.3"},"_npmOperationalInternal":{"tmp":"tmp/discord-mcp_1.0.0_1790433984198_0.17680464487616043","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@el4cteo/discord-mcp","version":"1.2.0","keywords":["mcp","model-context-protocol","discord","discord-bot","claude","claude-code","ai-agent","llm-tools","discord-api","chatops","moderation","anthropic","mcp-server","typescript"],"author":{"name":"EL4CTEO"},"license":"MIT","_id":"@el4cteo/discord-mcp@1.2.0","maintainers":[{"name":"el4cteo","email":"miyabi101@proton.me"}],"homepage":"https://github.com/EL4CTEO/discord-mcp#readme","bugs":{"url":"https://github.com/EL4CTEO/discord-mcp/issues"},"bin":{"discord-mcp":"dist/index.js"},"dist":{"shasum":"9f71ec4b6a937dec74e0479fbe85d9a6c991903c","tarball":"https://registry.npmjs.org/@el4cteo/discord-mcp/-/discord-mcp-1.2.0.tgz","fileCount":33,"integrity":"sha512-dLjaWKYpE3Cv8dGuewzFN7CjihTAMm3CFIxJKVnlpMDy9jQz7jySTlpaHhwtCnLFaIsDPpA6qbB2oZTRgOyNjA==","signatures":[{"sig":"MEQCIAdpD9TBT4VLpewmo498c9xOjOCRRRF97cMqSbaY9YD0AiB+ksPNXZ95611zH8QLMjVNjc8nWh/JQy0vpcfz3EYz3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIGBPeo7xbTPoqfDhVP+wlMt2AhG1e7njlqZSi1D3bofgAiEA4vgcgSHgqWsGT/JW3iXfEDFwXRwQNh8xmWC3jtGRxwE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":338767},"main":"dist/index.js","type":"module","engines":{"node":">=20.10.0"},"gitHead":"9d577b71f9f2ca00cfdd5ac1ae6317dbea6b1efd","scripts":{"dev":"tsx watch src/index.ts","test":"vitest run","build":"tsc -p tsconfig.build.json","start":"node dist/index.js","prepare":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"el4cteo","email":"miyabi101@proton.me"},"repository":{"url":"git+https://github.com/EL4CTEO/discord-mcp.git","type":"git"},"_npmVersion":"12.2.0","description":"MCP server that lets AI agents run a Discord bot: messages, DMs, channels, threads, roles, members, moderation, live events and bulk operations.","directories":{},"_nodeVersion":"26.10.0","dependencies":{"zod":"^4.6.7","@discordjs/ws":"^2.0.4","@discordjs/rest":"^2.6.3","discord-api-types":"^0.38.56","@modelcontextprotocol/sdk":"^1.32.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.15","vitest":"^5.0.4","typescript":"^7.0.2","@types/node":"^26.6.5"},"_npmOperationalInternal":{"tmp":"tmp/discord-mcp_1.2.0_1791987816198_0.9385516868465118","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@el4cteo/discord-mcp","version":"1.2.1","keywords":["mcp","model-context-protocol","discord","discord-bot","claude","claude-code","ai-agent","llm-tools","discord-api","chatops","moderation","anthropic","mcp-server","typescript"],"author":{"name":"EL4CTEO"},"license":"MIT","_id":"@el4cteo/discord-mcp@1.2.1","maintainers":[{"name":"el4cteo","email":"miyabi101@proton.me"}],"homepage":"https://github.com/EL4CTEO/discord-mcp#readme","bugs":{"url":"https://github.com/EL4CTEO/discord-mcp/issues"},"bin":{"discord-mcp":"dist/index.js"},"dist":{"shasum":"267f511c8fbb8c47118f73e5d3b5496463e5b5e3","tarball":"https://registry.npmjs.org/@el4cteo/discord-mcp/-/discord-mcp-1.2.1.tgz","fileCount":33,"integrity":"sha512-bM/J8X7cBar3jzA6rI215Qzn/aDihb2V5Asd/sigpS4MW7oSrzxTTVnRTwUlgKjTxH3exSSDTx0LvQGPR/I2fA==","signatures":[{"sig":"MEQCIEDDcUl0etGUHAC4zKDHRuOBPDmCrfvKuwLg8gCs+5UhAiAaRujxim+Kwub4jGq5OxCppMyYwSdz63sKNbr1q+z3zQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCB9Jq/OMdVARi/rGeTgFVxhOhwJlHzgzS5M5bugTIu+AIgPDyXgCy7J079BFoY8KuZ7FHQ0F3zAMVkIZrceDk0xKI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":340766},"main":"dist/index.js","type":"module","engines":{"node":">=20.10.0"},"gitHead":"b4e24bbcdc9ea400ee407c1f002a14eb364bab49","scripts":{"dev":"tsx watch src/index.ts","test":"vitest run","build":"tsc -p tsconfig.build.json","start":"node dist/index.js","prepare":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"el4cteo","email":"miyabi101@proton.me"},"repository":{"url":"git+https://github.com/EL4CTEO/discord-mcp.git","type":"git"},"_npmVersion":"12.2.1","description":"MCP server that lets AI agents run a Discord bot: messages, DMs, channels, threads, roles, members, moderation, live events and bulk operations.","directories":{},"_nodeVersion":"26.12.1","dependencies":{"zod":"^4.6.7","@discordjs/ws":"^2.0.4","@discordjs/rest":"^2.6.3","discord-api-types":"^0.38.57","@modelcontextprotocol/sdk":"^1.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.15","vitest":"^5.0.5","typescript":"^7.0.2","@types/node":"^26.6.5"},"_npmOperationalInternal":{"tmp":"tmp/discord-mcp_1.2.1_1793210076458_0.8568863422133888","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"_id":"@el4cteo/discord-mcp@1.5.1","bin":{"discord-mcp":"npm/bin/discord-mcp.js"},"bugs":{"url":"https://github.com/EL4CTEO/discord-mcp/issues"},"dist":{"shasum":"a37df22de87cc8ceb62af2fae6bb76bffa8496e0","tarball":"https://registry.npmjs.org/@el4cteo/discord-mcp/-/discord-mcp-1.5.1.tgz","fileCount":5,"integrity":"sha512-vZTjrUuV0AeSops63k9APTEOwApSnk6ERDEDbsCcFvpuyGlrDrYsdAm04Z3Jhh+ExXq7dWtkW21vXlPb471Y/w==","signatures":[{"sig":"MEYCIQDuMZFZkzZaqPCSLHBzyJoyNY5C2d87GAOfSW8NOYNobAIhANLMhy1VaB9ZM3ab38Br4IvyUx2pThZrn04qDD9SVD+o","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAFjGcf3sg45zKwKyjUMBoPHIarX0rDJW2TmC4brSyC7AiBRtAt9zAWxlQijo2rqMwdU+kE9bWmGgxzNccu88IbAqA=="}],"unpackedSize":14440},"name":"@el4cteo/discord-mcp","author":{"name":"EL4CTEO"},"engines":{"node":">=18"},"gitHead":"35a9a95a0c5bfffbbe20288b8c0f0ddd94f1939e","license":"MIT","version":"1.5.1","_npmUser":{"name":"el4cteo","email":"miyabi101@proton.me"},"homepage":"https://github.com/EL4CTEO/discord-mcp#readme","keywords":["mcp","model-context-protocol","discord","discord-bot","claude","claude-code","ai-agent","llm-tools","discord-api","chatops","moderation","anthropic","mcp-server","rust"],"repository":{"url":"git+https://github.com/EL4CTEO/discord-mcp.git","type":"git"},"_npmVersion":"12.2.1","description":"MCP server that lets AI agents run a Discord bot: messages, DMs, channels, threads, roles, members, moderation, live events and bulk operations. Native Rust binary.","directories":{},"maintainers":[{"name":"el4cteo","email":"miyabi101@proton.me"}],"_nodeVersion":"26.12.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"optionalDependencies":{"@el4cteo/discord-mcp-linux-x64":"1.5.1","@el4cteo/discord-mcp-win32-x64":"1.5.1","@el4cteo/discord-mcp-darwin-x64":"1.5.1","@el4cteo/discord-mcp-linux-arm64":"1.5.1","@el4cteo/discord-mcp-darwin-arm64":"1.5.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/discord-mcp_1.5.1_1794933812027_0.6285638805102703"}}},"time":{"created":"2026-09-26T14:46:23.968Z","modified":"2026-11-17T16:43:32.288Z","1.0.0":"2026-09-26T14:46:24.337Z","1.2.0":"2026-10-14T14:23:36.330Z","1.2.1":"2026-10-28T17:54:36.561Z","1.5.1":"2026-11-17T16:43:32.125Z"},"bugs":{"url":"https://github.com/EL4CTEO/discord-mcp/issues"},"author":{"name":"EL4CTEO"},"license":"MIT","homepage":"https://github.com/EL4CTEO/discord-mcp#readme","keywords":["mcp","model-context-protocol","discord","discord-bot","claude","claude-code","ai-agent","llm-tools","discord-api","chatops","moderation","anthropic","mcp-server","rust"],"repository":{"url":"git+https://github.com/EL4CTEO/discord-mcp.git","type":"git"},"description":"MCP server that lets AI agents run a Discord bot: messages, DMs, channels, threads, roles, members, moderation, live events and bulk operations. Native Rust binary.","maintainers":[{"name":"el4cteo","email":"miyabi101@proton.me"}],"readme":"<p align=\"center\">\r\n  <img src=\"assets/logo.svg\" width=\"120\" alt=\"Discord MCP logo\">\r\n</p>\r\n\r\n<h1 align=\"center\">Discord MCP</h1>\r\n\r\n<p align=\"center\">\r\n  Control a Discord bot from Claude Code or any MCP client: messages, channels, roles, members, moderation and live events.\r\n</p>\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://www.npmjs.com/package/@el4cteo/discord-mcp\"><img src=\"https://img.shields.io/npm/v/@el4cteo/discord-mcp?color=5865F2\" alt=\"npm version\"></a>\r\n  <img src=\"https://img.shields.io/badge/Rust-native-DEA584\" alt=\"Rust\">\r\n  <img src=\"https://img.shields.io/badge/platforms-win%20%7C%20linux%20%7C%20macOS-5865F2\" alt=\"Windows, Linux, macOS\">\r\n  <img src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"MIT license\">\r\n</p>\r\n\r\n## Features\r\n\r\n- **38 tools**: messages, DMs, uploads, forwards, polls, channels, threads, forums, members, roles, moderation, AutoMod, scheduled events, emojis, invites and live events\r\n- **Names instead of IDs**: say `\"general\"` or `\"@everyone\"`, never a snowflake\r\n- **Bulk on every tool**: pass an array anywhere a single value goes. `discord_batch` mixes different tools\r\n- **Long messages just work**: text over 2000 characters is split cleanly, and code blocks stay intact\r\n- **Safe by default**: destructive actions stay off until you enable them\r\n- **Hardened against prompt injection**: no admin-grade grants, mass pings, secret-file uploads or internal-network fetches unless you allow them\r\n- **Helpful errors**: every error says *how to fix it*, not just what broke\r\n- **Native and light**: a single Rust binary - instant start, small memory footprint, no Node runtime needed to run it\r\n\r\n## Setup\r\n\r\n1. Create a bot at [discord.com/developers/applications](https://discord.com/developers/applications) -> **New Application** -> **Bot** -> **Reset Token**.\r\n2. On the same Bot page enable **Message Content Intent** and **Server Members Intent**.\r\n3. Invite it to your server via **OAuth2 -> URL Generator** (scopes: `bot`, `applications.commands`).\r\n\r\n## Add to Claude Code\r\n\r\n```bash\r\nclaude mcp add discord --env DISCORD_TOKEN=your_token_here -- npx -y @el4cteo/discord-mcp\r\n```\r\n\r\n`npx` downloads the prebuilt binary for your platform (Windows x64, Linux x64/arm64, macOS x64/arm64).\r\n\r\nOr run the binary directly - from the [releases page](https://github.com/EL4CTEO/discord-mcp/releases), `cargo install --git https://github.com/EL4CTEO/discord-mcp`, or a local build:\r\n\r\n```bash\r\ngit clone https://github.com/EL4CTEO/discord-mcp.git\r\ncd discord-mcp && cargo build --release\r\nclaude mcp add discord --env DISCORD_TOKEN=your_token_here -- /absolute/path/to/discord-mcp/target/release/discord-mcp\r\n```\r\n\r\nRestart Claude Code, then ask it to run `discord_whoami` to check the connection.\r\n\r\n## Configuration\r\n\r\n| Variable | Default | What it does |\r\n|---|---|---|\r\n| `DISCORD_TOKEN` | *required* | Bot token (no `Bot ` prefix) |\r\n| `DISCORD_DEFAULT_GUILD` | - | Default server, so tools can omit `guild` |\r\n| `DISCORD_ALLOW_DESTRUCTIVE` | `false` | Enables ban, kick, timeout, deletes, and granting admin-grade permissions |\r\n| `DISCORD_ALLOW_MASS_MENTIONS` | `false` | Lets messages ping `@everyone` / `@here` |\r\n| `DISCORD_UPLOAD_DIRS` | working dir | Folders local files may be uploaded from (`*` = anywhere) |\r\n| `DISCORD_PRIVILEGED_INTENTS` | `true` | Set `false` if you cannot enable intents in the portal |\r\n| `DISCORD_BATCH_CONCURRENCY` | `4` | Parallel operations per batch |\r\n| `DISCORD_REQUEST_TIMEOUT_MS` | `15000` | Timeout per Discord request |\r\n| `DISCORD_MAX_RESPONSE_CHARS` | `25000` | Response size cap |\r\n| `DISCORD_GATEWAY_IDLE_MS` | `120000` | Idle time before the live connection closes |\r\n| `DISCORD_EVENT_BUFFER` | `200` | Live events kept in memory |\r\n\r\n## Tools\r\n\r\n**Server** - `discord_whoami` `discord_list_guilds` `discord_get_guild` `discord_create_invite`\r\n\r\n**Channels** - `discord_list_channels` `discord_create_channel` `discord_edit_channel` `discord_delete_channel`\\* `discord_manage_thread` `discord_set_channel_permissions` `discord_reorder_channels`\r\n\r\n**Messages** - `discord_send_message` `discord_send_dm` `discord_read_messages` `discord_search_messages` `discord_edit_message` `discord_delete_message`\\* `discord_react` `discord_pin_message` `discord_manage_poll`\r\n\r\n**People** - `discord_list_members` `discord_get_member` `discord_edit_member` `discord_manage_member_roles` `discord_list_roles` `discord_manage_role` `discord_reorder_roles`\r\n\r\n**Moderation** - `discord_moderate_member` `discord_bulk_delete`\\* `discord_list_bans` `discord_get_audit_log` `discord_automod`\r\n\r\n**Community** - `discord_scheduled_events` `discord_manage_emojis` `discord_manage_invites`\r\n\r\n**Live events** - `discord_wait_for_event` `discord_recent_events`\r\n\r\n**Batch** - `discord_batch`\r\n\r\n\\* needs `DISCORD_ALLOW_DESTRUCTIVE=true`, and stays hidden until then. Tools that mix safe and destructive actions (deleting a role, kicking or banning, deleting events, rules, emojis or invites) refuse just the destructive ones.\r\n\r\n## Security\r\n\r\nDiscord messages are written by strangers, and the agent reads them. So the server refuses what an injected instruction would ask for, unless you allow it:\r\n\r\n- **Admin-grade grants**: creating or assigning a role with Administrator, Manage Roles, Ban Members and similar, granting them on a channel, or un-hiding a private channel\r\n- **Mass pings**: `@everyone` / `@here` need `DISCORD_ALLOW_MASS_MENTIONS=true`\r\n- **File uploads**: only from `DISCORD_UPLOAD_DIRS`. Keys, `.env` files, the bot token and private keys are refused, even renamed\r\n- **URL uploads**: only public `http(s)` hosts. Private, loopback and cloud-metadata addresses are blocked, including through redirects and DNS tricks\r\n- **Exact targets**: bans, kicks, timeouts, purges and deletes need the exact name or ID, never a partial match\r\n- **Strict arguments**: a misspelled argument is rejected instead of silently ignored\r\n\r\n## Batch example\r\n\r\n```json\r\n{\r\n  \"operations\": [\r\n    { \"tool\": \"discord_send_message\", \"args\": { \"channel\": \"general\", \"content\": \"Deploy done\" } },\r\n    { \"tool\": \"discord_manage_member_roles\", \"args\": { \"member\": \"alice\", \"add\": [\"Release\"] } }\r\n  ],\r\n  \"defaults\": { \"guild\": \"my server\" }\r\n}\r\n```\r\n\r\nOne failure does not stop the rest - every operation reports its own result.\r\n\r\n## Architecture\r\n\r\n```\r\nsrc/\r\n├─ main.rs           stdio entry point\r\n├─ config.rs         env parsing and validation\r\n├─ server.rs         MCP wiring (rmcp)\r\n├─ rest.rs           Discord REST client, per-bucket rate limiting\r\n├─ gateway.rs        WebSocket (twilight-gateway) - connects lazily, closes when idle\r\n├─ cache.rs          TTL cache for name lookups\r\n├─ resolve.rs        names -> IDs\r\n├─ tools/            one module per capability group, plus catalog.json (the tool schemas)\r\n└─ format.rs, render.rs, text.rs, upload.rs, limiter.rs, permissions.rs\r\n```\r\n\r\nREST handles every action, so startup is instant. The WebSocket only opens when a tool needs live events, and closes again after 2 minutes idle.\r\n\r\n## Bulk operations\r\n\r\nEvery tool that acts on a thing accepts an **array** wherever it accepts one value:\r\n\r\n```jsonc\r\n// one channel\r\n{ \"channel\": \"general\", \"content\": \"hi\" }\r\n\r\n// or fifty, in parallel, from the same tool\r\n{ \"channel\": [\"general\", \"announcements\", \"codes\"], \"content\": \"hi\" }\r\n```\r\n\r\nItems are grouped by rate-limit bucket, run in parallel across buckets, and each reports its own result - so one failure never hides the rest:\r\n\r\n```\r\ndiscord_send_message on 3 items: 2 succeeded, 1 failed.\r\n```\r\n\r\nUse `discord_batch` instead when the calls are *different* tools.\r\n\r\n## Performance\r\n\r\n- **Warm start**: name caches load while the client connects\r\n- **Caches stay fresh**: the server's own edits, and live gateway events, update the caches in place, so nothing needs a refetch\r\n- **Real bulk endpoints**: arrays of message deletes and bans each go out as one request\r\n- **One request for many role changes**: adding or removing several roles on a member is a single call\r\n- **Compact output**: JSON has no indentation, and oversized results are trimmed evenly across items instead of cut off at the end\r\n- **Bucket-aware batching**: calls run in parallel across Discord rate-limit buckets\r\n- **Cancellable**: when the client cancels a call, waits and batches stop, and long batches report their progress\r\n\r\n## Development\r\n\r\n```bash\r\ncargo run          # needs DISCORD_TOKEN in the environment\r\ncargo test         # unit, tool and stdio tests (no Discord account needed)\r\ncargo clippy --all-targets -- -D warnings\r\n```\r\n\r\nReleases: bump the version in `Cargo.toml` and `package.json` (including `optionalDependencies`), then push a `vX.Y.Z` tag. CI builds every platform, attaches the binaries to the GitHub release and publishes to npm.\r\n\r\n## Notes\r\n\r\n- Reading other people's message content needs the **Message Content Intent**.\r\n- Listing all members needs the **Server Members Intent**.\r\n- To assign or moderate a role, the bot's own role must sit **above** it in Server Settings → Roles.\r\n- Bulk delete only works on messages newer than 14 days.\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}