home / mcp / discord mcp server

Discord MCP Server

A MCP server for the Discord integration. Enable your AI assistants to seamlessly interact with Discord. Enhance your Discord experience with powerful automation capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "saseq-discord-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "DISCORD_TOKEN=<YOUR_DISCORD_BOT_TOKEN>",
        "-e",
        "DISCORD_GUILD_ID=<OPTIONAL_DEFAULT_SERVER_ID>",
        "saseq/discord-mcp:latest"
      ],
      "env": {
        "DISCORD_TOKEN": "<YOUR_DISCORD_BOT_TOKEN>",
        "DISCORD_GUILD_ID": "<OPTIONAL_DEFAULT_SERVER_ID>"
      }
    }
  }
}

This MCP server enables a Model Context Protocol integration with the Discord API, letting your AI assistants manage channels, send messages, and retrieve server data through MCP-compatible clients. It streamlines interactions between AI tools and Discord, enabling automated workflows and enhanced bot capabilities.

How to use

You can connect a Discord MCP server to your MCP client or AI assistant by configuring the MCP endpoint to run the server via Docker. Use the provided token and optional guild ID to initialize and target a specific Discord server.

How to install

Prerequisites: You need Docker installed on your machine to run the MCP server in a container.

{
  "mcpServers": {
    "mcp-server": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "DISCORD_TOKEN=<YOUR_DISCORD_BOT_TOKEN>",
        "-e", "DISCORD_GUILD_ID=<OPTIONAL_DEFAULT_SERVER_ID>",
        "saseq/discord-mcp:latest"
      ]
    }
  }
}

If you prefer a manual setup without Docker, you can build and run the server from source. First clone the repository, build the project, and then run the generated JAR with your Discord bot token.

# Clone the repository
git clone https://github.com/SaseQ/discord-mcp

# Build the project (requires Maven)
cddiscord-mcp
mvn clean package

# Run the server with your Discord bot token
java -jar /absolute/path/to/discord-mcp-0.0.1-SNAPSHOT.jar

Configuration notes

The Discord MCP server accepts configuration via environment variables when using Docker. Set DISCORD_TOKEN to your bot token and optionally set DISCORD_GUILD_ID to establish a default server for tools that require a guildId.

{
  "mcpServers": {
    "discord-mcp": {
      "command": "java",
      "args": [
        "-jar",
        "/absolute/path/to/discord-mcp-0.0.1-SNAPSHOT.jar"
      ],
      "env": {
        "DISCORD_TOKEN": "YOUR_DISCORD_BOT_TOKEN",
        "DISCORD_GUILD_ID": "OPTIONAL_DEFAULT_SERVER_ID"
      }
    }
  }
}

Security and notes

Keep your Discord bot token secure and do not share it publicly. If you provide a default guild ID, tools that require a guildId can omit it, but you can always override it per tool usage.

Examples

You can use the MCP server to fetch server information, manage channels, and send messages from your AI workflows. For instance, you can create text channels, send messages to a channel, or manage roles and webhooks through the available tool endpoints.

Available tools

get_server_info

Get detailed information about the connected Discord server, including its channels, members, and settings.

get_user_id_by_name

Return a user ID by username within a guild to enable user mentions like <@id>.

send_private_message

Send a direct message to a specific Discord user.

edit_private_message

Edit a private message sent to a user.

delete_private_message

Delete a private message from a user.

read_private_messages

Read recent private messages from a specific user.

send_message

Post a message to a specified text channel.

edit_message

Edit a message in a specific channel.

delete_message

Delete a message from a channel.

read_messages

Read recent messages from a channel.

add_reaction

Add a reaction to a specific message.

remove_reaction

Remove a reaction from a message.

create_text_channel

Create a new text channel in the server.

delete_channel

Remove a channel from the server.

find_channel

Find a channel by name and server ID.

list_channels

List all channels in the server.

create_category

Create a new category to organize channels.

delete_category

Delete a channel category.

find_category

Find a category ID by name and server ID.

list_channels_in_category

List channels within a specific category.

create_webhook

Create a webhook on a channel.

delete_webhook

Delete a webhook.

list_webhooks

List webhooks on a channel.

send_webhook_message

Send a message via a webhook.

list_roles

Retrieve a list of all roles on the server.

create_role

Create a new role on the server.

edit_role

Modify an existing role's settings.

delete_role

Permanently delete a role from the server.

assign_role

Assign a role to a user.

remove_role

Remove a role from a user.