dynamic-discord-bot-api-mcp
Provides integration with Discord's HTTP API using bot token authentication, enabling AI agents to search and inspect Discord API endpoints, retrieve component schemas, and execute API calls such as sending messages and uploading files.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dynamic-discord-bot-api-mcp Send a message to channel 123456789012345678"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dynamic-discord-bot-api-mcp
Production-oriented stdio MCP gateway exposing stable Discord HTTP operations that explicitly support bot-token authentication. It installs a checked-in, self-refreshing OpenAPI catalog and exposes exactly five generic tools—never one tool per endpoint.
Discord's OpenAPI specification is a public preview and may be incomplete. This project consumes only stable openapi.json; official Discord documentation remains authoritative.
Scope and architecture
Refresh filters every operation by explicit BotToken security metadata, then applies a small fail-closed classifier for OAuth, interaction-token, webhook-token, Social SDK/lobby, and ambiguous routes. It retains only transitively referenced component schemas. Excluded endpoints cannot be searched, inspected, or called.
Gateway HTTP metadata such as /gateway/bot may remain because it supports bot authentication; Gateway WebSockets and events do not. Also excluded: OAuth exchange, bearer/user authorization, self-bots, Voice WebSocket/RTP, RPC, Activities/Embedded App/Social SDKs, interaction receivers/callbacks, incoming webhook servers, webhook-token execution, preview endpoints, and arbitrary HTTP requests.
Runtime resolves one active local MCP workspace root, reloads its .env before every call, and caches a client only while security-relevant configuration is unchanged. Schema refresh uses validation, atomic rename, concurrent coalescing, and cached fallback. JSON audit events go to stderr without values or secrets.
Related MCP server: discord-mcp
Install
npm install -g dynamic-discord-bot-api-mcp
discord-bot-api-mcpFrom GitHub:
npm install -g github:PrimeUpYourLife/dynamic-discord-bot-api-mcpMCP client configuration:
{"mcpServers":{"discord":{"command":"discord-bot-api-mcp"}}}Codex ~/.codex/config.toml:
[mcp_servers.discord]
command = "discord-bot-api-mcp"Place DISCORD_BOT_TOKEN in active repository .env. Process environment overrides startup-directory .env; active workspace .env overrides both. Multiple, failed, non-local, or non-directory MCP roots fail closed. Catalog tools need no token.
Five tools
discord_search_endpoints: fuzzy search IDs, methods, routes, categories, descriptions, and parameters.discord_get_endpoint: exact canonical ID or OpenAPI operation-ID lookup.discord_get_type: component-schema lookup.discord_call_endpoint: validate and execute a cataloged bot endpoint.discord_refresh_schema: fetch, filter, validate, and atomically install stable schema.
Examples:
{"search":"create message","limit":5}
{"endpoint":"create_message"}
{"endpoint":"POST /channels/{channel_id}/messages","pathParameters":{"channel_id":"123456789012345678"},"body":{"content":"Hello from MCP"}}Upload example:
{"endpoint":"create_message","pathParameters":{"channel_id":"123456789012345678"},"body":{"content":"image"},"files":[{"path":"./uploads/image.png","filename":"image.png","contentType":"image/png"}]}Uploads use payload_json and deterministic files[n] parts/attachment IDs. Paths resolve from active root and must remain within configured realpath roots. Base64 descriptors are also supported.
Validation separates path, query, and body values; handles required fields, nested objects, arrays, enums, nullable values, refs and unions. Snowflakes remain strings. Arrays become repeated query keys. DELETE and centrally classified destructive operations require confirm: true. Optional audit reason is percent-encoded.
Errors are structured (ENDPOINT_NOT_FOUND, ENDPOINT_NOT_ALLOWED, CONFIRMATION_REQUIRED, BOT_TOKEN_MISSING, VALIDATION_ERROR, DISCORD_API_ERROR, REQUEST_ERROR, project-root errors, or SCHEMA_REFRESH_FAILED). Discord numeric codes and nested validation errors are preserved; raw bodies, stack traces, and tokens are not.
Configuration
Variable | Default | Meaning |
| unset | Bot token; calls fail safely when absent |
|
| Fixed API origin |
|
| Comma-separated IDs/operation IDs with |
|
| Per-attempt timeout |
|
| Retry count |
|
| Local global safety rate |
|
| Local burst |
|
| Refresh threshold |
| bundled catalog | Alternate catalog path |
| active root | Platform-delimited upload roots |
|
| Per-file limit |
|
| Validation escape hatch |
|
|
|
Use narrow production allowlists. Caller cannot supply URLs, methods, authorization, or headers. Requests always use configured base URL plus catalog route, Authorization: Bot …, and valid package User-Agent.
Discord response headers and 429 payloads control per-route/bucket and global waits; limits are not hard-coded. Fractional retry_after is honored. 429s retry within configured bound. 5xx and transport retries are limited to safe GET requests, preventing duplicate messages or moderation actions.
Development
npm ci
npm run refresh-schema
npm run check
npm test
npm run buildTests mock network access. Daily workflow refreshes catalog and commits only generated-data changes. Manual publish workflow verifies tag/version and uses npm trusted publishing via GitHub OIDC; prereleases publish under next.
Available Tools
5 toolsdiscord_call_endpointB
Validate and call one cataloged Discord Bot HTTP endpoint.
Inputs: endpoint (required), body, files, reason, +3 more.
discord_get_endpointARead-only
Return normalized schema for one Discord Bot endpoint.
Inputs: endpoint (required).
discord_get_typeCRead-only
Return one normalized Discord OpenAPI component schema.
Inputs: type (required).
discord_refresh_schemaAIdempotent
Fetch, validate, filter, and atomically install stable Discord Bot schema.
Inputs: no named parameters.
discord_search_endpointsARead-only
Fuzzy-search cataloged Discord Bot HTTP API endpoints.
Inputs: limit, search.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool serves a distinct function: searching, fetching endpoint schemas, fetching type schemas, calling endpoints, and refreshing the schema. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern with a discord_ prefix, using clear and uniform snake_case. The naming convention is uniform and predictable.
Five tools is an appropriate size for a focused Discord API schema management server. Each tool covers a core operation without unnecessary bloat or sparseness.
The tool set covers the full lifecycle: discovering endpoints, retrieving schemas, calling endpoints, and refreshing the local schema. No critical gaps are apparent for the server's intended purpose.
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
MCP server for progressive tool usage at any scale (see https://klavis.ai)
- Discortics - Discord BotDeprecatedcom.discortics
Set up and manage your Discord server from MCP: channels, roles, verification, tickets and security.
Build your own tools from chat: design, test and host them on a shareable MCP server URL.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceAn MCP server providing 26 tools for Discord API interactions, enabling message management, moderation, channel operations, and server inspection through Claude Code, Paperclip agents, or other MCP-compatible clients.26MIT
- AlicenseAqualityDmaintenanceMCP server for interacting with Discord via REST API, enabling guild, channel, and message operations using a bot token.7MIT
- AlicenseAqualityDmaintenanceMCP server over the real Discord REST API: 5 read-only tools plus 7 write tools gated off by default behind DISCORD_MCP_ENABLE_WRITE.121MIT
- 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