Nika
Nika — Discord MCP Server
A comprehensive Model Context Protocol server that lets AI assistants run a Discord community: messaging, moderation, roles, channels, forums, webhooks, invites, scheduled events, AutoMod, onboarding, emojis/stickers, permission overwrites, voice management — 111 tools, plus a raw REST passthrough (discord_api_request) so anything the Discord API can do is reachable.
Built with Python + discord.py (persistent gateway connection) and FastMCP.
Setup
1. Create the Discord bot (done)
Application: Nika (ID
1538805149865091092)Enabled intents: Server Members, Message Content
Token: stored in
.env(never commit it —.gitignoreprotects it)
2. Invite the bot to your server
Open this URL and pick your server (grant Administrator for full functionality):
https://discord.com/api/oauth2/authorize?client_id=1538805149865091092&permissions=8&scope=bot%20applications.commands⚠️ The bot must be in a server before most tools can do anything.
3. Install & configure
python -m venv .venv
.venv\Scripts\pip install -e ".[dev]".env (already created):
DISCORD_TOKEN=... # bot token
DISCORD_GUILD_ID= # optional: default server id → makes guildId optional everywhere
MCP_TRANSPORT=stdio # stdio | http
HTTP_HOST=0.0.0.0 # HTTP mode only
HTTP_PORT=8085
LOG_LEVEL=INFOUsage
stdio (default — Claude Desktop, VS Code, Cursor, etc.)
.venv\Scripts\python -m discord_mcpClaude Desktop claude_desktop_config.json:
{
"mcpServers": {
"nika": {
"command": "d:\\Projects\\david\\DiscordMCP\\.venv\\Scripts\\python.exe",
"args": ["-m", "discord_mcp"],
"cwd": "d:\\Projects\\david\\DiscordMCP"
}
}
}HTTP (streamable) — remote access, n8n, multi-client
.venv\Scripts\python -m discord_mcp --transport http --port 8085
# endpoint: http://localhost:8085/mcpClient config:
{
"mcpServers": {
"nika": { "url": "http://localhost:8085/mcp" }
}
}Docker
docker compose up -d # builds + runs HTTP mode on :8085
docker run -i --rm -e DISCORD_TOKEN=$env:DISCORD_TOKEN discord-mcp:latest # stdioTesting with the MCP Inspector
npx @modelcontextprotocol/inspector .venv\Scripts\python.exe -m discord_mcpTool reference (111 tools)
Area | Tools |
Servers |
|
Channels |
|
Messages |
|
Members |
|
Roles |
|
DMs |
|
Moderation |
|
Voice |
|
Events |
|
Permissions |
|
Invites |
|
Webhooks |
|
Forums |
|
Emojis & Stickers |
|
AutoMod |
|
Onboarding & Audit |
|
Raw API |
|
Design notes
Hybrid gateway + REST: one persistent discord.py gateway connection provides live state (member/channel lookups, names→IDs) while mutations go through the same client. Tool calls bridge onto the gateway loop via
asyncio.run_coroutine_threadsafe.Safety: the raw tool requires
confirmDestructive=truefor mutating methods;prune_membersdefaults to a dry run; destructive tools accept areasonwhich is written to the audit log.Optional
guildId: setDISCORD_GUILD_IDin.envand everyguildIdparameter becomes optional.Errors: Discord errors are converted to readable messages (e.g.
Missing permissions: ...).
Limitations
Requires a bot token (user-token/self-bot automation violates Discord ToS).
Message reading requires the bot to see the channel and (for content) the Message Content intent.
No voice audio streaming/receiving.
Development
.venv\Scripts\python -m pytest # 22 unit testsLayout: discord_mcp/bot.py (gateway bridge) · discord_mcp/server.py (FastMCP) · discord_mcp/tools/*.py (one module per domain) · discord_mcp/utils/ (serializers, embeds).
License
MIT
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/alive2/discord-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server