discord-mcp-server

discord-mcp-server

Lets any MCP-compatible AI client interact with Discord โ€” send messages, manage channels, create webhooks, assign roles, and more.

Category
Visit Server

README

<p align="center"> <h1 align="center">discord-mcp-server</h1> <p align="center"> A Model Context Protocol (MCP) server that exposes Discord operations as tools for AI assistants. </p> <p align="center"> <a href="https://www.npmjs.com/package/@ncodelife/discord-mcp-server"><img src="https://img.shields.io/npm/v/@ncodelife/discord-mcp-server.svg" alt="npm version"></a> <a href="https://github.com/ngoctranfire/discord-mcp-server/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@ncodelife/discord-mcp-server.svg" alt="license"></a> <a href="https://smithery.ai/server/discord-mcp-server"><img src="https://smithery.ai/badge/discord-mcp-server" alt="Smithery"></a> </p> </p>


What is this?

discord-mcp-server lets any MCP-compatible AI client (Claude Desktop, Cursor, Windsurf, etc.) interact with Discord โ€” send messages, manage channels, create webhooks, assign roles, and more.

Built with Bun, FastMCP, and discord.js.

Features

Category Tools
๐Ÿ  Server Info list_servers, get_server_info
๐Ÿ“ข Channels list_channels, find_channel, create_text_channel, create_voice_channel, delete_channel, create_category, list_categories, move_channel
๐Ÿ’ฌ Messages send_message, read_messages, edit_message, delete_message, add_reaction, remove_reaction
๐Ÿ”— Webhooks list_webhooks, create_webhook, delete_webhook, send_webhook_message, edit_webhook
๐ŸŽญ Roles list_roles, create_role, edit_role, delete_role, assign_role, remove_role
๐Ÿงต Threads list_threads, create_thread, reply_to_thread, get_thread

31 tools covering the most common Discord operations. Forum posts are supported via create_thread.

Prerequisites

  1. Bun (v1.0.0+) โ€” Install Bun
  2. Discord Bot Token โ€” Create one here

Creating a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click New Application โ†’ give it a name
  3. Go to Bot โ†’ click Reset Token โ†’ copy the token
  4. Under Privileged Gateway Intents, enable:
    • โœ… Message Content Intent
    • โœ… Server Members Intent
  5. Go to OAuth2 โ†’ URL Generator
    • Scopes: bot
    • Bot Permissions: Administrator (or cherry-pick permissions)
  6. Copy the generated URL and open it to invite the bot to your server

Quick Start

Option 1: npx (recommended)

npx @ncodelife/discord-mcp-server --token YOUR_BOT_TOKEN

Option 2: Install globally

npm install -g @ncodelife/discord-mcp-server
discord-mcp-server --token YOUR_BOT_TOKEN

Option 3: Docker

docker build -t discord-mcp-server .
docker run -e DISCORD_TOKEN=YOUR_BOT_TOKEN discord-mcp-server

MCP Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "discord": {
      "command": "npx",
      "args": ["@ncodelife/discord-mcp-server", "--token", "YOUR_BOT_TOKEN"]
    }
  }
}

Cursor / Windsurf

Add to your MCP settings:

{
  "discord": {
    "command": "npx",
    "args": ["@ncodelife/discord-mcp-server", "--token", "YOUR_BOT_TOKEN"]
  }
}

Smithery

Smithery Badge

Install via Smithery for automatic configuration.

Configuration

Option CLI Flag Env Variable Default
Bot Token --token DISCORD_TOKEN required
Default Guild ID --guild-id DISCORD_GUILD_ID โ€”
Transport --transport MCP_TRANSPORT stdio
HTTP Port --port MCP_PORT 8080

Using a .env file

DISCORD_TOKEN=your-bot-token-here
DISCORD_GUILD_ID=your-server-id

Transport Modes

stdio (default)

Standard I/O transport โ€” used by Claude Desktop, Cursor, and most MCP clients.

discord-mcp-server --token YOUR_TOKEN

HTTP Stream

For web-based integrations and remote access:

discord-mcp-server --token YOUR_TOKEN --transport http --port 8080

Note on build targets: The npm package is built with --target node so npx works everywhere. The Docker image uses --target bun for native Bun performance. Both are fully functional.

Development

# Clone the repo
git clone https://github.com/ngoctranfire/discord-mcp-server.git
cd discord-mcp-server

# Install dependencies
bun install

# Run in development
bun run dev

# Type-check
bun run typecheck

# Lint
bun run lint

# Test with MCP Inspector
bun run inspect

Architecture

src/
โ”œโ”€โ”€ index.ts          # Entry point โ€” FastMCP server setup
โ”œโ”€โ”€ config.ts         # CLI args + env var merging
โ”œโ”€โ”€ discord.ts        # Discord.js client factory
โ”œโ”€โ”€ utils.ts          # Shared utilities (error handling, formatting)
โ””โ”€โ”€ tools/
    โ”œโ”€โ”€ server-info.ts  # Server listing & details
    โ”œโ”€โ”€ channels.ts     # Channel CRUD operations
    โ”œโ”€โ”€ messages.ts     # Message send/read/edit/delete + reactions
    โ”œโ”€โ”€ webhooks.ts     # Webhook management
    โ”œโ”€โ”€ roles.ts        # Role CRUD + assignment
    โ””โ”€โ”€ threads.ts      # Thread & forum operations

Contributing

See CONTRIBUTING.md for guidelines on setup, development, and submitting pull requests.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured