Skip to main content
Glama
Discord MCP

Discord MCP

by RestartFU

Discord MCP

A Python MCP server for reading messages, inspecting channels and servers, and managing Discord through its REST API. Runs locally over stdio with one environment variable: DISCORD_TOKEN.

The token is sent verbatim in the Authorization header. This server never adds Bot, Bearer, or another prefix. It does not attempt to detect or change the credential type.

Install

Requires Python 3.11+.

git clone https://github.com/RestartFU/discord-mcp.git
cd discord-mcp
python3 -m venv .venv
.venv/bin/pip install .

Configure an MCP client with the absolute path to the installed executable:

{
  "mcpServers": {
    "discord": {
      "command": "/absolute/path/to/discord-mcp/.venv/bin/discord-mcp",
      "env": {
        "DISCORD_TOKEN": "your-token-exactly-as-supplied"
      }
    }
  }
}

On Windows, use .venv\\Scripts\\discord-mcp.exe. You can also supply DISCORD_TOKEN through the parent process environment and omit env. .env files are not loaded automatically. Keep credentials out of source control.

Start by calling get_current_user, then list_guilds, list_channels, and read_messages. Enable Discord Developer Mode to copy IDs, or use the IDs returned by these tools. IDs are strings to preserve precision.

Related MCP server: aki-mcp-sv

Tools

Area

Tools

Identity and servers

get_current_user, get_user, list_guilds, get_guild

Channels

list_channels, get_channel, create_channel, update_channel, delete_channel

Messages

read_messages, get_message, search_messages, send_message, edit_message, delete_message

Reactions and pins

add_reaction, list_pins, pin_message, unpin_message

DMs and threads

create_dm, list_active_threads, create_thread

Members and roles

list_members, get_member, update_member, list_roles, create_role, add_member_role, remove_member_role

Invites

list_invites, create_invite

General REST

discord_request with GET, POST, PUT, PATCH, DELETE, query, JSON body, audit reason, and multipart uploads

discord_request covers other REST operations such as bans, kicks, permission overwrites, webhooks, emojis, scheduled events, archived threads, polls, and role edits. It accepts only API-relative paths under https://discord.com/api/v10; the credential is not forwarded to redirects or arbitrary hosts.

Example: inspect permission overwrites with get_channel, then update one:

{
  "method": "PUT",
  "path": "/channels/CHANNEL_ID/permissions/ROLE_ID",
  "body": {"type": 0, "allow": "1024", "deny": "0"},
  "reason": "Allow the selected role to view this channel"
}

Upload a file by passing files alongside a message body to discord_request:

{
  "method": "POST",
  "path": "/channels/CHANNEL_ID/messages",
  "body": {"content": "Attached note", "allowed_mentions": {"parse": []}},
  "files": [{"filename": "note.txt", "data_base64": "SGVsbG8h", "content_type": "text/plain"}]
}

Uploads are limited to 10 files and 10 MiB total per request. The dedicated send/edit tools suppress mention parsing; the general REST tool uses your payload as supplied.

Access and behavior

This is REST access, not a complete Discord desktop client: no voice/video streaming, Gateway event subscription, or automatic CAPTCHA handling. Operations succeed only where Discord accepts the supplied Authorization value and grants the required permissions. Raw credentials are not guaranteed to work with every endpoint. Discord's documented authentication uses typed Authorization values; this implementation deliberately leaves your supplied value unchanged.

History returns at most 100 messages per request; use the oldest message ID as before for older pages. Server and member lists also support pagination. Search may return an indexing response instead of results. See Discord's message documentation for content access requirements and endpoint fields.

Requests are serialized per process, and 429 rate limits are retried up to three times using Discord's delay. Long waits are returned as errors and retained as a local cooldown. Network errors and 5xx responses are not retried automatically because a write may already have succeeded. Multiple server processes do not share rate-limit state.

The credential is redacted from returned data and API error text. Tool results can still contain private Discord content, invite codes, or webhook credentials; the MCP client receiving them must be trusted. Tool annotations identify reads and destructive operations. The general REST tool is conservatively marked destructive because it can write or delete.

Development

.venv/bin/pip install -e '.[dev]'
.venv/bin/ruff check .
.venv/bin/ruff format --check .
.venv/bin/pytest

Tests use mocked Discord HTTP responses and a real MCP stdio handshake; no Discord token or live messages are required. The implementation uses the official MCP Python SDK, pinned to its 1.x API.

Available Tools

32 tools
add_member_roleA

Assign a server role to a member.

Inputs: role_id (required), user_id (required), guild_id (required).

add_reactionA

React using a Unicode emoji or custom name:id; URL encoding is automatic.

Inputs: emoji (required), channel_id (required), message_id (required).

create_channelA

Create a server channel; data includes name and optional type or permission_overwrites.

Inputs: data (required), guild_id (required).

create_dmB

Open a direct-message channel with a user, subject to Discord permissions.

Inputs: recipient_id (required).

create_inviteB

Create a channel invite; data may include max_age, max_uses and unique.

Inputs: data (required), channel_id (required).

create_roleC

Create a server role using Discord role fields.

Inputs: data (required), guild_id (required).

create_threadC

Start a thread; data includes name, type and optional auto_archive_duration.

Inputs: data (required), channel_id (required).

delete_channelA
Destructive

Delete a channel or close a DM.

Inputs: channel_id (required).

delete_messageB
Destructive

Delete a message where permitted.

Inputs: channel_id (required), message_id (required).

discord_requestA
Destructive

Call any Discord v10 REST endpoint, e.g. /guilds/123/roles.

