discord-mcp
v2.7.0Run your Discord from Claude, Codex, Cursor or VS Code: messages, moderation, roles, forums, events
Has high-severity static-analysis findings pending human review.
Values you need
| Variable | What it is | |
|---|---|---|
DISCORD_TOKEN | required secret | Discord bot token |
DISCORD_MCP_TOOLSETS | optional | Comma-separated toolsets to expose: discovery, messages, channels, permissions, members, roles, moderation, screening, stats, forums, webhooks, scheduled_events, invites, dm, polls, or all. An unknown name stops the server at startup. Default: all |
DISCORD_MCP_READ_ONLY | optional | Set to true to expose only the read-only tools of the selected toolsets: write tools are neither listed nor callable. Any value other than true/false, 1/0, yes/no or on/off stops the server at startup. Default: false |
DISCORD_MCP_CONFIRM | optional | Set to false to stop asking the user to confirm a dry_run: false call to the six tools that preview by default. The server asks only over stdio, and only a client that supports form elicitation. Any value other than true/false, 1/0, yes/no or on/off stops the server at startup. Default: true |
DISCORD_ALLOWED_GUILDS | optional | Comma-separated guild IDs the server may act on. Calls that target any other guild are rejected, and the DM tools refuse a user who is not a member of any listed guild. Unset allows every guild. |
DISCORD_MESSAGE_CONTENT | optional | Set to false to stop requesting the Message Content privileged intent at connect time. Default: true |
DISCORD_GUILD_MEMBERS | optional | Set to false to stop requesting the Server Members privileged intent at connect time. Default: true |
DISCORD_MCP_TRANSPORT | optional | stdio, or http to serve Streamable HTTP on /mcp for remote clients such as the OpenAI Responses API, Codex or n8n. Any other value stops the server at startup. Default: stdio |
DISCORD_MCP_HTTP_TOKEN | optional secret | Bearer token every HTTP request must carry. Required when DISCORD_MCP_TRANSPORT is http: at least 32 characters from the RFC 6750 b64token alphabet, different from DISCORD_TOKEN. Generate one with openssl rand -hex 32. |
DISCORD_MCP_HTTP_HOST | optional | Address the HTTP server listens on when DISCORD_MCP_TRANSPORT is http. Keep 127.0.0.1 outside a container. In the Docker image, set 0.0.0.0, since 127.0.0.1 is unreachable from outside the container, and publish the port on the host loopback only: -p 127.0.0.1:3000:3000. Default: 127.0.0.1 |
DISCORD_MCP_HTTP_PORT | optional | Port the HTTP server listens on when DISCORD_MCP_TRANSPORT is http. Default: 3000 |
DISCORD_MCP_HTTP_ALLOWED_HOSTS | optional | Comma-separated hostnames, without port, accepted in the Host header of HTTP requests besides localhost, 127.0.0.1 and [::1], such as the public name a reverse proxy forwards. |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add discord-mcp -e 'DISCORD_TOKEN=<DISCORD_TOKEN>' -- npx -y @pasympa/discord-mcp@2.6.2Add to
claude_desktop_config.json{
"mcpServers": {
"discord-mcp": {
"args": [
"-y",
"@pasympa/discord-mcp@2.6.2"
],
"command": "npx",
"env": {
"DISCORD_TOKEN": "<DISCORD_TOKEN>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"discord-mcp": {
"args": [
"-y",
"@pasympa/discord-mcp@2.6.2"
],
"command": "npx",
"env": {
"DISCORD_TOKEN": "<DISCORD_TOKEN>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "DISCORD_TOKEN",
"id": "discord-token",
"password": true,
"type": "promptString"
}
],
"servers": {
"discord-mcp": {
"args": [
"-y",
"@pasympa/discord-mcp@2.6.2"
],
"command": "npx",
"env": {
"DISCORD_TOKEN": "${input:discord-token}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.discord-mcp]
command = "npx"
args = ["-y", "@pasympa/discord-mcp@2.6.2"]
env = { "DISCORD_TOKEN" = "<DISCORD_TOKEN>" }Docker
Requires Docker
Run in a terminal
claude mcp add discord-mcp -e 'DISCORD_TOKEN=<DISCORD_TOKEN>' -- docker run -i --rm -e DISCORD_TOKEN docker.io/pasympa/discord-mcp:2.6.2Add to
claude_desktop_config.json{
"mcpServers": {
"discord-mcp": {
"args": [
"run",
"-i",
"--rm",
"-e",
"DISCORD_TOKEN",
"docker.io/pasympa/discord-mcp:2.6.2"
],
"command": "docker",
"env": {
"DISCORD_TOKEN": "<DISCORD_TOKEN>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"discord-mcp": {
"args": [
"run",
"-i",
"--rm",
"-e",
"DISCORD_TOKEN",
"docker.io/pasympa/discord-mcp:2.6.2"
],
"command": "docker",
"env": {
"DISCORD_TOKEN": "<DISCORD_TOKEN>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "DISCORD_TOKEN",
"id": "discord-token",
"password": true,
"type": "promptString"
}
],
"servers": {
"discord-mcp": {
"args": [
"run",
"-i",
"--rm",
"-e",
"DISCORD_TOKEN",
"docker.io/pasympa/discord-mcp:2.6.2"
],
"command": "docker",
"env": {
"DISCORD_TOKEN": "${input:discord-token}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.discord-mcp]
command = "docker"
args = ["run", "-i", "--rm", "-e", "DISCORD_TOKEN", "docker.io/pasympa/discord-mcp:2.6.2"]
env = { "DISCORD_TOKEN" = "<DISCORD_TOKEN>" }For AI agents
- Ask the user for: DISCORD_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: discord_list_guilds, discord_get_guild_info, discord_list_channels, discord_find_channel_by_name, discord_read_messages, discord_send_message, discord_reply_message, discord_edit_message, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json