Skip to content

Installation

discord-mcp ships as a single npm package (@discord-mcp/cli) that bundles the server.

  • Node.js 20.11 or newer. The server uses native fetch, the node:test runner in CI, and the AsyncLocalStorage shape stabilized in 20.11.
  • A Discord bot token with the appropriate scopes for the tools you call.

Check your Node version with node --version. If you’re below 20.11, upgrade via fnm, nvm, volta, or your OS package manager.

Terminal window
npm install -g @discord-mcp/cli
Terminal window
pnpm add -g @discord-mcp/cli
Terminal window
yarn global add @discord-mcp/cli

After install, discord-mcp --version should print the package version and discord-mcp --help should list four subcommands: init, doctor, start, version.

The default transport is REST-only — every tool call hits the Discord HTTP API. For real-time events (message creation, presence updates, voice state changes), discord-mcp can subscribe to the Gateway WebSocket via discord.js.

discord.js is declared as an optionalDependency so REST users do not pay for it. To enable Gateway:

Terminal window
npm install -g discord.js
discord-mcp start --gateway

When --gateway is set, the server lazy-imports discord.js, opens a Gateway connection, and exposes resource subscriptions (presences, voice_states, messages live feeds). See Architecture → Gateway for the full integration model.