Covers permissions, roles, moderation, invites, webhooks, emojis, scheduled events, threads, polls, and other REST operations. Supply API-relative path and query separately. Files: [{"filename": "note.txt", "data_base64": "...", "content_type": "text/plain"}]. Total upload limit is 10 MiB. Discord permissions and endpoint limits still apply.

Inputs: path (required), method (required), body, files, +2 more.

edit_messageB
Destructive

Edit an existing message where the credential permits it.

Inputs: content (required), channel_id (required), message_id (required).

get_channelA
Read-only

Inspect channel metadata and permission overwrites.

Inputs: channel_id (required).

get_current_userA
Read-only

Inspect the authenticated Discord account.

Inputs: no named parameters.

get_guildC
Read-only

Inspect server details.

Inputs: guild_id (required).

get_memberA
Read-only

Inspect a server member and their roles.

Inputs: user_id (required), guild_id (required).

get_messageA
Read-only

Read one message.

Inputs: channel_id (required), message_id (required).

get_userB
Read-only

Inspect a user profile.

Inputs: user_id (required).

list_active_threadsA
Read-only

List active server threads accessible to this credential.

Inputs: guild_id (required).

list_channelsC
Read-only

List channels in a server.

Inputs: guild_id (required).

list_guildsB
Read-only

List accessible servers; pass the last ID as after to paginate.

Inputs: after, limit, before.

list_invitesB
Read-only

List server invites where permitted.

Inputs: guild_id (required).

list_membersA
Read-only

List server members, subject to required intents. Paginate with the last user ID.

Inputs: guild_id (required), after, limit.

list_pinsA
Read-only

List the first page of pinned messages; use discord_request with before to paginate.

Inputs: channel_id (required).

list_rolesB
Read-only

List server roles and permissions.

Inputs: guild_id (required).

pin_messageB

Pin a message in its channel.

Inputs: channel_id (required), message_id (required).

read_messagesA
Read-only

Read channel or thread history. Use the oldest message ID as before for older pages.

Only one of before, after, around may be supplied. Discord may omit message content when the credential lacks the required access or intent.

Inputs: channel_id (required), after, limit, around, +1 more.

remove_member_roleB
Destructive

Remove a server role from a member.

Inputs: role_id (required), user_id (required), guild_id (required).

search_messagesB
Read-only

Search server messages with optional channel and author filters.

A 202 indexing response is returned as data; retry later if indexing is not complete.

Inputs: content (required), guild_id (required), limit, offset, +2 more.

send_messageA

Send a message or reply. Mentions do not ping by default.

Use discord_request for attachments, embeds, polls, components, or explicit mentions.

Inputs: content (required), channel_id (required), reply_to.

unpin_messageA
Destructive

Remove a message pin.

Inputs: channel_id (required), message_id (required).

update_channelB
Destructive

Update channel name, topic, permissions, or thread metadata using Discord fields.

Inputs: data (required), channel_id (required).

update_memberB
Destructive

Modify member nickname, roles, timeout, mute, or voice channel using Discord fields.

Inputs: data (required), user_id (required), guild_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 32 tools

    Disambiguation4/5

    Most tools map cleanly to distinct Discord resources (messages, channels, roles, members, guilds). The main ambiguity is discord_request, which overlaps with nearly every other tool by design, but its generic nature is clearly described as a catch-all REST endpoint accessor.

    Naming Consistency4/5

    The vast majority of tools follow a consistent verb_noun pattern: read_messages, delete_message, list_roles, create_channel, get_guild, add_member_role. Minor deviations exist, such as discord_request as a standalone generic tool and get_current_user not matching the list/get style perfectly, but the overall pattern is predictable.

    Tool Count4/5

    32 tools is on the heavier side but justified for a Discord server integration covering messages, channels, members, roles, threads, invites, and reactions. The generic discord_request tool helps keep the count from being even larger, and every tool addresses a concrete Discord operation.

    Completeness4/5

    The surface covers core interaction and moderation workflows well: message lifecycle, channel lifecycle, role assignment, member updates, invites, threads, pins, reactions, and DMs. Notable gaps include no dedicated webhook/emoji/event tools, though discord_request explicitly covers those REST operations, so agents can work around the gap.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Exposes an OAuth-gated suite of 38 tools that let web-based AI chat clients securely operate a local machine, covering files, shell, search, Git, SQLite, browser automation, DevTools, background tasks, localhost services, clipboard, notifications, ports, and Postman. A strict command whitelist and configurable folder allowlist keep that broad local access governed rather than unrestricted.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Exposes 38 OAuth-gated tools over one MCP endpoint so web-based AI clients like Claude, ChatGPT, and Grok can read and edit local files, run whitelisted shell commands, search content, use Git, SQLite, browser automation, DevTools, clipboard, notifications, ports, and background jobs on your own machine. A strict command whitelist and folder restrictions keep the local operating surface governable and safe by default.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables web-based AI chat clients and local IDEs to securely operate a user's own machine through an OAuth-gated MCP endpoint, covering file read/write/edit, whitelisted shell execution, search, read-only Git, SQLite, browser automation, DevTools debugging, background tasks, localhost fetching, ports, clipboard, notifications, and Postman control. Its 38 tools are governed by configurable allowed folders, a strict command whitelist, rate limits, and caller blocking, so remote AI assistants get scoped access without unrestricted shell privileges.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Exposes a governed suite of 38 tools over a single OAuth-gated MCP endpoint, letting web-based AI chat clients read and edit local files, run whitelisted shell commands, search, use Git, inspect SQLite databases, and drive browser, DevTools, clipboard, and background-task workflows. It requires no system-wide install or admin rights and restricts access to folders and commands approved from a local control panel.
      MIT