
koba789/human-in-the-loop 是一个从 https://github.com/koba789/human-in-the-loop. 导入的 MCP 服务器候选
概览
koba789/human-in-the-loop 是一个从 https://github.com/koba789/human-in-the-loop. 导入的 MCP 服务器候选
概述(AI 翻译)
一个MCP(模型上下文协议)服务器,允许AI助手通过Discord向人类提问。
概述
当AI助手在工作中需要人类输入或判断时,会使用该MCP服务器。例如:
- 当由大型语言模型创建文档时,AI设计结构,而人类提供特定内容
- 当AI需要对不确定决策进行确认时
- 当需要专业知识或个人信息时
要求
- 锈蚀(1.70或更高)
- Discord账号和机器人
- 兼容MCP的AI客户端(Claude Desktop、Copilot Edits等)
布置
1.创建Discord机器人
- 访问Discord开发者门户
- 创建一个新应用
- 在机器人部分创建机器人并获得代币
- 设置所需权限:
- 发送消息
- 创建公共主题
- 阅读消息历史
- 在机器人部分启用特权网关意图:
- 消息内容意图
2.安装
连接MCP客户端
Claude Desktop Configuration
在claude_desktop_config.json中添加以下内容:
Claude 代码配置
对于Claude代码(claude.ai/code),请添加到你的MCP设置中:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Human-in-the-Loop MCP Server
An MCP (Model Context Protocol) server that allows AI assistants to ask questions to humans via Discord.
Overview
This MCP server is used when AI assistants need human input or judgment during their work. For example:
- When having an LLM create documentation, the AI designs the structure while humans provide specific content
- When the AI needs confirmation on uncertain decisions
- When specialized knowledge or personal information is required
Requirements
- Rust (1.70 or higher)
- Discord account and bot
- MCP-compatible AI client (Claude Desktop, Copilot Edits, etc.)
Setup
1. Create Discord Bot
- Go to Discord Developer Portal
- Create a new application
- Create a bot in the Bot section and obtain the token
- Set required permissions:
- Send Messages
- Create Public Threads
- Read Message History
- Enable privileged gateway intents in Bot section:
- Message Content Intent
2. Install
cargo install --git https://github.com/KOBA789/human-in-the-loop.git
Connecting with MCP Clients
Claude Desktop Configuration
Add the following to claude_desktop_config.json:
{
"mcpServers": {
"human-in-the-loop": {
"command": "human-in-the-loop",
"args": [
"--discord-channel-id", "channel-id",
"--discord-user-id", "user-id"
],
"env": {
"DISCORD_TOKEN": "your-discord-bot-token"
}
}
}
}
Claude Code Configuration
For Claude Code (claude.ai/code), add to your MCP settings:
{
"mcpServers": {
"human-in-the-loop": {
"command": "human-in-the-loop",
"args": [
"--discord-channel-id", "channel-id",
"--discord-user-id", "user-id"
]
}
}
}
Set the Discord token as an environment variable before running Claude Code:
export DISCORD_TOKEN="your-discord-bot-token"
claude
Note: The server automatically reads the Discord token from the DISCORD_TOKEN environment variable. You can also pass it via --discord-token argument if needed.
Usage
AI assistants can ask questions to humans using the ask_human tool:
Human: Please create a documentation outline. You can ask the human as you need.
Assistant: I'll create a documentation outline. Let me ask you some questions first.
[Uses ask_human tool]
The AI posts questions in Discord and mentions the specified user. When the user replies in Discord, the response is returned to the AI.
How It Works
- AI assistant calls the
ask_humantool - MCP server creates a thread in the specified Discord channel (or uses existing thread)
- Posts the question and mentions the specified user
- Waits for user’s reply
- Returns the reply content to the AI assistant
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"human-in-the-loop": {
"command": "human-in-the-loop",
"args": [
"--discord-channel-id", "channel-id",
"--discord-user-id", "user-id"
],
"env": {
"DISCORD_TOKEN": "your-discord-bot-token"
}
}
}
}