mcp-gui-server
A modern MCP server that provides interactive graphical user interface, terminal command execution, and AI-powered prompt enhancement for MCP-compatible clients.
README
MCP GUI Server
A modern Model Context Protocol (MCP) server that provides elegant graphical user interface interaction capabilities with Interactive Feedback style, terminal support, and advanced prompt engineering features.
Preview
MCP for cost cut of request based ai services
🚀 Quick Start
Option 1: NPX (Recommended for Testing)
Test the server instantly without installation:
npx mcp-gui-server
Option 2: Install from Source
For development or customization:
# Clone the repository
git clone https://github.com/oqwn/mcp-gui-server.git
cd mcp-gui-server
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Start the server
pnpm start
Prerequisites
- Node.js 18+
- pnpm 8+ (recommended package manager)
Install pnpm if you haven't already:
npm install -g pnpm
💼 MCP Client Integration
Step 1: Configure Your MCP Client
Add the following configuration to your MCP client (Claude Desktop, Cursor, Windsurf, etc.), Remember add the model only if you would like a ai model to enhance prompt:
Using NPX (Recommended)
{
"mcpServers": {
"mcp-gui-server": {
"command": "npx",
"args": ["-y", "mcp-gui-server"],
"env": {
"OPENROUTER_API_KEY": "YOUR API KEY",
"OPENROUTER_BASE_URL": "https://openrouter.ai/api/v1",
"OPENROUTER_MODEL": "MODEL YOUR SELECTED"
}
}
}
}
Using Local Installation
before using below mcp configuration you should get this repositiry and run
pnpm run build
{
"mcpServers": {
"gui-server": {
"command": "node",
"args": ["/path/to/dist/server.js", "--stdio"],
"env": {
"OPENROUTER_API_KEY": "YOUR API KEY",
"OPENROUTER_BASE_URL": "https://openrouter.ai/api/v1",
"OPENROUTER_MODEL": "MODEL YOU SELECTED"
}
}
}
}
Step 2: Restart Your MCP Client
After configuration, restart your MCP client to load the server.
Step 3: Test the Integration
In your AI assistant, the gui-input tool should now be available. Test it by asking:
"Please collect some user input via the GUI"
🛠️ Development & Testing
HTTP Mode (Development)
For local development and testing:
pnpm run dev
Server will start on http://localhost:3501 with hot reload.
✨ Features
🎯 Core Capabilities
- 🖥️ Interactive GUI: Beautiful, modern web interface for user input
- 📷 Image Upload Support: Drag & drop or click to upload images (JPG, PNG, GIF, WebP, max 10MB each)
- 💻 Terminal Integration: Execute commands with persistent shell sessions
- 🔄 Real-time Feedback: Interactive workflow with user collaboration
- 🛡️ Session Management: Secure, auto-expiring sessions with cleanup
- 📱 Responsive Design: Works seamlessly on desktop and mobile
- 🎨 Syntax Highlighting: Professional code block rendering
Interactive terminal with persistent shell sessions and command execution
🚀 Advanced Features
- 🧠 Prompt Engineering: Built-in AI-powered prompt enhancement
- 🔌 13+ LLM Providers: OpenAI, Anthropic, Groq, Ollama, and more
- 🌍 Multi-language Support: Maintains language consistency
- ⚡ Hot Reloading: Edit prompts without server restart
- 📊 Error Handling: Robust fallbacks and logging
AI-powered prompt enhancement with multiple LLM providers
📷 Image Upload Features
- 🎯 Intuitive Interface: Upload button integrated with enhance and submit buttons
- 🖱️ Drag & Drop: Drop images directly into the text area for seamless workflow
- 📁 Multiple Formats: Supports JPG, JPEG, PNG, GIF, WebP image formats
- 📏 Size Validation: Maximum 10MB per image with real-time validation
- 🖼️ Preview Grid: Thumbnail previews with file information and remove functionality
- 🤖 AI Compatible: Images properly formatted for multimodal AI model analysis
- 🔒 Secure Processing: Images converted to base64 and included in MCP responses
Drag & drop image upload with preview and validation
🎛️ Optimal AI Assistant Integration
For the best results, add this rule to your AI assistant configuration:
1. Whenever you want to ask a question, always call the MCP gui-input.
2. Whenever you're about to complete a user request, call the MCP gui-input instead of simply ending the process.
3. Keep calling MCP until the user's feedback is empty, then end the request.
Example locations: Cursor rules, Claude Desktop custom instructions, etc.
🏗️ Project Architecture
This project follows modern modular architecture with clear separation of concerns:
mcp-gui-server/
├── src/
│ ├── server.ts # Main MCP server implementation
│ ├── gui-service.ts # Main GUI service orchestrator
│ ├── handlers/ # HTTP request handlers
│ │ ├── base-handler.ts # Base handler class
│ │ ├── gui-handler.ts # GUI interface handling
│ │ ├── command-handler.ts # Terminal command execution
│ │ └── submit-handler.ts # Form submission & LLM integration
│ ├── services/ # Core business logic
│ │ ├── session-service.ts # Session management & cleanup
│ │ ├── llm-service.ts # Multi-provider LLM integration
│ │ └── terminal-service.ts # Shell command execution
│ ├── templates/ # HTML template generation
│ │ └── gui-template.ts # Professional UI templates
│ ├── utils/ # Utility functions
│ │ ├── markdown.ts # Enhanced markdown → HTML
│ │ └── network.ts # Port management utilities
│ └── types/ # TypeScript interfaces
│ └── interfaces.ts # Shared type definitions
├── images/ # Demo GIFs and documentation assets
│ ├── terminal.gif # Terminal feature demonstration
│ ├── enhance.gif # Prompt enhancement demonstration
│ └── upload.gif # Image upload feature demonstration
├── prompts/ # External prompt management
│ ├── system-prompt.md # Main enhancement prompt
├── package.json
├── tsconfig.json
└── README.md
📋 Architecture Benefits
- 🔧 Maintainability: Each module has single responsibility
- 🧪 Testability: Components can be tested in isolation
- ♻️ Reusability: Services can be used across different handlers
- 📈 Scalability: Easy to add new features without affecting existing code
- 📚 Documentation: Clear structure with comprehensive documentation
🐛 Troubleshooting
Port Already in Use
The server automatically finds an available port when the default (3501) is occupied:
⚠️ Port 3501 is in use, searching for available port...
✅ Found available port: 3517
Session Expired
If you see "Session Invalid or Expired":
- Don't access GUI URLs directly
- Use the
gui-inputtool in your MCP client - Check if the session timeout (5 minutes) was exceeded
Terminal Commands Not Working
Ensure the shell process is properly initialized:
- Commands maintain state in persistent shell
- Use standard Unix/Linux commands
- Terminal starts in home directory (~)
NPX Issues
If npx mcp-gui-server fails:
# Clear npm cache
npm cache clean --force
# Try with explicit version
npx mcp-gui-server@latest
# Or install globally
npm install -g mcp-gui-server
mcp-gui-server
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Install dependencies:
pnpm install - Build:
pnpm run build - Submit a pull request
📄 License
MIT License - see LICENSE file for details
💡 Inspiration
This project is inspired by and builds upon:
- Interactive Feedback MCP - The original Interactive Feedback MCP implementation that inspired our UI design and human-in-the-loop workflow
🔗 Related Projects
📞 Support
For issues and feature requests, please use the GitHub issue tracker.
Note: This server is designed to work with MCP-compatible clients. The GUI interface requires proper session management and should not be accessed directly via browser URLs.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。