Provides comprehensive Discord API integration with tools for managing channels, messages, threads, reactions, roles, webhooks, and permissions. Includes advanced features like message analysis, activity monitoring, and automated content management.
Discord MCP Server
A comprehensive Model Context Protocol (MCP) server for Discord integration. This server exposes all Discord functionality as MCP tools, enabling seamless integration with AI assistants like OpenAI, LangChain, Cursor, and Claude.
π Features
Complete Discord API Coverage: Channels, messages, threads, reactions, roles, webhooks, and more
MCP Standard Compliance: JSON-RPC 2.0 based standardized API
High Performance: Redis caching, rate limiting, automatic retries with exponential backoff
Security First: Mention filtering, minimal permissions, audit logging
Production Ready: Docker support, CI/CD pipeline, comprehensive monitoring
Advanced AI Features: Message summarization, activity analysis, intelligent filtering
π Quick Start
Prerequisites
Python 3.12+
Discord Bot Token
Redis 6.0+ (optional - uses in-memory cache if not available)
Installation
Clone the repository
git clone https://github.com/tristan-kkim/discord-mcp.git cd discord-mcpInstall dependencies
pip install -r requirements.txtConfigure environment
cp .env.example .env # Edit .env with your Discord Bot TokenRun the server
python run.py
Docker Deployment
π§ MCP Client Integration
Cursor IDE
Open Cursor Settings β MCP Servers
Add server:
http://localhost:8000/mcpStart using Discord tools in your AI conversations
OpenAI ChatGPT
Create a Custom GPT
Add Action with URL:
http://your-server:8000/mcpConfigure with your Discord server details
Claude Desktop
Add to your MCP configuration:
π Available MCP Tools
Channel & Guild Management
discord.list_guilds- List all guilds the bot is member ofdiscord.list_channels- List channels in a guilddiscord.get_channel- Get channel informationdiscord.create_channel- Create a new channeldiscord.update_channel- Update channel settingsdiscord.delete_channel- Delete a channel
Message Management
discord.list_messages- List messages in a channeldiscord.get_message- Get specific messagediscord.send_message- Send a messagediscord.edit_message- Edit a messagediscord.delete_message- Delete a messagediscord.search_messages- Search messages with filters
Thread Management
discord.create_thread- Create a threaddiscord.list_threads- List active/archived threadsdiscord.archive_thread- Archive a threaddiscord.unarchive_thread- Unarchive a thread
Reactions, Pins & Webhooks
discord.add_reaction- Add reaction to messagediscord.remove_reaction- Remove reactiondiscord.list_reactions- List all reactionsdiscord.pin_message- Pin a messagediscord.unpin_message- Unpin a messagediscord.create_webhook- Create webhookdiscord.send_via_webhook- Send message via webhook
Role & Permission Management
discord.list_roles- List guild rolesdiscord.add_role- Assign role to memberdiscord.remove_role- Remove role from memberdiscord.get_permissions- Get permission information
Advanced AI Features
discord.summarize_messages- AI-powered message summarizationdiscord.rank_messages- Intelligent message rankingdiscord.sync_since- Delta synchronizationdiscord.analyze_channel_activity- Channel activity analysis
π API Reference
Endpoints
GET /- Server statusGET /health- Health checkGET /metrics- Prometheus-compatible metricsPOST /mcp- MCP JSON-RPC endpoint
Example Usage
π Security
Bot Token Security
Never expose your bot token - Treat it like a password
Use environment variables - Never hardcode in source code
Minimal permissions - Only grant necessary Discord permissions
Required Discord Permissions
Send Messages- Send messages to channelsRead Message History- Read message historyManage Messages- Edit/delete messagesAdd Reactions- Add reactions to messagesManage Channels- Create/modify channels (if needed)Manage Roles- Manage roles (if needed)
Built-in Security Features
Automatic
@everyoneand@heremention filteringRate limiting with Discord API compliance
Audit logging for all operations
Input validation and sanitization
π Monitoring & Observability
Health Checks
Metrics
Logging
All logs are structured JSON with fields:
request_id- Unique request identifiertool- MCP tool being calledchannel_id- Discord channel contextlatency_ms- Response timesuccess- Operation success status
π Production Deployment
Environment Variables
Variable | Description | Default | Required |
| Discord Bot Token | - | β |
| Redis connection URL |
| β |
| Logging level |
| β |
| Enable rate limiting |
| β |
| Cache TTL in seconds |
| β |
| Server host |
| β |
| Server port |
| β |
Cloud Deployment
Heroku
Railway
AWS ECS/Fargate
π§ͺ Testing
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Documentation
Wiki: Complete Documentation
Installation Guide: Step-by-step Setup
Quick Start: 5-minute Setup
API Reference: Complete API Docs
Security Guide: Best Practices
π Support
Issues: GitHub Issues
Discussions: GitHub Discussions
π Changelog
v1.0.0 (2024-10-29)
π Initial release
β Complete Discord API integration
β MCP standard compliance
β Docker support
β Advanced AI features
β Security enhancements
β Comprehensive documentation
νκ΅μ΄ λ¬Έμ
Discord MCP μλ²
Discordμ ν΅μ νλ Model Context Protocol(MCP) μλ²μ λλ€. λͺ¨λ Discord κΈ°λ₯μ MCP Tool ννλ‘ λ ΈμΆνμ¬ OpenAI, LangChain, Cursor λ±μ MCP ν΄λΌμ΄μΈνΈμμ μμ νκ² μ¬μ©ν μ μμ΅λλ€.
π μ£Όμ κΈ°λ₯
μμ ν Discord API μ§μ: μ±λ, λ©μμ§, μ€λ λ, 리μ‘μ , μν , μΉν λ± λͺ¨λ Discord κΈ°λ₯
MCP νμ€ μ€μ: JSON-RPC 2.0 κΈ°λ°μ νμ€νλ API
κ³ μ±λ₯: Redis μΊμ±, Rate limit κ΄λ¦¬, μ§μ λ°±μ€ν μ¬μλ
보μ μ°μ : λ©μ νν°λ§, μ΅μ κΆν, κ°μ¬ λ‘κ·Έ
νλ‘λμ μ€λΉ: Docker μ§μ, CI/CD νμ΄νλΌμΈ, ν¬κ΄μ λͺ¨λν°λ§
κ³ κΈ AI κΈ°λ₯: λ©μμ§ μμ½, νλ λΆμ, μ§λ₯ν νν°λ§
π λΉ λ₯Έ μμ
μ¬μ μꡬμ¬ν
Python 3.12+
Discord Bot Token
Redis 6.0+ (μ νμ¬ν - μμΌλ©΄ λ©λͺ¨λ¦¬ μΊμ μ¬μ©)
μ€μΉ
μ μ₯μ ν΄λ‘
git clone https://github.com/tristan-kkim/discord-mcp.git cd discord-mcpμμ‘΄μ± μ€μΉ
pip install -r requirements.txtνκ²½ μ€μ
cp .env.example .env # .env νμΌμ Discord Bot Token μ€μ μλ² μ€ν
python run.py
Docker λ°°ν¬
π§ MCP ν΄λΌμ΄μΈνΈ ν΅ν©
Cursor IDE
Cursor μ€μ β MCP μλ² μ΄κΈ°
μλ² μΆκ°:
http://localhost:8000/mcpAI λνμμ Discord λꡬ μ¬μ© μμ
OpenAI ChatGPT
Custom GPT μμ±
Action μΆκ°:
http://your-server:8000/mcpDiscord μλ² μΈλΆμ¬νμΌλ‘ ꡬμ±
Claude Desktop
MCP ꡬμ±μ μΆκ°:
π μ¬μ© κ°λ₯ν MCP λꡬ
μ±λ λ° κΈΈλ κ΄λ¦¬
discord.list_guilds- λ΄μ΄ μν λͺ¨λ κΈΈλ λͺ©λ‘discord.list_channels- κΈΈλμ μ±λ λͺ©λ‘discord.get_channel- μ±λ μ 보 μ‘°νdiscord.create_channel- μ μ±λ μμ±discord.update_channel- μ±λ μ€μ μ λ°μ΄νΈdiscord.delete_channel- μ±λ μμ
λ©μμ§ κ΄λ¦¬
discord.list_messages- μ±λμ λ©μμ§ λͺ©λ‘discord.get_message- νΉμ λ©μμ§ μ‘°νdiscord.send_message- λ©μμ§ μ μ‘discord.edit_message- λ©μμ§ νΈμ§discord.delete_message- λ©μμ§ μμ discord.search_messages- νν°λ‘ λ©μμ§ κ²μ
μ€λ λ κ΄λ¦¬
discord.create_thread- μ€λ λ μμ±discord.list_threads- νμ±/μμΉ΄μ΄λΈλ μ€λ λ λͺ©λ‘discord.archive_thread- μ€λ λ μμΉ΄μ΄λΈdiscord.unarchive_thread- μ€λ λ μΈμμΉ΄μ΄λΈ
리μ‘μ , ν λ° μΉν
discord.add_reaction- λ©μμ§μ 리μ‘μ μΆκ°discord.remove_reaction- 리μ‘μ μ κ±°discord.list_reactions- λͺ¨λ 리μ‘μ λͺ©λ‘discord.pin_message- λ©μμ§ κ³ μ discord.unpin_message- λ©μμ§ κ³ μ ν΄μ discord.create_webhook- μΉν μμ±discord.send_via_webhook- μΉν μΌλ‘ λ©μμ§ μ μ‘
μν λ° κΆν κ΄λ¦¬
discord.list_roles- κΈΈλ μν λͺ©λ‘discord.add_role- λ©€λ²μκ² μν λΆμ¬discord.remove_role- λ©€λ²μμ μν μ κ±°discord.get_permissions- κΆν μ 보 μ‘°ν
κ³ κΈ AI κΈ°λ₯
discord.summarize_messages- AI κΈ°λ° λ©μμ§ μμ½discord.rank_messages- μ§λ₯ν λ©μμ§ μμdiscord.sync_since- λΈν λκΈ°νdiscord.analyze_channel_activity- μ±λ νλ λΆμ
π 보μ
Bot Token 보μ
Bot ν ν°μ μ λ λ ΈμΆνμ§ λ§μΈμ - λΉλ°λ²νΈμ²λΌ μ·¨κΈ
νκ²½λ³μ μ¬μ© - μμ€μ½λμ νλμ½λ© κΈμ§
μ΅μ κΆν - νμν Discord κΆνλ§ λΆμ¬
νμν Discord κΆν
Send Messages- μ±λμ λ©μμ§ μ μ‘Read Message History- λ©μμ§ κΈ°λ‘ μ½κΈ°Manage Messages- λ©μμ§ νΈμ§/μμ Add Reactions- λ©μμ§μ 리μ‘μ μΆκ°Manage Channels- μ±λ μμ±/μμ (νμμ)Manage Roles- μν κ΄λ¦¬ (νμμ)
λ΄μ₯ 보μ κΈ°λ₯
@everyoneλ°@hereλ©μ μλ νν°λ§Discord API μ€μ Rate limiting
λͺ¨λ μμ μ λν κ°μ¬ λ‘κ·Έ
μ λ ₯ κ²μ¦ λ° μ μ
π λͺ¨λν°λ§ λ° κ΄μ°°μ±
ν¬μ€μ²΄ν¬
λ©νΈλ¦
λ‘κΉ
λͺ¨λ λ‘κ·Έλ λ€μ νλκ° ν¬ν¨λ ꡬ쑰νλ JSONμ λλ€:
request_id- κ³ μ μμ² μλ³μtool- νΈμΆλλ MCP λꡬchannel_id- Discord μ±λ 컨ν μ€νΈlatency_ms- μλ΅ μκ°success- μμ μ±κ³΅ μν
π νλ‘λμ λ°°ν¬
νκ²½ λ³μ
λ³μ | μ€λͺ | κΈ°λ³Έκ° | νμ |
| Discord Bot Token | - | β |
| Redis μ°κ²° URL |
| β |
| λ‘κΉ λ 벨 |
| β |
| Rate limiting νμ±ν |
| β |
| μΊμ TTL (μ΄) |
| β |
| μλ² νΈμ€νΈ |
| β |
| μλ² ν¬νΈ |
| β |
ν΄λΌμ°λ λ°°ν¬
Heroku
Railway
AWS ECS/Fargate
π§ͺ ν μ€νΈ
π€ κΈ°μ¬νκΈ°
κΈ°μ¬λ₯Ό νμν©λλ€! μμΈν λ΄μ©μ κΈ°μ¬ κ°μ΄λλ₯Ό μ°Έμ‘°νμΈμ.
μ μ₯μ ν¬ν¬
κΈ°λ₯ λΈλμΉ μμ± (
git checkout -b feature/amazing-feature)λ³κ²½μ¬ν μ»€λ° (
git commit -m 'Add amazing feature')λΈλμΉμ νΈμ (
git push origin feature/amazing-feature)Pull Request μ΄κΈ°
π λΌμ΄μ μ€
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€ νμ λ°°ν¬λ©λλ€. μμΈν λ΄μ©μ LICENSE νμΌμ μ°Έμ‘°νμΈμ.
π λ¬Έμ
Wiki: μμ ν λ¬Έμ
μ€μΉ κ°μ΄λ: λ¨κ³λ³ μ€μ
λΉ λ₯Έ μμ: 5λΆ μ€μ
API μ°Έμ‘°: μμ ν API λ¬Έμ
보μ κ°μ΄λ: λͺ¨λ² μ¬λ‘
π μ§μ
μ΄μ: GitHub Issues
ν λ‘ : GitHub Discussions
π λ³κ²½ λ‘κ·Έ
v1.0.0 (2024-10-29)
π μ΄κΈ° 릴리μ¦
β μμ ν Discord API ν΅ν©
β MCP νμ€ μ€μ
β Docker μ§μ
β κ³ κΈ AI κΈ°λ₯
β 보μ κ°ν
β ν¬κ΄μ λ¬Έμν
This server cannot be installed