|
Full Discord API v10 Surface 77 tools, 6 resources, and 5 prompts covering channels, threads, forums, Components V2, polls, roles, webhooks, events, audit logs, and AutoMod. |
Millisecond Message Search Discord's Bot API has no guild search endpoint. cord-mcp indexes live and historical messages locally with SQLite FTS5.
|
|
Bot, User, or OAuth2 Token Run as a bot, as your own account, or with an OAuth2 access token. The token type is detected automatically. |
Safe by Default Blocks @everyone, @here, and role pings unless asked, and supports --read-only and server allowlists.
|
Quick Start
Option 1 — Local stdio via uvx (Python 3.15+)
For a single desktop client (Claude Desktop, Cursor, VS Code):
{
"mcpServers": {
"cord-mcp": {
"command": "uvx",
"args": ["cord-mcp", "serve"],
"env": {
"DISCORD_TOKEN": "YOUR_DISCORD_TOKEN"
}
}
}
}
Option 2 — Always-On Docker (recommended)
One Gateway session and search index that several MCP clients share:
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_DISCORD_TOKEN" \
-e CORD_MCP_HTTP_BEARER_TOKEN="YOUR_OPTIONAL_SECRET" \
ghcr.io/rayakame/cord-mcp:latest
Or copy .env.example to .env and run docker compose up -d. Then connect your client:
{
"mcpServers": {
"cord-mcp": {
"url": "http://127.0.0.1:8000/mcp",
"headers": {
"Authorization": "Bearer YOUR_OPTIONAL_SECRET"
}
}
}
}
Discord Bot Setup
Enable these for your bot in the Discord Developer Portal:
| Setting | Requirement | Purpose |
|---|---|---|
| Message Content Intent | Required | Read and index message content |
| Server Members Intent | Recommended | Member lists and role resolution |
| Presence Intent | Optional | list_presences (the server works without it) |
| Bot Permissions | Per workflow | VIEW_CHANNEL + READ_MESSAGE_HISTORY to read; more for writing and moderation |
User and OAuth2 Tokens
- Open Discord in an incognito window, log in, and copy
tokenfrom DevTools → Application → Local Storage →https://discord.com. Close the window without logging out; logging out revokes the token. - Start the server with it:
DISCORD_TOKEN="YOUR_USER_TOKEN" cord-mcp serve --token-type user
- The server acts with your account's permissions and behaves like the Discord web client, with conservative request pacing.
- Run one session per token from a stable IP, and prefer
--read-onlyif you only need search. - DMs work by channel ID but are not listed. Bot-only features such as slash commands are not available.
- OAuth2 access tokens work with
--token-type bearer(or aBearerprefix), in REST mode only.
Good to Know
- Token type: the default
--token-type autodetects bot, user, and bearer tokens. A token Discord rejects stops the server at startup. Set the type explicitly to skip detection. - Read-only and allowlist:
--read-onlyblocks every write, admin, and moderation tool.CORD_MCP_ALLOWED_GUILDSlimits the server to the listed servers. - Mentions:
@everyone,@here, and role pings are blocked unless a tool call allows them. - Search:
search_messagessearches the local index. Gateway mode fills it with new messages; usebackfill_channel_messagesorbackfill_guild_messagesfor older ones. - One server per token: processes sharing a token share Discord's rate limits. Run one always-on server and connect all clients to it.
- IDs: Discord IDs are passed and returned as strings.
Capabilities
| Domain | Tools | What You Can Do |
|---|---|---|
| Discovery & Context | 15 |
Server overview, channel and thread tree, permissions, members, roles, presences, voice, expressions |
| Reading & Search | 10 |
History, reply context, pins, reactions, poll results, full-text search, backfill |
| Messaging & Components V2 | 13 |
Send, edit, reply, forward, Components V2, embeds, files, polls, delete, pins, reactions |
| Channels, Forums & Threads | 12 |
Channel management, permission overwrites, threads, forum posts |
| Guild Admin, Roles & Events | 16 |
Server settings, roles, emojis, stickers, soundboard, webhooks, invites, events, onboarding |
| Moderation & AutoMod | 11 |
Kick, ban, timeout, voice moderation, prune, audit logs, AutoMod rules |
All 77 tools, 6 resources & 5 prompts
- Discovery (15):
get_bot_status,list_guilds,get_guild_overview,get_channel_tree,get_channel_details,get_effective_permissions,list_roles,list_members,get_member_info,get_user_info,list_presences,list_voice_states,list_emojis_and_stickers,list_soundboard_sounds,get_guild_widget - Reading & Search (10):
get_message,read_channel_messages,get_message_context,list_pinned_messages,list_reaction_users,get_poll_results,search_messages,backfill_channel_messages,backfill_guild_messages,get_message_store_stats - Messaging (13):
send_message,forward_message,edit_message,delete_message,bulk_delete_messages,pin_message,unpin_message,add_reaction,remove_reaction,clear_reactions,end_poll,trigger_typing,crosspost_message - Channels & Threads (12):
create_channel,edit_channel,delete_channel,reorder_channels,set_channel_permission_overwrite,delete_channel_permission_overwrite,list_threads,create_thread,edit_thread,create_forum_post,list_thread_members,manage_thread_membership - Guild Admin (16):
edit_guild,create_role,edit_role,delete_role,update_member_roles,manage_custom_emoji,manage_guild_sticker,manage_soundboard,list_webhooks,manage_webhook,execute_webhook,list_invites,manage_invite,list_scheduled_events,manage_scheduled_event,manage_stage_and_onboarding - Moderation (11):
kick_member,ban_member,bulk_ban_members,unban_user,list_bans,timeout_member,edit_member_moderation,prune_inactive_members,read_audit_logs,list_automod_rules,manage_automod_rule - Resources (6):
discord://status,discord://guilds,discord://guilds/{guild_id}/overview,discord://guilds/{guild_id}/channels,discord://channels/{channel_id}/recent,discord://channels/{channel_id}/pins - Prompts (5):
summarize_channel_activity,investigate_moderation_incident,audit_server_permissions,search_server_knowledge,draft_rich_announcement
Components V2 example
send_message, edit_message, create_forum_post, and execute_webhook accept Components V2 layouts directly:
{
"channel_id": "123456789012345678",
"components": [
{
"type": "container",
"accent_color": "#5865F2",
"components": [
{
"type": "section",
"components": [
{ "type": "text_display", "content": "## v0.1.0 Released\nAll systems operational." }
],
"accessory": {
"type": "link_button",
"label": "Changelog",
"url": "https://github.com/rayakame/cord-mcp/blob/main/CHANGELOG.md"
}
},
{ "type": "separator", "divider": true, "spacing": "small" },
{ "type": "text_display", "content": "Gateway latency: **18ms** · FTS5 index: **ready**" }
]
}
]
}
Configuration
| Environment Variable | CLI Flag | Default | Description |
|---|---|---|---|
DISCORD_TOKEN / CORD_MCP_TOKEN |
--token |
(required) | Bot, user, or OAuth2 token |
CORD_MCP_TOKEN_TYPE |
--token-type |
auto |
auto, bot, user, or bearer |
CORD_MCP_MODE |
--mode |
gateway |
gateway (live cache and indexing) or rest |
CORD_MCP_INTENTS |
--intents |
auto |
auto, all, unprivileged, or intent names (bots only) |
CORD_MCP_RATE_LIMIT_MODE |
--rate-limit-mode |
auto |
auto (paces user and bearer tokens), normal, or safe |
CORD_MCP_DB_PATH |
--db-path |
~/.local/share/cord-mcp/messages.db |
SQLite file or :memory: |
CORD_MCP_READ_ONLY |
--read-only |
false |
Block write, admin, and moderation tools |
CORD_MCP_ALLOWED_GUILDS |
--allowed-guilds |
(all) | Comma-separated server IDs |
CORD_MCP_TRANSPORT |
--transport |
stdio |
stdio, streamable-http, or sse |
CORD_MCP_HOST / CORD_MCP_PORT |
--host / --port |
127.0.0.1 / 8000 |
HTTP/SSE address (GET /health included) |
CORD_MCP_HTTP_BEARER_TOKEN |
--http-bearer-token |
(unset) | Require Authorization: Bearer <secret> |
CORD_MCP_LOG_LEVEL |
--log-level |
WARNING |
DEBUG, INFO, WARNING, ERROR, or CRITICAL |
Advanced settings
| Environment Variable | Default | Description |
|---|---|---|
CORD_MCP_STARTUP_TIMEOUT |
10.0 |
Seconds to wait for the Gateway handshake (0 = no limit) |
CORD_MCP_MAX_BACKFILL_PER_CALL |
5000 |
Max messages per backfill call |
CORD_MCP_AUTO_INDEX_GATEWAY |
true |
Index live messages, edits, reactions, and deletes |
CORD_MCP_AUTO_INDEX_REST |
true |
Index messages fetched or sent via REST |
CORD_MCP_ALLOW_USER_MENTIONS |
true |
Allow user mentions in outgoing messages by default |
CORD_MCP_ALLOW_REPLIED_USER_MENTION |
true |
Mention the replied-to user by default |
CORD_MCP_CLIENT_BUILD_NUMBER |
(scraped) | User tokens: override the Discord client build number |
CORD_MCP_CLIENT_BROWSER_VERSION |
(scraped) | User tokens: override the Chrome version |
CORD_MCP_CLIENT_PROPERTIES_OFFLINE |
false |
Skip fingerprint scraping and token type detection |
Commands
cord-mcp serve [options] # Start the MCP server (default)
cord-mcp tools [--json] # List all tools, resources, and prompts
cord-mcp stats [--db-path ...] # Show search index statistics
cord-mcp check-token [--token ...] [--token-type ...] # Check a token and list its servers
Metadata
Release files for cord-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cord_mcp-0.2.0.tar.gz | 467.1 kB | With provenance | Details for cord_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cord_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for cord_mcp-0.2.0-py3-none-any.whl |
Total release size: 1.0 MB
Release files / cord_mcp-0.2.0.tar.gz
| Download URL | cord_mcp-0.2.0.tar.gz |
|---|---|
| Size | 467.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d103f52c4b6ed8a54058b5833ba9f0f723211ba439407c6dc42c8a7a9a19f435
|
|
BLAKE2b-256 checksum How to use checksums |
1b535b95557290d45f24698ea3e05a32575c3e87365bf95356caf01182d7cab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logRelease files / cord_mcp-0.2.0-py3-none-any.whl
| Download URL | cord_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 551.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6caaacd2b304afbdc40cfb9a66d4c033015b3f6d1b8bedcfb894744c6cd6f96
|
|
BLAKE2b-256 checksum How to use checksums |
f773aad11806dc2d233f555a2dd7af3c14d37cd1b3a692aceb75c98332cc960e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logSecurity for cord-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cord_mcp-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.