Guides

How to Connect Claude to Discord

Give Claude access to your Discord servers, channels and DMs: run discord-mcp with Docker, expose it via HTTPS and add it to Claude as a custom connector.

In short

Claude talks to other services through MCP servers. For Discord I use my own, discord-mcp. It runs as a Docker container, signs in with your Discord account and gives Claude access to your servers, channels and direct messages. Read-only by default.

In five steps:

  1. start discord-mcp with Docker
  2. make it reachable from the internet via HTTPS
  3. lock down access
  4. add it to Claude as a custom connector
  5. test it

After that you can ask Claude things like: "Summarise the messages of the last 24 hours in #general."

Warning

discord-mcp works with a regular user account, not a bot. Discord calls that a "self-bot", and it breaks the Terms of Service. Discord may ban the account. Ideally, use a separate account for it.

Why a user account and not a bot?

A bot only sees the servers someone with the right permissions has invited it to, and none of your own direct messages. I wanted Claude to see exactly what I see in Discord: all my servers, channels and DMs. That only works with your own account. The risk above is the price for it.

What you need

  • a server with Docker that is reachable from the internet
  • a domain or subdomain with a TLS certificate, e.g. behind a reverse proxy such as Nginx Proxy Manager
  • the credentials of your Discord account and, if you use two-factor authentication, the secret of your authenticator app

1. Start discord-mcp

Create a compose.yaml:

services:
  mcp-discord:
    image: ghcr.io/dasred/discord-mcp:1
    restart: unless-stopped
    shm_size: 256m
    security_opt:
      - no-new-privileges:true
    environment:
      DISCORD_MCP_DISCORD_EMAIL: ${DISCORD_EMAIL}
      DISCORD_MCP_DISCORD_PASSWORD: ${DISCORD_PASSWORD}
      DISCORD_MCP_DISCORD_TOTP_SECRET: ${DISCORD_TOTP_SECRET}
      DISCORD_MCP_READ_ONLY: 'true'
    volumes:
      - ./data:/var/www/data
    ports:
      - '127.0.0.1:3000:3000'

The credentials go into a .env next to it, not into the file itself. The data folder must be writable for the user node:

mkdir -p data && sudo chown 1000:1000 data
docker compose up -d
curl http://localhost:3000/healthz

The volume matters: it holds the Discord session. Without it, every restart needs a new login, and frequent logins from a server IP get Discord's attention. The first login only happens on the first tool call and can take up to two minutes.

Tip

If Discord asks for a captcha when the server logs in, you can take the session token from your browser instead and set it as DISCORD_MCP_DISCORD_TOKEN. How that works is described under Configuration.

2. Make it reachable via HTTPS

Custom connectors in Claude connect from Anthropic's servers, not from your machine. A URL that only works in your home network is not enough. Add a host to your reverse proxy, e.g. discord.mcp.example.com, that points to port 3000 of the container, with a TLS certificate.

The MCP endpoint is then https://discord.mcp.example.com/mcp.

3. Lock down access

Anyone who reaches /mcp can read your messages. Claude's connectors cannot send custom headers, so a bearer token does not help for the Claude apps. Protect the host at the reverse proxy with an IP allowlist instead: only Anthropic's outbound IP addresses and your own network.

4. Add it to Claude

  1. In Claude, open Settings → Connectors → Add custom connector.
  2. Name: e.g. Discord.
  3. URL: https://discord.mcp.example.com/mcp
  4. Save.

For Claude Code there is a command. There you can also send a bearer token if DISCORD_MCP_AUTH_TOKEN is set on the server:

claude mcp add --transport http discord https://discord.mcp.example.com/mcp \
  --header "Authorization: Bearer your-mcp-auth-token"

5. Test it

Ask Claude, for example:

  • "Which Discord servers am I on?"
  • "Summarise the messages of the last 24 hours in #general."
  • "Did anyone send me a direct message?"

Claude calls get_servers, get_channels, read_messages or get_direct_messages for this.

Should Claude write as well?

With DISCORD_MCP_READ_ONLY=false the tool send_message is added. Claude then writes in your name, and nobody can tell that the message came from Claude. In Claude's connector settings, make Claude always ask before send_message. Deleting, editing or reactions are deliberately not available.

If it doesn't work

Symptom Cause
The connector does not connect The server is not publicly reachable, or the reverse proxy blocks Anthropic's IPs.
405 Method not allowed Normal for a GET in the browser. The server only accepts POST on /mcp.
A tool reports a login error Wrong credentials, missing TOTP secret, or Discord wants a captcha.
send_message is missing DISCORD_MCP_READ_ONLY is true, so read-only.
New tools don't show up Disconnect the connector in Claude once and connect it again to reload the tool list.

Everything else is in the discord-mcp docs, the background in my article about four MCP servers in nine days.