discord
A Model Context Protocol (MCP) server for Discord integration - enables AI models to interact with Discord through secure authentication, message management, and content moderation.
claude mcp add --transport stdio reesavgupta-discord-mcp-server ./bin/discord-mcp-server -config configs/config.yaml \ --env API_KEY_1="Primary API key for access" \ --env API_KEY_2="Optional additional API key" \ --env JWT_SECRET="JWT signing secret" \ --env LOGGING_LEVEL="Logging level (e.g., info, debug)" \ --env LOGGING_FORMAT="Logging format (e.g., json, text)" \ --env DISCORD_GUILD_ID="Discord guild/server ID" \ --env DISCORD_BOT_TOKEN="Discord bot token"
How to use
This Discord MCP Server implements the Model Context Protocol (MCP) to expose a standardized JSON-RPC 2.0 interface for interacting with Discord. It enables automated moderation, message handling, channel information retrieval, and search capabilities via built-in tools. Clients communicate over stdio when paired with Claude Desktop or other MCP-compatible clients, issuing RPC calls to perform actions such as sending messages, fetching history, and moderating content. The server supports multi-tenancy, authentication with JWTs and API keys, and configurable logging for observability. To get started, configure your Discord bot token and guild, provide authentication credentials, and run the binary with the provided config file. You can then invoke MCP tools such as send_message, get_messages, get_channel_info, search_messages, and moderate_content through the JSON-RPC interface.
How to install
Prerequisites:
- Go toolchain installed (go 1.20+ recommended)
- Git
- A Discord bot token and guild ID
- Optional: TLS/SSL setup if exposing RPC externally
-
Clone the repository: git clone https://github.com/yourusername/discord-mcp-server.git cd discord-mcp-server
-
Install dependencies and build the server (Go typically handles dependencies via go mod during build): make deps # if the project defines a deps target make build # builds the binary and places it under bin/ (as per README root example)
-
Prepare configuration:
- Copy example config and edit with your values:
cp configs/config.yaml.example configs/config.yaml
or edit configs/config.yaml directly
- Copy example config and edit with your values:
cp configs/config.yaml.example configs/config.yaml
-
Run the server: ./bin/discord-mcp-server -config configs/config.yaml
-
Optional: set environment variables (recommended to use a .env file or system env vars): export DISCORD_BOT_TOKEN=your-bot-token export DISCORD_GUILD_ID=your-guild-id export JWT_SECRET=your-jwt-secret export API_KEY_1=your-api-key export API_KEY_2=optional-key
-
Verify operation by checking logs and using a Claude Desktop client or any MCP client to issue RPC calls.
Additional notes
Notes and tips:
- The server uses YAML-based configuration with environment variable overrides; see configs/config.yaml for structure.
- For security, avoid committing secrets; use environment variables or secret management.
- Authentication can use JWTs and API keys; enable audit logging if you need activity trails.
- Logging supports JSON or text formats and can be written to a file or stdout. Set logging.level (e.g., info, debug) to control verbosity.
- If you run multiple Discord bots/servers, extend the mcpServers map with additional entries (each with its own config and env).
- When debugging, set logging.level to debug in the config and review the logs for RPC requests, errors, and moderation actions.
Related MCP Servers
jetski
Authentication, analytics, and prompt visibility for MCP servers with zero code changes. Supports OAuth2.1, DCR, real-time logs, and client onboarding out of the box
discord
A MCP server for the Discord integration. Enable your AI assistants to seamlessly interact with Discord. Enhance your Discord experience with powerful automation capabilities.
gtm
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.
mcp-client-gen
Turn any MCP server into a type-safe TypeScript SDK in seconds - with OAuth 2.1 and multi-provider support
discord
An MCP server for interacting with Discord
miro
MCP server for controlling Miro whiteboards with AI assistants