cord-mcp
Connects to Discord using official Bot tokens to manage guilds, channels, messages, threads, forums, roles, webhooks, soundboard, scheduled events, stage instances, onboarding, audit logs, and AutoMod, with live Gateway caching and SQLite FTS5 message search/backfill.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cord-mcp connects MCP clients (Claude Desktop, Cursor, VS Code, or custom HTTP/SSE hosts) to Discord using official Discord Bot tokens. Built on a streamlined, Discord API v10-complete hikari core (cord_mcp.discord), it pairs zero-REST Gateway caching with an embedded SQLite WAL + FTS5 BM25 full-text search index so clients can search, summarize, write, and moderate across entire servers in milliseconds.
Why cord-mcp?
77 Tools, 6 Resources & 5 Prompts — Zero Feature Gaps: Covers server discovery, channel trees, client-side effective permission calculation, high-throughput message reading, full-text search, Components V2, embeds, polls, file/text/base64 attachments, message forwarding, threads, forums, roles, webhooks, soundboard, scheduled events, stage instances, onboarding, audit logs, and AutoMod.
Instant Full-Text Search for Discord Bots (
SQLite WAL + FTS5): Discord's official Bot API does not expose a guild-wide/messages/searchendpoint.cord-mcpindexes live Gateway events (MESSAGE_CREATE, partialMESSAGE_UPDATE, reactions, and policy-compliant hard deletes onMESSAGE_DELETE) alongside an incremental multi-page batch backfiller (backfill_channel_messages/backfill_guild_messages) with BM25 ranking across message text, embeds, Components V2TextDisplaytrees, polls, attachment filenames, and forwarded snapshots.Unified
msgspecDiscord API v10 & Native MCP Core: Strips unneeded bot-framework weight (UDP voice/DAVE audio streaming, slash-command webhook HTTP servers, OAuth2 web flows, monetization) and unifies both the Discord v10 engine/cache (cord_mcp.discord) and the MCP server (cord_mcp.mcp) natively onmsgspec.Struct+aiohttp(stdio,streamable-http, andssewith zeroattrs,orjson,pydantic,starlette, oruvicornruntime dependencies).Safe by Default:
@everyone,@here, and@rolementions are blocked on every outbound tool unless explicitly opted into per call.Automatic Gateway intent fallback (
CORD_MCP_INTENTS=auto) gracefully handles close code4014if privileged intents are not enabled in the Discord Developer Portal.Built-in
--read-only(CORD_MCP_READ_ONLY=true) and server allowlisting (CORD_MCP_ALLOWED_GUILDS).All 64-bit Snowflake IDs are accepted and returned as strings to prevent IEEE-754 precision loss in JSON/JavaScript hosts.
Related MCP server: discord-mcp
Architecture
flowchart LR
Host["MCP Host (stdio / HTTP / SSE)"] <--> MCP["cord_mcp.mcp (77 Tools, 6 Resources, 5 Prompts)"]
MCP --> Engine["CordMCPEngine (Guardrails, Backfill, Converters)"]
Engine <--> Cache["GatewayBot + Stateful Cache"]
Engine <--> REST["RESTClient v10 (Rate-Limit Buckets)"]
Engine <--> Store["SQLite WAL + FTS5 BM25 Store"]
Cache -- "Live Create / Edit / Delete Sync" --> Store
REST -- "Auto-Index & Watermark Backfill" --> StoreQuick Start
Option A: Always-On Docker Daemon (recommended for multi-client & 24/7 indexing)
Running cord-mcp as a persistent background container keeps one Discord Gateway connection, rate-limit state, and warm SQLite FTS5 index alive 24/7 so multiple MCP clients can connect instantly over streamable-http:
cp .env.example .env
# Edit .env and set DISCORD_TOKEN (plus optional CORD_MCP_HTTP_BEARER_TOKEN)
docker compose up -dOr run the prebuilt multi-arch image (linux/amd64, linux/arm64) directly from GHCR:
docker run -d --name cord-mcp --restart unless-stopped \
-p 127.0.0.1:8000:8000 \
-v cord-mcp-data:/data \
-e DISCORD_TOKEN="your_bot_token" \
-e CORD_MCP_HTTP_BEARER_TOKEN="your_optional_bearer_secret" \
ghcr.io/rayakame/cord-mcp:latestOption B: Run directly with uvx (stdio, Python 3.15+)
DISCORD_TOKEN="your_bot_token" uvx cord-mcp serveOption C: Install from source with uv
git clone https://github.com/rayakame/cord-mcp.git
cd cord-mcp
uv sync
# Inspect the full MCP surface or verify your bot token
uv run cord-mcp tools
DISCORD_TOKEN="your_bot_token" uv run cord-mcp check-tokenMCP Client Configuration
Connecting to the Docker / Streamable HTTP Daemon
{
"mcpServers": {
"cord-mcp": {
"url": "http://127.0.0.1:8000/mcp",
"headers": {
"Authorization": "Bearer YOUR_OPTIONAL_BEARER_SECRET"
}
}
}
}Claude Desktop / Cursor / VS Code (stdio)
Using uvx (published package):
{
"mcpServers": {
"cord-mcp": {
"command": "uvx",
"args": ["cord-mcp", "serve"],
"env": {
"DISCORD_TOKEN": "YOUR_DISCORD_BOT_TOKEN"
}
}
}
}Or from a local checkout:
{
"mcpServers": {
"cord-mcp": {
"command": "uv",
"args": ["run", "--directory", "/path/to/cord-mcp", "cord-mcp", "serve"],
"env": {
"DISCORD_TOKEN": "YOUR_DISCORD_BOT_TOKEN",
"CORD_MCP_MODE": "gateway",
"CORD_MCP_INTENTS": "auto"
}
}
}
}Read-Only & Guild-Scoped Profile
{
"mcpServers": {
"cord-mcp-readonly": {
"command": "uvx",
"args": ["cord-mcp", "serve", "--read-only"],
"env": {
"DISCORD_TOKEN": "YOUR_DISCORD_BOT_TOKEN",
"CORD_MCP_ALLOWED_GUILDS": "123456789012345678,987654321098765432"
}
}
}
}Standalone Streamable HTTP / SSE Server
DISCORD_TOKEN="YOUR_DISCORD_BOT_TOKEN" cord-mcp serve --transport streamable-http --host 127.0.0.1 --port 8000 --http-bearer-token "YOUR_SECRET"Discord Bot Setup
In the Discord Developer Portal:
Bot -> Privileged Gateway Intents:
Message Content Intent: Required to read and index message content, embeds, and Components V2 across server channels.
Server Members Intent: Recommended for full member caching, role resolution, and thread member details.
Presence Intent: Optional (enables
list_presences;CORD_MCP_INTENTS=autoautomatically negotiates without it if disabled).
Recommended Bot Permissions:
Read & Search:
VIEW_CHANNEL,READ_MESSAGE_HISTORYMessaging & Collaboration:
SEND_MESSAGES,SEND_MESSAGES_IN_THREADS,EMBED_LINKS,ATTACH_FILES,ADD_REACTIONS,SEND_POLLS,CREATE_PUBLIC_THREADS,PIN_MESSAGESAdministration & Moderation:
MANAGE_MESSAGES,MANAGE_CHANNELS,MANAGE_THREADS,MANAGE_ROLES,MANAGE_WEBHOOKS,MANAGE_GUILD_EXPRESSIONS,MANAGE_EVENTS,KICK_MEMBERS,BAN_MEMBERS,MODERATE_MEMBERS,VIEW_AUDIT_LOG,MANAGE_GUILD
Configuration Reference
Environment Variable | CLI Flag | Default | Description |
|
| (required) | Official Discord Bot token ( |
|
|
|
|
|
|
|
|
|
|
| SQLite WAL + FTS5 database path, or |
|
|
| Blocks all write, administrative, and moderation tools when |
|
| (all) | Comma-separated allowlist of Guild Snowflake IDs. |
| — |
| Seconds to wait for initial Gateway handshake ( |
| — |
| Maximum messages fetched from Discord REST in a single backfill call. |
| — |
| Index live Gateway messages, edits, reactions, and deletes into SQLite FTS5. |
| — |
| Index messages fetched or created via REST into SQLite FTS5. |
| — |
| Default |
| — |
| Default |
|
|
|
|
|
|
| Bind address for |
|
| (unset) | Optional |
|
|
| Stderr logging verbosity ( |
CLI Subcommands
cord-mcp serve [options] # Run the MCP server (default command)
cord-mcp tools [--json] # Print all 77 tools, 6 resources, and 5 prompts
cord-mcp stats [--db-path ...] # Inspect local SQLite FTS5 index & channel sync watermarks
cord-mcp check-token [--token ..] # Validate bot token and list accessible guildsDeclarative Components V2 Example
send_message, edit_message, create_forum_post, and execute_webhook accept declarative Components V2 layouts directly and set MessageFlag.IS_COMPONENTS_V2 automatically:
{
"channel_id": "123456789012345678",
"components": [
{
"type": "container",
"accent_color": "#5865F2",
"components": [
{
"type": "section",
"components": [
{ "type": "text_display", "content": "## Release v2.0 Live\nAll systems operational." }
],
"accessory": {
"type": "link_button",
"label": "Changelog",
"url": "https://example.com/changelog"
}
},
{ "type": "separator", "divider": true, "spacing": "small" },
{ "type": "text_display", "content": "- Gateway latency: **18ms**\n- FTS5 index: **ready**" }
]
}
]
}Complete MCP Surface
get_bot_status— Runtime mode, bot user, negotiated Gateway intents, cache metrics, and SQLite FTS5 store stats.list_guilds— Accessible guilds with member, channel, and role counts.get_guild_overview— Full server profile, features, boost tier, vanity URL, and system/rules channels.get_channel_tree— Hierarchical category -> channel -> active thread tree (with optional per-channel bot permissions).get_channel_details— Channel/thread/forum/voice/stage metadata, tags, slowmode, and permission overwrites.get_effective_permissions— Exact Discord API v10 effective permissions for any member (or the bot) at guild or channel/thread scope.list_roles— Guild role hierarchy with colors, flags, and permission bitfields.list_members— List or prefix-search guild members, filter by role, and attach cached presences.get_member_info— Member roles, join/boost timestamps, timeout state, base permissions, presence, and voice state.get_user_info— Global Discord user profile lookup (cache-first, REST fallback).list_presences— Cached online/idle/dnd statuses and rich activities.list_voice_states— Active voice and stage participants across a guild or channel.list_emojis_and_stickers— Custom guild emojis and stickers.list_soundboard_sounds— Guild custom soundboard sounds and/or built-in Discord default sounds.get_guild_widget— Guild widget settings and live public widget data.
get_message— Fetch a single message (embeds, Components V2, poll, attachments, reactions, forwarded snapshots).read_channel_messages— Multi-page chronological message reader (1..1000messages,before/after/around, auto-indexed into FTS5).get_message_context— Surrounding temporal message window (around) plus multi-hop parent reply-chain resolution.list_pinned_messages— Paginated channel pins with pin timestamps (before_isocursor).list_reaction_users— Users who reacted with a Unicode or custom emoji.get_poll_results— Poll answer tallies and per-answer voter lists.search_messages— Local SQLite FTS5 BM25 search ("exact phrases",prefix*,-negation, diacritic-aware, punctuation-safe) with structured filters (guild_id,channel_ids,author_ids,exclude_author_ids,include_bots,mentions_user_id,mentions_role_id,reply_to_id,before/after,is_pinned,has_attachments,has_embeds,has_links,has_poll,has_components,is_forwarded, andauto_backfill_if_empty).backfill_channel_messages— Incremental, backward, or full batch backfill of a channel/thread into SQLite FTS5.backfill_guild_messages— Guild-wide backfill across readable channels and active threads.get_message_store_stats— SQLite FTS5 index counts, DB size, and per-channel sync watermarks.
send_message— Send markdown, replies, embeds, file/text/base64/URL attachments, polls, stickers, or Components V2 layouts with safe-mention defaults.forward_message— Forward any message (MessageReferenceType.FORWARD) to another channel or thread.edit_message— Edit bot messages (content, embeds, Components V2 preservingIS_COMPONENTS_V2, attachments).delete_message/bulk_delete_messages— Delete single or bulk (<14days) messages with auditreasonand automatic FTS5 purge.pin_message/unpin_message— Pin or unpin messages with auditreason.add_reaction/remove_reaction/clear_reactions— Manage Unicode and custom<:name:id>reactions.end_poll— Immediately expire/finalize an active poll authored by the bot.trigger_typing— Trigger the channel typing indicator.crosspost_message— Publish announcement (GUILD_NEWS) messages to following servers.
create_channel/edit_channel/delete_channel/reorder_channels— Full lifecycle for text, announcement, voice, stage, category, forum, and media channels.set_channel_permission_overwrite/delete_channel_permission_overwrite— Role and member permission overwrites (accepting both Hikari and Discord API permission names).list_threads/create_thread/edit_thread— Active and archived threads, standalone or message-attached creation, archiving, locking, and pinning (ChannelFlag.PINNED).create_forum_post— Forum and media post creation with case-insensitive tag name/ID resolution, embeds, Components V2, attachments, or polls.list_thread_members/manage_thread_membership— Inspect thread members or join/leave/add/remove users.
edit_guild— Server name, description, verification/filter levels, and system/rules/AFK channels.create_role/edit_role/delete_role/update_member_roles— Role CRUD, hierarchy reordering, and member role assignment.manage_custom_emoji/manage_guild_sticker/manage_soundboard— Custom server expressions and soundboard CRUD + playback.list_webhooks/manage_webhook/execute_webhook— Webhook CRUD and rich execution (custom persona, thread targeting, Components V2, embeds, polls, safe mentions).list_invites/manage_invite— Invite inspection, creation (includingtarget_user_idsandrole_ids), and deletion.list_scheduled_events/manage_scheduled_event— Stage, voice, and external scheduled event management and subscriber lists.manage_stage_and_onboarding— Live Stage Instance CRUD and Guild Onboarding prompt/mode management.
kick_member/ban_member/bulk_ban_members/unban_user/list_bans— Single and atomic bulk moderation (bulk_ban_usersup to 200 users) withX-Audit-Log-Reason.timeout_member— Apply or clear communication timeouts.edit_member_moderation— Nicknames, server voice mute/deaf states, and voice channel move/disconnect.prune_inactive_members— Dry-run prune estimation (dry_run=Truedefault) or execution.read_audit_logs— Paginated guild audit log reader with actor andAuditLogEventTypefiltering.list_automod_rules/manage_automod_rule— AutoMod rule CRUD across keyword, regex, preset, mention-spam, and member-profile triggers and all action types.
Resources:
discord://statusdiscord://guildsdiscord://guilds/{guild_id}/overviewdiscord://guilds/{guild_id}/channelsdiscord://channels/{channel_id}/recentdiscord://channels/{channel_id}/pins
Prompts:
summarize_channel_activityinvestigate_moderation_incidentaudit_server_permissionssearch_server_knowledgedraft_rich_announcement
Development
See CONTRIBUTING.md for the full contributor and release guide.
uv sync --group dev
uv run --group nox noxLicense
MIT — Copyright (c) 2026 Rayakame, incorporating derived components from hikari-py/hikari under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
Manage a Discord server from Claude, ChatGPT or any MCP client. Sign in with Discord, no bot token.
One connector for 15,000+ MCP servers plus your team's private MCPs, from any AI client.
- Discortics - Discord BotDeprecatedcom.discortics
Set up and manage your Discord server from MCP: channels, roles, verification, tickets and security.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Discord using personal user tokens instead of bot applications, allowing for seamless message management and server exploration. It provides tools for reading history, sending messages, and searching across channels and DMs directly through MCP-compatible clients.12MIT
- AlicenseBqualityDmaintenanceEnables MCP clients to interact with Discord servers, allowing operations such as sending messages and reading message history through the Discord API.23MIT
- AlicenseNot gradedqualityFmaintenanceMCP server that gives AI agents first-class access to Discord, enabling discovery, messaging, channel management, moderation, and arbitrary REST calls through typed, consent-aware tools.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to control a logged-in Discord account through 70+ tools: browsing guilds and channels, sending and reacting to messages, moderating members, managing channels, roles, emojis, and webhooks, plus searching and analyzing captured message history stored in SQLite. Authenticates using tokens already cached by the local Discord client, requiring no bot account or manual token setup.MIT