mcp-server_ai-interaction
💡 摘要
一个现代的AI交互工具,通过先进的用户界面功能和多语言支持提升用户体验。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险;依赖锁定与供应链风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
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.txtorrule_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_interactiontool - 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_ATTACHE
优点
- 用户友好的界面,支持拖放功能
- 支持多语言,便于更广泛的访问
- 强大的文件和图像管理能力
- 与现有AI系统良好集成
缺点
- 需要配置,对于初学者可能较复杂
- 依赖于外部工具,如Claude Desktop
- 图像仅限于本地存储
- 处理大文件时可能存在性能问题
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 KhaiHuynhVN.
