Install
$ agentstack add mcp-0rnot-discordclaudecode ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
🤖 DiscordClaudeCode
Bridge between Claude Code and Discord — Human-in-the-Loop via MCP
[](https://opensource.org/licenses/MIT) [](https://www.python.org/downloads/) [](https://modelcontextprotocol.io/) [](https://discord.com/)
[English](#overview) | [日本語](README_ja.md)
Overview
A Python implementation of a Model Context Protocol (MCP) server that enables AI assistants to interact with humans through Discord. It acts as a bridge between AI systems (like Claude Code) and human users, enabling collaborative tasks, decision-making, and information gathering — all through Discord forum threads.
✨ Key Features
- 🔗 MCP Integration — Full Model Context Protocol support for Claude Code and compatible AI assistants
- 💬 Discord Forum Threads — Organized conversations in Discord forum channels
- 🧠 AI-Powered Titles — Automatic thread title generation using Google Gemini AI
- ⚡ Real-Time Communication — Bidirectional messaging between AI and humans
- 📝 Conversation Management — Thread persistence and history tracking
- 🛡️ Graceful Fallbacks — Degraded operation when AI services are unavailable
📸 Screenshots
🚀 Quick Start
Prerequisites
- Python 3.8+
- Discord account and bot
- Google AI API Key (optional, for enhanced title generation)
- MCP-compatible AI client (e.g., Claude Code)
Installation
# Clone the repository
git clone https://github.com/0rnot/DiscordClaudeCode.git
cd DiscordClaudeCode
# Install dependencies
pip install -r requirements.txt
# Or install as a package
pip install .
Environment Variables
export DISCORD_BOT_TOKEN="your_discord_bot_token"
export GOOGLE_AI_API_KEY="your_google_ai_api_key" # Optional
export HUMAN_CHANNEL_ID="your_discord_forum_channel_id"
export HUMAN_USER_ID="your_discord_user_id"
Claude Code Configuration
Add the following to your ~/.claude.json:
{
"mcpServers": {
"human-in-the-loop": {
"command": "python3",
"args": ["/path/to/DiscordClaudeCode/final_working_version.py"],
"env": {
"DISCORD_BOT_TOKEN": "your_discord_bot_token",
"GOOGLE_AI_API_KEY": "your_google_ai_api_key",
"HUMAN_CHANNEL_ID": "your_discord_forum_channel_id",
"HUMAN_USER_ID": "your_discord_user_id"
}
}
}
}
📖 How It Works
┌─────────────┐ MCP Protocol ┌──────────────┐ Discord API ┌─────────┐
│ Claude Code │ ◄──────────────────► │ MCP Server │ ◄────────────────► │ Discord │
│ (AI Agent) │ │ (This Repo) │ │ (Human) │
└─────────────┘ └──────────────┘ └─────────┘
- AI Request — The AI assistant sends a question via the MCP protocol
- Discord Thread — The bot creates or reuses a thread in a Discord forum channel
- Human Response — The human replies in the Discord thread
- AI Continues — The response is returned to the AI assistant
- Title Generation — Thread titles are automatically updated based on conversation context
MCP Tools
| Tool | Description | Use Case | |------|-------------|----------| | ask_human | Send a question and wait for a human response | Decisions, confirmations, feedback | | report_to_human | Send a status update without waiting for a response | Progress reports, notifications |
🛠️ Discord Bot Setup
Click to expand detailed setup instructions
- Create Application at Discord Developer Portal
- Configure Bot
- Generate a bot token under the "Bot" page
- Enable Message Content Intent under "Privileged Gateway Intents"
- Set Installation Settings
- Enable both Guild Install and User Install
- Add
applications.commandsandbotscopes - Bot permissions: Send Messages, Create Public Threads, Read Message History
- Create a Forum Channel in your Discord server
- Get IDs (Enable Developer Mode in Discord settings)
- Right-click the forum channel → "Copy ID" for
HUMAN_CHANNEL_ID - Right-click your profile → "Copy ID" for
HUMAN_USER_ID
📁 Project Structure
DiscordClaudeCode/
├── final_working_version.py # Main MCP server implementation
├── requirements.txt # Python dependencies
├── setup.py # Package setup
├── README.md # English documentation (this file)
├── README_ja.md # 日本語ドキュメント
├── LICENSE # MIT License
└── .gitignore # Git ignore rules
📦 Dependencies
discord.py(≥2.3.0) — Discord API integrationmcp(≥0.4.0) — Model Context Protocol supportPyNaCl(≥1.4.0) — Discord voice supportgoogle-generativeai(≥0.8.0) — AI title generation (optional)
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- 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](LICENSE) file for details.
🙏 Acknowledgments
This project was inspired by KOBA789/human-in-the-loop.
If you find this project useful, please consider giving it a ⭐!
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: 0rnot
- Source: 0rnot/DiscordClaudeCode
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.