MCP server exposing the full Discord API to LLM agents — 168 tools: rich messages, interactions, threads, moderation, AutoMod and server config on discord.js
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add discord-mcp -- npx -y @willuhmjs/discord-mcp{
"mcpServers": {
"discord-mcp": {
"command": "npx",
"args": ["-y", "@willuhmjs/discord-mcp"],
"env": {
"DISCORD_TOKEN": "<discord_token>"
}
}
}
}DISCORD_TOKENMCP Servers overview
# discord-mcp
[](https://www.npmjs.com/package/@willuhmjs/discord-mcp)
[](https://github.com/willuhmjs/discord-mcp/actions/workflows/ci.yml)
[](LICENSE)
An MCP server that lets an LLM run a Discord server: **168 tools** for messages, moderation, channels,
roles, threads, events, invites, webhooks, AutoMod and more. Works with Claude, Cursor, VS Code, or any
MCP client.
- **Rich messages**: embeds, Components V2, polls, files, replies — validated before they reach Discord,
with errors that name the bad field.
- **Interactions**: role menus that survive restarts, plus a log of who clicked what.
- **Secure by default**: binds to `127.0.0.1`, SSRF-guarded URL fetching, webhook tokens never echoed.
## Quick start
1. Create a bot in the [developer portal](https://discord.com/developers/applications), invite it to your
server, and enable the **Message Content** intent (*Bot → Privileged Gateway Intents*).
2. Add this to your MCP client's config (`mcp.json`, `claude_desktop_config.json`, `.cursor/mcp.json`, ...):
```json
{
"mcpServers": {
"discord": {
"command": "npx",
"args": ["-y", "@willuhmjs/discord-mcp", "--stdio"],
"env": {
"DISCORD_TOKEN": "your-bot-token",
"DISCORD_GUILD_ID": "your-server-id"
}
}
}
}
```
VS Code uses `"servers"` instead of `"mcpServers"`. On Windows, if the client can't find `npx`, use
`"command": "cmd"` with `"args": ["/c", "npx", "-y", "@willuhmjs/discord-mcp", "--stdio"]`.
**Claude Code** — one command:
```bash
claude mcp add discord -e DISCORD_TOKEN=... -e DISCORD_GUILD_ID=... -- npx -y @willuhmjs/discord-mcp --stdio
```
**Docker** — a long-running HTTP server at `http://127.0.0.1:8085/mcp`:
```bash
docker run --rm -e DISCORD_TOKEN=... -p 127.0.0.1:8085:8085 ghcr.io/willuhmjs/discord-mcp
```
Requires Node.js 22+ for `npx`.
## Configuration
| Variable | Default | Meaning |
|---|---|---|
| `DISCORD_TOKEN` | — (required) | Bot token. |
| `DISCORD_GUILD_ID` | — | Default server for tools when `guildId` is omitted. |
| `ENABLE_MEMBERS_INTENT` | off | Enables the privileged Server Members intent (also enable it in the portal). Member-list tools need it. |
| `MCP_TRANSPORT` | `http` | `stdio` for stdin/stdout. The `--stdio` flag does the same. |
| `HOST` / `PORT` | `127.0.0.1` / `8085` | HTTP bind address and port. |
| `MCP_SOCKET` | — | Listen on a Unix socket instead of `HOST:PORT` (HTTP mode only). |
In HTTP mode, `POST /mcp` serves MCP (stateful sessions via `Mcp-Session-Id`) and `GET /health` returns
`200` once the bot is connected.
## Keeping the HTTP endpoint private
The HTTP endpoint has **no authentication**: anyone who can reach it can use every tool as the bot. Keep it
on loopback or a private network. On a shared machine, other accounts can still reach a loopback port, so
use a Unix socket that only you can open:
```bash
mkdir -m 700 ~/.mcp
MCP_SOCKET=~/.mcp/discord.sock DISCORD_TOKEN=... npx @willuhmjs/discord-mcp
curl --unix-socket ~/.mcp/discord.sock http://localhost/health
```
The socket is created with mode 600. Avoid network file systems such as NFS. The Docker image binds
`0.0.0.0`, so keep that container on an internal network. `stdio` mode has no network exposure at all.
## Tools
Every tool, with its parameters and the Discord permission it needs, is listed in
**[docs/TOOLS.md](https://github.com/willuhmjs/discord-mcp/blob/main/docs/TOOLS.md)**, along with the
conventions (string IDs, JSON-string payloads, `reason` for the audit log) and message/component formats.
## Security
- Every URL a tool fetches (emoji, stickers, files, avatars) goes through one guarded fetcher: http/https
only, private/loopback/metadata IPs blocked before the request and after every redirect, size and
time limits.
- Webhook tokens are credentials: `create_webhook` returns the URL once, and no list/get tool shows it.
- No tool reads the server's filesystem.
## Development
```bash
npm ci
npm run build # tsc -> dist/
npm test # vitest, no Discord token needed
npm run typecheck
```
A contract test locks every tool name and parameter set against `tests/fixtures/tool-contract.json`.
`TESTING.md` is the manual checklist for a run in a real test server.
Releases are automated: commits on `main` using [Conventional Commits](https://www.conventionalcommits.org)
(`feat:`, `fix:`, `feat!:`) feed a release PR; merging it publishes to npm, the MCP Registry and GHCR.
## License
MIT
What people ask about discord-mcp
What is willuhmjs/discord-mcp?
+
willuhmjs/discord-mcp is mcp servers for the Claude AI ecosystem. MCP server exposing the full Discord API to LLM agents — 168 tools: rich messages, interactions, threads, moderation, AutoMod and server config on discord.js It has 0 GitHub stars and its last recorded update is dated 2026-10-03.
How do I install discord-mcp?
+
You can install discord-mcp by cloning the repository (https://github.com/willuhmjs/discord-mcp) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is willuhmjs/discord-mcp safe to use?
+
Our security agent has analyzed willuhmjs/discord-mcp and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains willuhmjs/discord-mcp?
+
willuhmjs/discord-mcp is maintained by willuhmjs. The last recorded GitHub activity is dated 2026-10-03, with 0 open issues.
Are there alternatives to discord-mcp?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy discord-mcp to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/willuhmjs-discord-mcp)<a href="https://claudewave.com/repo/willuhmjs-discord-mcp"><img src="https://claudewave.com/api/badge/willuhmjs-discord-mcp" alt="Featured on ClaudeWave: willuhmjs/discord-mcp" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
The fastest path to AI-powered full stack observability, even for lean teams.