AI Interaction Tool
An AI interaction tool with an advanced UI for the Model Context Protocol (MCP).
AI Interaction Tool - MCP Server
Modern AI interaction tool with advanced UI and powerful features for Model Context Protocol (MCP)
š Core Features
šÆ Main Capabilities
- Interactive UI Popup for content input and conversation control
- File/Folder Attachment from workspace with validation and preview
- š¼ļø Image Attachment System with drag & drop, multi-image support
- Multi-language Support (English/Vietnamese)
- Maximum Cognitive Power activation for peak AI performance
- Tag-based Output Format integrated with system prompt rules
- Workspace-aware Path Processing for cross-project compatibility
š§ New in v2.2.0 (Latest)
- š¼ļø Image Attachment Support with drag & drop functionality
- š”ļø Security Enhanced - secure path storage in user_images directory
- š¾ Persistent Image State - checkbox state saves correctly
- šÆ Multi-image Management - attach, preview, and remove multiple images
- š Database Auto-cleanup - automatic image cleanup when disabled
š§ Previous v2.1.0
- Enhanced UI/UX with modern PyQt5 interface
- Structured Tag-based Output for perfect AI agent integration
- Debounce Configuration with smart auto-save mechanisms
- Cursor IDE Integration with comprehensive setup guide
š Installation & Setup Guide
š„ Step 1: Clone Repository
git clone https://github.com/your-username/AI-interaction.git
cd AI-interaction
š Step 2: Install Python
- Requirement: Python 3.8+
- Download from python.org
- Or use package manager:
# Windows with Chocolatey choco install python # macOS with Homebrew brew install python # Ubuntu/Debian sudo apt update && sudo apt install python3 python3-pip
š¦ Step 3: Install Dependencies
# Using pip
pip install -r requirements.txt
# Or using uv (recommended for performance)
pip install uv
uv pip install -r requirements.txt
āļø Step 4: Configure MCP Server in Claude Desktop
Add the following configuration to Claude Desktop config file:
Config file paths:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
Configuration content:
{
"mcpServers": {
"AI_interaction": {
"command": "python",
"args": ["E:/MCP-servers-github/AI-interaction/mcp_server.py"],
"stdio": true,
"enabled": true
}
}
}
ā ļø Important: Replace E:/MCP-servers-github/AI-interaction/mcp_server.py
with the absolute path to mcp_server.py
on your system.
š§ Step 5: Configure AI Agent Rules (REQUIRED)
For proper AI agent operation with ai_interaction tool, you MUST setup custom instructions:
š How to Add Custom Instructions:
- Open Claude Desktop or access Claude web interface
- Find "Custom Instructions" or "Add custom instructions" in settings
- Copy entire content from one of the rule files:
- š»š³ Vietnamese:
rule_for_ai_VI.txt
- šŗšø English:
rule_for_ai_EN.txt
- š»š³ Vietnamese:
- Paste into custom instructions field and save
šÆ Why This is Necessary:
- ā Behavioral Framework: Rules define how AI agent processes ai_interaction output
- ā Thinking Protocols: Activates high-level thinking patterns for quality responses
- ā Ultra-Enhancement Modes: 10 cognitive modes for maximum performance
- ā
Tag Processing: Reads and processes control tags like
<AI_INTERACTION_CONTINUE_CHAT>
- ā
Continue Logic: Auto-recall ai_interaction when
continue_chat=true
š Rule Files Location:
AI-interaction/
āāā rule_for_ai_VI.txt # Vietnamese rules
āāā rule_for_ai_EN.txt # English rules
āāā ...
ā” Quick Setup Commands:
# View Vietnamese rules content
cat rule_for_ai_VI.txt
# View English rules content
cat rule_for_ai_EN.txt
# Copy to clipboard (Windows)
type rule_for_ai_VI.txt | clip
# Copy to clipboard (macOS)
cat rule_for_ai_VI.txt | pbcopy
# Copy to clipboard (Linux)
cat rule_for_ai_VI.txt | xclip -selection clipboard
š Step 6: Configure Cursor IDE (Recommended)
Cursor is the recommended IDE for AI development with this tool:
š Cursor Setup Steps:
- Download Cursor: https://cursor.sh/
- Install and open workspace: Open AI-interaction folder
- Configure MCP in Cursor:
- Open Command Palette (
Cmd/Ctrl + Shift + P
) - Search "Configure MCP Servers"
- Add AI_interaction server config
- Open Command Palette (
- Setup custom instructions:
- Copy content from
rule_for_ai_VI.txt
orrule_for_ai_EN.txt
- Paste into "Custom Instructions" field in custom mode Agent:
- Copy content from
šÆ Cursor Advantages:
- ā Native MCP Support: Built-in integration with MCP servers
- ā AI-First IDE: Optimized for AI development workflows
- ā Real-time Suggestions: Context-aware code completion
- ā Advanced Debugging: Enhanced debugging for MCP tools
- ā Performance: Faster than traditional IDEs for AI projects
š Step 7: Launch and Test
!!! -----> In your terminal: python E:\MCP-servers-github\AI-interaction\main.py --ui
ā ļø Important: Replace E:/MCP-servers-github/AI-interaction/mcp_server.py
with the absolute path to mcp_server.py
on your system.
---> AUTO SHOW UI:
- Restart Claude Desktop/Cursor after configuring MCP server
- Test connection by calling
ai_interaction
tool - Test UI popup to verify functionality
- Validate rule integration through AI agent responses
š¦ Package Structure
AI-interaction/
āāā ai_interaction_tool/ # Main interaction tool package
ā āāā core/ # Core dialog and configuration
ā ā āāā dialog.py # InputDialog with PyQt5 UI
ā ā āāā config.py # Configuration management
ā āāā ui/ # Interface and styling
ā ā āāā file_dialog.py # File attachment dialogs
ā ā āāā file_tree.py # File system tree view
ā ā āāā image_attachment.py # š¼ļø Image attachment with drag & drop
ā ā āāā styles.py # Modern UI styling
ā āāā utils/ # Utilities and multi-language
ā ā āāā translations.py # Multi-language support
ā ā āāā file_utils.py # File operation utilities
ā āāā engine.py # Main entry point
ā āāā description.py # Detailed tool description
ā āāā __init__.py # Package exports
āāā user_images/ # š”ļø Secure image storage directory
āāā main.py # Legacy entry point
āāā mcp_server.py # MCP server implementation
āāā requirements.txt # Python dependencies
āāā pyproject.toml # Project configuration
āāā README.md # This file
š® Usage Guide
Available Tools in MCP Server
1. ai_interaction: Main Interactive Tool
- Function: Creates UI popup for user input with file/image attachment
- Output: Structured tag-based format with image support
- Integration: Perfect integration with system prompt rules
- Use cases:
- Input complex content with formatting
- Attach files/folders from workspace
- š¼ļø Attach images with drag & drop functionality
- š· Multi-image support with preview and management
- Control AI thinking modes and reasoning levels
Basic Usage Examples
# Programmatic usage
from ai_interaction_tool import ai_interaction
# Launch interactive interface
result = ai_interaction()
print(result) # Structured output with tags
š¼ļø Image Attachment Features
š· Core Image Capabilities
- Drag & Drop Support: Drag images directly into the UI
- Multi-image Management: Attach, preview, and remove multiple images
- Format Support: PNG, JPG, JPEG, GIF, BMP, WEBP
- Secure Storage: Images stored safely in
user_images/
directory - Base64 Encoding: Automatic conversion for AI processing
- Preview System: Click images to view larger versions
- Persistent State: Save images option with checkbox persistence
šÆ How to Use Image Attachment
- Attach Button: Click "š· Attach Images" to select files
- Drag & Drop: Drag images from file explorer directly to UI
- Paste Support: Paste images from clipboard (Ctrl+V)
- Multiple Images: Attach as many images as needed
- Remove Images: Click X button on individual image previews
- Clear All: Use "šļø Clear Images" to remove all at once
- Save Toggle: Check/uncheck "Save images" to control persistence
š”ļø Security & Privacy
- Local Only: All images stored locally in
user_images/
- No External Access: No uploads or external connections
- Relative Paths: Only relative paths stored in config for security
- User Control: Users control what images to attach and save
- Auto-cleanup: Images automatically cleaned when save disabled
Output Format
AI Interaction Tool uses clean tag-based format:
User message content with natural line breaks
<AI_INTERACTION_ATTACHED_FILES>
FOLDERS:
- workspace_name/relative/path/to/folder
FILES:
- workspace_name/relative/path/to/file.js
</AI_INTERACTION_ATTACHED_FILES>
<AI_INTERACTION_WORKSPACE>workspace_name</AI_INTERACTION_WORKSPACE>
<AI_INTERACTION_CONTINUE_CHAT>true/false</AI_INTERACTION_CONTINUE_CHAT>
Note: When images are attached, they are automatically converted to base64 format and included in the response for AI processing.
š§ Troubleshooting
Common Issues
-
"Command not found" error
- Check Python is installed and in PATH
- Verify absolute path in MCP config
-
"Module not found" error
- Run
pip install -r requirements.txt
- Check virtual environment if using one
- Run
-
UI not displaying
- Ensure PyQt5 is installed correctly
- Check display settings and desktop environment
-
File attachment not working
- Verify file permissions and access rights
- Check workspace path configuration
-
š¼ļø Image attachment issues
- Ensure PyQt5 is properly installed for image processing
- Check
user_images/
directory permissions - Verify image formats: PNG, JPG, JPEG, GIF, BMP, WEBP supported
- Clear config if images not loading: Remove
last_attached_images
from config.json
-
MCP Connection Issues in Cursor
- Verify MCP server configuration in Cursor settings
- Check process running with
ps aux | grep mcp_server
- Restart Cursor after config changes
Debug Mode
To debug issues, run server directly:
python mcp_server.py
For Cursor debugging:
# Check MCP server logs in Cursor
# Open Developer Tools ā Console
# Look for MCP connection messages
š Version History
- v2.2.0 (Latest): š¼ļø Image Attachment System - Complete image support with drag & drop, multi-image management, security enhancements, and persistent state
- v2.1.0: Enhanced UI/UX, Cursor IDE integration, Debounce config system
- v2.0.0: Refactored architecture with modern PyQt5 UI
- v1.x: Core functionality and basic features
šÆ v2.2.0 Detailed Changes:
- ā Image Attachment UI: Full drag & drop interface with preview system
- ā Multi-format Support: PNG, JPG, JPEG, GIF, BMP, WEBP compatibility
- ā Security Hardening: Secure path storage, local-only processing
- ā Database Management: Auto-cleanup, persistent storage, state management
- ā UX Improvements: Click-to-enlarge, remove buttons, checkbox persistence
- ā Performance: Optimized image loading with base64 conversion
- ā Bug Fixes: Checkbox state persistence, config loading issues resolved
šÆ Integration Workflow & System Architecture
š Complete Integration Flow:
[User Input] ā [ai_interaction Tool] ā [Tag-based Output] ā [AI Agent Rules] ā [Enhanced Response]
ā ā
āāāāāāāāāāāāāāāā [Auto-recall if continue_chat=true] āāāāāāāāāāāāāāāāāāāāāāāāāāā
š§ Cognitive Enhancement System:
- Standard Mode: High-level thinking with 1+ thinking blocks
- Ultra-Enhancement Mode: 10 breakthrough cognitive modes simultaneously
- Quantum Cognitive Mode
- Meta-Cognitive Orchestration
- Expert Persona Simulation
- Time-Dilated Processing
- Systems-Level Integration
- Psychological Priming Mode
- Maximum Cognitive Resource Allocation
- Adversarial Self-Testing Mode
- Obsessive Quality Standards
- Breakthrough Innovation Mode
š Output Tag System:
<AI_INTERACTION_CONTINUE_CHAT>true/false</AI_INTERACTION_CONTINUE_CHAT>
<AI_INTERACTION_ATTACHED_FILES>
FOLDERS:
- workspace_name/relative/path/folder
FILES:
- workspace_name/relative/path/file.ext
</AI_INTERACTION_ATTACHED_FILES>
<AI_INTERACTION_WORKSPACE>workspace_name</AI_INTERACTION_WORKSPACE>
š” Advanced Features & Best Practices
šØ UI/UX Enhancements:
- Responsive Design: Adaptive sizing with minimum 800x700 resolution
- Multi-language Support: Seamless EN/VI switching with persistent config
- Modern PyQt5 Styling: Semantic color system with button properties
- File Drag-Drop: Intuitive file attachment with validation
- Context Menu: Right-click operations for file management
- Debounce Saving: Smart config persistence with QTimer optimization
š§ Technical Specifications:
- Python: 3.8+ required with PyQt5 dependencies
- Memory: Minimum 512MB RAM for UI components
- Storage: ~50MB for tool installation and config
- Platform: Cross-platform (Windows/macOS/Linux) with native styling
- Performance: Event-driven architecture with minimal CPU usage
š Performance Optimization:
- Lazy Loading: Components load only when needed
- Efficient Config: JSON-based with automatic compression
- Resource Management: Proper cleanup and memory management
- Caching Strategy: Workspace state persistence for faster startup
š”ļø Security & Privacy
š Security Features:
- Local Processing: All file operations are local only, no uploads
- Path Validation: Robust security checks for file access
- Sandboxed Execution: Tool runs in controlled environment
- No Data Collection: Zero telemetry or external data transmission
š Privacy Protection:
- Config Encryption: Local config with secure storage options
- File Access Control: User-controlled file attachment permissions
- Workspace Isolation: Project boundaries are enforced
- Audit Trail: Optional logging for security monitoring
š System Requirements & Compatibility
š» Minimum System Requirements:
OS: Windows 10+ / macOS 10.14+ / Ubuntu 18.04+
Python: 3.8 or higher
RAM: 512MB available
Storage: 100MB free space
Display: 1024x768 minimum resolution
šÆ Recommended Setup:
OS: Windows 11 / macOS 12+ / Ubuntu 20.04+
Python: 3.10+ with virtual environment
RAM: 2GB available
Storage: 500MB free space
Display: 1920x1080 or higher
GPU: Optional for enhanced UI rendering
š§ Compatibility Matrix:
Component | Version | Status | Notes |
---|---|---|---|
Python | 3.8-3.11 | ā Tested | Recommended 3.10+ |
PyQt5 | 5.15+ | ā Required | Core UI framework |
Claude Desktop | Latest | ā Optimized | MCP integration |
Cursor IDE | Latest | š Recommended | AI-first development |
VS Code | Any | ā Compatible | Alternative IDE option |
š¤ Contributing
Note: This is a private repository. Only the owner has push access.
For suggestions or issues:
- Create detailed issue reports
- Provide reproduction steps
- Include system information
- Attach relevant logs or screenshots
š Documentation & Resources
š Documentation Files:
rule_for_ai_VI.txt
- Vietnamese agent behavior rulesrule_for_ai_EN.txt
- English agent behavior rulesSYSTEM_PROMPT_Claude-4-sonnet-max.txt
- Full system prompt examplepyproject.toml
- Project configuration and dependencies
š Useful Links:
- Model Context Protocol (MCP) Documentation
- Claude Desktop Official Guide
- Cursor IDE Official Site
- PyQt5 Documentation
- Python Virtual Environments
š” Related Projects:
- https://github.com/KhaiHuynhVN/mcp-server-agent-comm
š License & Legal
š License:
MIT License
Copyright (c) 2025 DemonVN - AI Interaction Tool
āļø Legal Notes:
- Tool complies with local processing requirements
- No personal data collection
- Respects user privacy and data sovereignty
- Compatible with enterprise security policies
šÆ Special Thanks:
- Model Context Protocol team for standardized interface
- Claude Desktop integration ecosystem
- Cursor IDE team for AI-first development tools
- Open source Python community
- Beta testers and early adopters
š„ Inspiration:
Project inspired by the need for seamless AI interaction tools with modern UX principles and professional-grade architecture.
š Happy Coding with AI Interaction Tool!
For support, issues, or feature requests, please open an issue on the GitHub repository.
Related Servers
Facebook Ads
MCP server acting as an interface to the Facebook Ads, enabling programmatic access to Facebook Ads data and management features.
Email
This server enables users to send emails through various email providers, including Gmail, Outlook, Yahoo, Sina, Sohu, 126, 163, and QQ Mail. It also supports attaching files from specified directories, making it easy to upload attachments along with the email content.
Unichat
A unified interface for various chat AI models including OpenAI, MistralAI, Anthropic, and Google AI, requiring vendor API keys.
Smartlead
Manage Smartlead campaigns, including creation, updates, and sequence management, using the Smartlead API.
MCP Telegram Server
An MCP server for interacting with Telegram. It allows searching, sending messages, and managing chats using the Telegram API.
Freshdesk MCP Server
An MCP server for interacting with the Freshdesk API v2, enabling management of customer support tickets and contacts.
MCP Intercom Server
Provides access to Intercom conversations and chats. Requires an Intercom API key.
CData Google Contacts
A read-only MCP server for Google Contacts, powered by the CData JDBC Driver.
Slack
An MCP server for interacting with the Slack API, allowing for sending messages, managing channels, and other workspace actions.
WhatsApp Web
An MCP server for interacting with WhatsApp Web, allowing you to send and receive messages.