discord-mcp

v2.7.0
io.github.PaSympa/discord-mcp Checked 10 hours ago Published 8 hours ago

Run 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

VariableWhat it is
DISCORD_TOKENrequired secret Discord bot token
DISCORD_MCP_TOOLSETSoptional 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_ONLYoptional 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_CONFIRMoptional 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_GUILDSoptional 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_CONTENToptional Set to false to stop requesting the Message Content privileged intent at connect time. Default: true
DISCORD_GUILD_MEMBERSoptional Set to false to stop requesting the Server Members privileged intent at connect time. Default: true
DISCORD_MCP_TRANSPORToptional 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_TOKENoptional 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_HOSToptional 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_PORToptional Port the HTTP server listens on when DISCORD_MCP_TRANSPORT is http. Default: 3000
DISCORD_MCP_HTTP_ALLOWED_HOSTSoptional 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.2
Add 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.2
Add 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

  1. Ask the user for: DISCORD_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. 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).
  3. Restart or reload the client so it starts the server.
  4. 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, ….
  5. 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