Skip to main content
Glama
discord-mcp

discord-mcp

discord-mcp

A small, dependency-light MCP server that lets AI agents (Claude Code and other MCP clients) post and read in Discord as your own bots. Built for running a "virtual team" where each agent has its own Discord identity.

  • Zero dependencies. Speaks the MCP stdio protocol and Discord's REST API with the Python standard library only, so it runs on any Python 3.8+, including macOS's built-in python3. Your token stays on your machine.

  • Many bots, one server. Every tool takes a bot name and uses <BOT>_DISCORD_TOKEN, so Scout, Analyst and Editor each post under their own name and avatar.

  • Three tools: list_channels, post_message, read_messages.

Setup

  1. Create a bot per agent in the Discord Developer Portal: New Application → Bot → Reset Token (copy it) → turn on Message Content Intent.

  2. Invite it: OAuth2 → URL Generator → scope bot → permissions View Channels, Send Messages, Send Messages in Threads, Read Message History → open the URL and pick your server.

  3. Nothing to install: just clone the repo.

  4. In the folder your agents run from, create .env (see .env.example) and optionally channels.json (see channels.example.json) to name channels.

Related MCP server: discord-mcp

Use with Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "discord": {
      "command": "python3",
      "args": ["/path/to/discord-mcp/server.py"],
      "env": {
        "DISCORD_ENV_FILE": "/path/to/your/project/.env",
        "DISCORD_CHANNELS_FILE": "/path/to/your/project/channels.json",
        "DISCORD_DEFAULT_BOT": "scout"
      }
    }
  }
}

Or register it for all your projects:

claude mcp add discord --scope user \
  -e DISCORD_ENV_FILE=/path/to/your/project/.env \
  -e DISCORD_CHANNELS_FILE=/path/to/your/project/channels.json \
  -- python3 /path/to/discord-mcp/server.py

Then in Claude Code, run /mcp to check it is connected, and ask: "Post 'hello' to newsroom as scout."

Configuration

Variable

Default

Meaning

<BOT>_DISCORD_TOKEN

—

Token for bot <bot> (environment or .env)

DISCORD_ENV_FILE

./.env, then .env next to server.py

Where to read tokens from

DISCORD_CHANNELS_FILE

./channels.json, then next to server.py

Channel aliases, e.g. {"channels": {"newsroom": "123..."}}

DISCORD_DEFAULT_BOT

bot

Bot used when a tool call does not name one

Notes

  • The bots post and read through the REST API; they do not stay online or react instantly. Run your agents on a schedule (or poll) to reply.

  • Keep a human approval step before agents message real people.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables MCP clients to interact with Discord servers, allowing operations such as sending messages and reading message history through the Discord API.
      23
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      MCP server that gives AI agents first-class access to Discord, enabling discovery, messaging, channel management, moderation, and arbitrary REST calls through typed, consent-aware tools.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables an MCP client to inspect and manage Discord through a bot account, including channels, roles, messages, members, and moderation actions.
      1
      MIT