# Discord MCP

Connect a Discord bot to an AI client so an agent can manage server settings and read conversations. Requires your own bot and Node.js 22.12 or later.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 171
- Author: cappyeo
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cappyeo/discord-mcp/tree/HEAD/packages/mcp-server
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/mcp/discord-mcp

## What it does

The server gives an agent tools for Discord messages, channels, roles, moderation, and server setup. It includes 222 typed tools. To build a server from a description, the agent can prepare a plan for review, carry out the approved work, resume an interrupted run, and check the result against Discord.

You need Node.js 22.12 or later and a bot installed in a server you control. After setup, apply the generated configuration to your AI client yourself. Guided `setup` blocks changes by default, while direct `serve` permits ordinary writes. That difference matters before you connect a bot with access to a server.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `DISCORD_TOKEN`, `DISCORD_EXPECTED_BOT_ID`, `ALLOWED_GUILDS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env DISCORD_TOKEN=<DISCORD_TOKEN> --env DISCORD_EXPECTED_BOT_ID=<DISCORD_EXPECTED_BOT_ID> --env ALLOWED_GUILDS=<ALLOWED_GUILDS> --transport stdio mcp-server -- npx -y @discord-mcp/cli
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp-server --env DISCORD_TOKEN=<DISCORD_TOKEN> --env DISCORD_EXPECTED_BOT_ID=<DISCORD_EXPECTED_BOT_ID> --env ALLOWED_GUILDS=<ALLOWED_GUILDS> -- npx -y @discord-mcp/cli
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@discord-mcp/cli"
            ],
            "env": {
                "DISCORD_TOKEN": "<DISCORD_TOKEN>",
                "DISCORD_EXPECTED_BOT_ID": "<DISCORD_EXPECTED_BOT_ID>",
                "ALLOWED_GUILDS": "<ALLOWED_GUILDS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@discord-mcp/cli"
            ],
            "env": {
                "DISCORD_TOKEN": "<DISCORD_TOKEN>",
                "DISCORD_EXPECTED_BOT_ID": "<DISCORD_EXPECTED_BOT_ID>",
                "ALLOWED_GUILDS": "<ALLOWED_GUILDS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DISCORD_TOKEN=<DISCORD_TOKEN> -e DISCORD_EXPECTED_BOT_ID=<DISCORD_EXPECTED_BOT_ID> -e ALLOWED_GUILDS=<ALLOWED_GUILDS> mcp-server npx -y @discord-mcp/cli
```
Replace <…> with your own values

## When to use it
- set up channels and roles on a Discord server
- audit roles and inspect member permissions
- gather channel and thread history with citations
- review a server-change plan and verify the result

## Example prompts
- Draft a Discord server plan with channels and roles, then show me the plan before making changes.
- Audit member access and identify roles with permissions to review.
- Gather the discussion from this channel and its threads, with citations.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74559
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
