Discord MCP
Provides read-only access to Discord servers, including listing guilds, channels, and messages, and retrieving individual message details.
Click on "Install 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., "@Discord MCPShow the last 25 messages in the #general channel."
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.
Discord MCP
Local, read-only Discord MCP server. It uses stdio and direct Discord REST API calls—there is no HTTP listener, Kubernetes deployment, Gateway connection, event cache, or write tool.
Safety boundaries
DISCORD_ALLOWED_GUILDSis required; the server fails to start without it.DISCORD_ALLOWED_CHANNELSis optional but recommended. When set, all channel and message reads outside it are rejected.Message tools always return message bodies. Enable Message Content Intent for the bot in Discord Developer Portal; without it, Discord returns empty content fields.
The bot needs only
View ChannelandRead Message Historyfor the initial tools. Do not grant Administrator, management, moderation, webhook, invite, or voice permissions.The bot token stays in your local MCP configuration or a local
.envfile;.envis ignored by Git.
Related MCP server: telegram-mcp
Tools
discord_list_guildsdiscord_list_channelsdiscord_get_channeldiscord_list_messagesdiscord_get_message
All tools are read-only. Message reads support a bounded limit (1–100) and a before or after cursor. The service never downloads attachments and never returns attachment URLs.
Setup
npm installCopy .env.example to an ignored local .env file if you want a convenience template, then export it deliberately before running the development command:
set -a
. ./.env
set +a
npm run devPopulate DISCORD_BOT_TOKEN and the numeric guild ID in that local file. Use Discord's Developer Mode to copy IDs. Add channel IDs to DISCORD_ALLOWED_CHANNELS before enabling the server for a shared guild.
Build and verify without contacting Discord:
npm run check
npm run buildCodex configuration
Export the configuration variables in the same local environment that launches the Codex CLI. Do not put the token in this repository or config.toml.
Add this local MCP entry to ~/.codex/config.toml, replacing the path with your clone path:
[mcp_servers.discord]
command = "node"
args = ["/absolute/path/to/discord-mcp/dist/index.js"]
cwd = "/absolute/path/to/discord-mcp"
env_vars = [
"DISCORD_BOT_TOKEN",
"DISCORD_ALLOWED_GUILDS",
"DISCORD_ALLOWED_CHANNELS",
]For example, in the shell you use to start Codex:
export DISCORD_BOT_TOKEN='...'
export DISCORD_ALLOWED_GUILDS='your-guild-id'
export DISCORD_ALLOWED_CHANNELS='your-test-channel-id'
codexBuild first, then restart Codex from that environment. If you use the ChatGPT desktop app rather than Codex CLI, configure the environment at the app-launch level or use the app's MCP-server form; a variable exported in an unrelated Terminal window will not be inherited by the already-running app.
Development
npm run dev
npm test
npm run typechecknpm run dev reads environment variables from the current shell. It deliberately does not load .env automatically so the token cannot be accidentally supplied through an unexpected execution path.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for interacting with Discord via REST API, enabling guild, channel, and message operations using a bot token.Last updated7MIT
- FlicenseAqualityBmaintenanceRead-only MCP server for self-hosted Telegram access via Telethon. Enables reading messages, chats, and media but disallows any write operations.Last updated10
- AlicenseAqualityCmaintenanceA self-hosted, read-only Slack MCP server that runs locally and provides read-only access to Slack channels, messages, and users via the Slack Web API, with no third-party intermediary.Last updated7MIT
- Alicense-qualityCmaintenanceRead-only MCP server for Discord that lists guilds, channels, and reads or searches messages using a self-bot account via discord.py-self.Last updatedMIT
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP server for Robinhood Chain token discovery, research, and due diligence via GMGN.
An MCP server for deep research or task groups
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JoelBChapmanII/discord-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server