Enable Human-AI Interaction via GUI
An MCP server that lets AI assistants pause and ask humans for input via native cross-platform GUI dialogs - text, choices, and confirmations.
Maintainer of this project? Claim this page to edit the listing.
1.0.0Add to Favorites
Why it matters
Bridge the gap between AI processes and human decision-making. This MCP server allows AI assistants like Claude to interact with users through intuitive GUI dialogs for input, selection, confirmation, and feedback.
Outcomes
What it gets done
Collect user input with validation (text, numbers, choices, multi-line).
Display confirmations and informational messages to the user.
Integrate with AI assistants to facilitate human-in-the-loop operations.
Provide a modern, cross-platform GUI for seamless interaction.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-human-in-the-loop | bash Capabilities
Tools your agent gets
Get single-line text, numbers, or other data from users with validation
Present multiple options for single or multiple selection by the user
Collect long text content, code, or detailed descriptions
Request yes/no confirmation before performing actions
Display information, notifications, status updates, and results
Monitor server status and GUI availability
Overview
Human-In-the-Loop MCP Server
An MCP server that pauses AI agent workflows to ask a human for input via native cross-platform GUI dialogs - text, multiple choice, multi-line, and yes/no confirmations. Every dialog runs non-blocking in a separate thread with a 5-minute timeout and returns a structured JSON response. Use it when an agent hits a genuine decision point - ambiguous requirements, sensitive operations, missing information, or subjective creative choices - not for fully automated, headless, or high-frequency pipelines that can't wait on a human.
What it does
Human-In-the-Loop MCP Server is an MCP server that enables AI assistants like Claude to interact with humans through native GUI dialogs, bridging automated AI processes and human decision-making with real-time input tools, choices, confirmations, and feedback mechanisms. Its interactive dialog tools cover text input with validation, multiple-choice selection (single or multi-select), multi-line input for longer text or code, yes/no confirmation dialogs, and information messages for notifications and status updates, plus a health_check tool for monitoring server and GUI availability. It renders native-styled GUIs per platform - a Windows 11-style interface with hover effects on Windows, an SF Pro Display-fonted native experience on macOS, and an Ubuntu-compatible modern GUI on Linux - and runs every dialog in a separate thread so it never blocks, with a configurable 5-minute timeout that returns a cancelled response if the user doesn't respond in time.
When to use - and when NOT to
Use this MCP server when an AI agent hits a point where it genuinely needs a human in the loop rather than guessing: ambiguous requirements where instructions are unclear, decision points needing a preference between valid alternatives, subjective creative input like design or content style, sensitive or potentially destructive operations that deserve a confirmation gate, missing information the agent needs but wasn't given, or quality feedback validating an intermediate result before continuing. It requires a real desktop environment - it will not work headless, since the GUI dialogs need tkinter and an actual display; on macOS specifically, Python needs Accessibility permission granted in System Preferences > Security & Privacy for the dialogs to appear. It is not meant for high-frequency or fully automated pipelines - every dialog blocks that specific interaction thread for up to 5 minutes waiting on a human, which is the opposite of what a fully unattended pipeline needs.
Capabilities
The server exposes six tools: get_user_input (single-line text, integer, or float input with a title, prompt, and optional default value), get_user_choice (presents a list of choices with an allow_multiple flag for single or multi-select), get_multiline_input (collects longer text, code, or detailed descriptions), show_confirmation_dialog (a yes/no gate before proceeding with an action), show_info_message (displays a notification or status update with no user response required beyond acknowledgment), and health_check (reports platform and GUI functionality status). Every tool returns a structured JSON response with success, cancelled, and platform fields, plus tool-specific fields like selected_choice for get_user_choice or character_count/line_count for get_multiline_input.
How to install
uvx hitl-mcp-server
The recommended install path is running the server directly via uvx, with pip install hitl-mcp-server as a manual alternative, or cloning the GongRzhe/Human-In-the-Loop-MCP-Server repository and installing in development mode (pip install -e .) for contributors. Claude Desktop configuration is a standard mcpServers block pointing at the uvx or hitl-mcp-server command in claude_desktop_config.json, whose location differs by OS (AppData on Windows, Application Support on macOS, ~/.config on Linux). The project requires Python 3.8+, is built on the FastMCP framework with Pydantic for data validation and tkinter for the cross-platform GUI, and is licensed under the MIT License.
Who it's for
Developers building AI agent workflows in Claude Desktop or another MCP client who need the agent to pause for real human judgment at genuine decision points - not fully automate away confirmation before destructive actions or resolve genuinely ambiguous instructions on its own. It suits desktop-based agent setups specifically, since the dialogs require an actual GUI environment and won't function in headless server deployments.
Source README
Human-In-the-Loop MCP Server
A powerful Model Context Protocol (MCP) Server that enables AI assistants like Claude to interact with humans through intuitive GUI dialogs. This server bridges the gap between automated AI processes and human decision-making by providing real-time user input tools, choices, confirmations, and feedback mechanisms.
๐ Features
๐ฌ Interactive Dialog Tools
- Text Input: Get text, numbers, or other data from users with validation
- Multiple Choice: Present options for single or multiple selections
- Multi-line Input: Collect longer text content, code, or detailed descriptions
- Confirmation Dialogs: Ask for yes/no decisions before proceeding with actions
- Information Messages: Display notifications, status updates, and results
- Health Check: Monitor server status and GUI availability
๐จ Modern Cross-Platform GUI
- Windows: Modern Windows 11-style interface with beautiful styling, hover effects, and enhanced visual design
- macOS: Native macOS experience with SF Pro Display fonts and proper window management
- Linux: Ubuntu-compatible GUI with modern styling and system fonts
โก Advanced Features
- Non-blocking Operation: All dialogs run in separate threads to prevent blocking
- Timeout Protection: Configurable 5-minute timeouts prevent hanging operations
- Platform Detection: Automatic optimization for each operating system
- Modern UI Design: Beautiful interface with smooth animations and hover effects
- Error Handling: Comprehensive error reporting and graceful recovery
- Keyboard Navigation: Full keyboard shortcuts support (Enter/Escape)
๐ฆ Installation & Setup
Quick Install with uvx (Recommended)
The easiest way to use this MCP server is with uvx:
# Install and run directly
uvx hitl-mcp-server
# Or use the underscore version
uvx hitl_mcp_server
Manual Installation
Install from PyPI:
pip install hitl-mcp-serverRun the server:
hitl-mcp-server # or hitl_mcp_server
Development Installation
Clone the repository:
git clone https://github.com/GongRzhe/Human-In-the-Loop-MCP-Server.git cd Human-In-the-Loop-MCP-ServerInstall in development mode:
pip install -e .
๐ง Claude Desktop Configuration
To use this server with Claude Desktop, add the following configuration to your claude_desktop_config.json:
Using uvx (Recommended)
{
"mcpServers": {
"human-in-the-loop": {
"command": "uvx",
"args": ["hitl-mcp-server"]
}
}
}
Using pip installation
{
"mcpServers": {
"human-in-the-loop": {
"command": "hitl-mcp-server",
"args": []
}
}
}
Configuration File Locations
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Important Note for macOS Users
Note: You may need to allow Python to control your computer in System Preferences > Security & Privacy > Accessibility for the GUI dialogs to work properly.
After updating the configuration, restart Claude Desktop for the changes to take effect.
๐ ๏ธ Available Tools
1. get_user_input
Get single-line text, numbers, or other data from users.
Parameters:
title(str): Dialog window titleprompt(str): Question/prompt textdefault_value(str): Pre-filled value (optional)input_type(str): "text", "integer", or "float" (default: "text")
Example Usage:
result = await get_user_input(
title="Project Setup",
prompt="Enter your project name:",
default_value="my-project",
input_type="text"
)
2. get_user_choice
Present multiple options for user selection.
Parameters:
title(str): Dialog window titleprompt(str): Question/prompt textchoices(List[str]): Available optionsallow_multiple(bool): Allow multiple selections (default: false)
Example Usage:
result = await get_user_choice(
title="Framework Selection",
prompt="Choose your preferred framework:",
choices=["React", "Vue", "Angular", "Svelte"],
allow_multiple=False
)
3. get_multiline_input
Collect longer text content, code, or detailed descriptions.
Parameters:
title(str): Dialog window titleprompt(str): Question/prompt textdefault_value(str): Pre-filled text (optional)
Example Usage:
result = await get_multiline_input(
title="Code Review",
prompt="Please provide your detailed feedback:",
default_value=""
)
4. show_confirmation_dialog
Ask for yes/no confirmation before proceeding.
Parameters:
title(str): Dialog window titlemessage(str): Confirmation message
Example Usage:
result = await show_confirmation_dialog(
title="Delete Confirmation",
message="Are you sure you want to delete these 5 files? This action cannot be undone."
)
5. show_info_message
Display information, notifications, or status updates.
Parameters:
title(str): Dialog window titlemessage(str): Information message
Example Usage:
result = await show_info_message(
title="Process Complete",
message="Successfully processed 1,247 records in 2.3 seconds!"
)
6. health_check
Check server status and GUI availability.
Example Usage:
status = await health_check()
# Returns detailed platform and functionality information
๐ Response Format
All tools return structured JSON responses:
{
"success": true,
"user_input": "User's response text",
"cancelled": false,
"platform": "windows",
"input_type": "text"
}
Common Response Fields:
success(bool): Whether the operation completed successfullycancelled(bool): Whether the user cancelled the dialogplatform(str): Operating system platformerror(str): Error message if operation failed
Tool-Specific Fields:
- get_user_input:
user_input,input_type - get_user_choice:
selected_choice,selected_choices,allow_multiple - get_multiline_input:
user_input,character_count,line_count - show_confirmation_dialog:
confirmed,response - show_info_message:
acknowledged
๐ง Best Practices for AI Integration
When to Use Human-in-the-Loop Tools
- Ambiguous Requirements - When user instructions are unclear
- Decision Points - When you need user preference between valid alternatives
- Creative Input - For subjective choices like design or content style
- Sensitive Operations - Before executing potentially destructive actions
- Missing Information - When you need specific details not provided
- Quality Feedback - To get user validation on intermediate results
Example Integration Patterns
File Operations
# Get target directory
location = await get_user_input(
title="Backup Location",
prompt="Enter backup directory path:",
default_value="~/backups"
)
# Choose backup type
backup_type = await get_user_choice(
title="Backup Options",
prompt="Select backup type:",
choices=["Full Backup", "Incremental", "Differential"]
)
# Confirm before proceeding
confirmed = await show_confirmation_dialog(
title="Confirm Backup",
message=f"Create {backup_type['selected_choice']} backup to {location['user_input']}?"
)
if confirmed['confirmed']:
# Perform backup
await show_info_message("Success", "Backup completed successfully!")
Content Creation
# Get content requirements
requirements = await get_multiline_input(
title="Content Requirements",
prompt="Describe your content requirements in detail:"
)
# Choose tone and style
tone = await get_user_choice(
title="Content Style",
prompt="Select desired tone:",
choices=["Professional", "Casual", "Friendly", "Technical"]
)
# Generate and show results
# ... content generation logic ...
await show_info_message("Content Ready", "Your content has been generated successfully!")
๐ Troubleshooting
Common Issues
GUI Not Appearing
- Verify you're running in a desktop environment (not headless server)
- Check if tkinter is installed:
python -c "import tkinter" - Run health check:
health_check()tool to diagnose issues
Permission Errors (macOS)
- Grant accessibility permissions in System Preferences > Security & Privacy > Accessibility
- Allow Python to control your computer
- Restart terminal after granting permissions
Import Errors
- Ensure package is installed:
pip install hitl-mcp-server - Check Python version compatibility (>=3.8 required)
- Verify virtual environment activation if using one
Claude Desktop Integration Issues
- Check configuration file syntax and location
- Restart Claude Desktop after configuration changes
- Verify uvx is installed:
pip install uvx - Test server manually:
uvx hitl-mcp-server
Dialog Timeout
- Default timeout is 5 minutes (300 seconds)
- Dialogs will return with cancelled=true if user doesn't respond
- Ensure user is present when dialogs are triggered
Debug Mode
Enable detailed logging by running the server with environment variable:
HITL_DEBUG=1 uvx hitl-mcp-server
๐๏ธ Development
Project Structure
Human-In-the-Loop-MCP-Server/
โโโ human_loop_server.py # Main server implementation
โโโ pyproject.toml # Package configuration
โโโ README.md # Documentation
โโโ LICENSE # MIT License
โโโ .gitignore # Git ignore rules
โโโ demo.gif # Demo animation
Code Quality
- Formatting: Black (line length: 88)
- Linting: Ruff with comprehensive rule set
- Type Checking: MyPy with strict configuration
- Testing: Pytest for unit and integration tests
๐ Platform Support
Windows
- Windows 10/11 with modern UI styling
- Enhanced visual design with hover effects
- Segoe UI and Consolas font integration
- Full keyboard navigation support
macOS
- Native macOS experience
- SF Pro Display system fonts
- Proper window management and focus
- Accessibility permission handling
Linux
- Ubuntu/Debian compatible
- Modern styling with system fonts
- Cross-distribution GUI support
- Minimal dependency requirements
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Acknowledgments
- Built with FastMCP framework
- Uses Pydantic for data validation
- Cross-platform GUI powered by tkinter
- Inspired by the need for human-AI collaboration
๐ Links
- PyPI Package: https://pypi.org/project/hitl-mcp-server/
- Repository: https://github.com/GongRzhe/Human-In-the-Loop-MCP-Server
- Issues: Report bugs or request features
- MCP Protocol: Learn about Model Context Protocol
๐ Usage Statistics
- Cross-Platform: Windows, macOS, Linux
- Python Support: 3.8, 3.9, 3.10, 3.11, 3.12+
- GUI Framework: tkinter (built-in with Python)
- Thread Safety: Full concurrent operation support
- Response Time: < 100ms dialog initialization
- Memory Usage: < 50MB typical operation
Made with โค๏ธ for the AI community - Bridging humans and AI through intuitive interaction
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.