AgentStack
MCP verified MIT Self-run

DiscordClaudeCode

mcp-0rnot-discordclaudecode · by 0rnot

Discord x Claude Code bridge via MCP (Model Context Protocol). Human-in-the-loop AI assistant integration with forum threads, real-time communication, and AI-powered title generation.

No reviews yet
0 installs
12 views
0.0% view→install

Install

$ agentstack add mcp-0rnot-discordclaudecode

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

Are you the author of DiscordClaudeCode? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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) │
└─────────────┘                      └──────────────┘                    └─────────┘
  1. AI Request — The AI assistant sends a question via the MCP protocol
  2. Discord Thread — The bot creates or reuses a thread in a Discord forum channel
  3. Human Response — The human replies in the Discord thread
  4. AI Continues — The response is returned to the AI assistant
  5. 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

  1. Create Application at Discord Developer Portal
  2. Configure Bot
  • Generate a bot token under the "Bot" page
  • Enable Message Content Intent under "Privileged Gateway Intents"
  1. Set Installation Settings
  • Enable both Guild Install and User Install
  • Add applications.commands and bot scopes
  • Bot permissions: Send Messages, Create Public Threads, Read Message History
  1. Create a Forum Channel in your Discord server
  2. 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 integration
  • mcp (≥0.4.0) — Model Context Protocol support
  • PyNaCl (≥1.4.0) — Discord voice support
  • google-generativeai (≥0.8.0) — AI title generation (optional)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.