Installation
Installation
Section titled “Installation”discord-mcp ships as a single npm package (@discord-mcp/cli) that bundles the server.
Requirements
Section titled “Requirements”- Node.js 20.11 or newer. The server uses native
fetch, thenode:testrunner 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.
Install with npm
Section titled “Install with npm”npm install -g @discord-mcp/cliInstall with pnpm
Section titled “Install with pnpm”pnpm add -g @discord-mcp/cliInstall with yarn
Section titled “Install with yarn”yarn global add @discord-mcp/cliAfter install, discord-mcp --version should print the package version and discord-mcp --help
should list four subcommands: init, doctor, start, version.
Optional: Gateway mode
Section titled “Optional: Gateway mode”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:
npm install -g discord.jsdiscord-mcp start --gatewayWhen --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.