MCPComputerUse
A native C# MCP server for Windows automation using direct Windows API integration. It runs as a self-contained executable with no additional runtime required.
MCPComputerUse - C# Computer Use MCP Server
A native C# implementation of a Computer Use MCP Server for Windows, providing superior automation capabilities through direct Windows API integration.
🚀 Features
- Screenshot Capture: Multi-monitor support with flexible targeting
- Window Management: Complete window enumeration and control
- Mouse Automation: Precise clicking, moving, and scrolling
- Keyboard Automation: Text typing and key combinations
- Macro System: Complex automation sequences
- MCP Protocol: Full compliance with MCP specification
- High Performance: Native Windows API integration
- Zero Dependencies: Self-contained executable
🛠️ Tools Available
Screenshot Tools
computer-use:take_screenshot- Take screenshots with flexible targeting- Support for multi-monitor setups
- Window-specific captures
- Configurable output formats
Window Management
computer-use:list_windows- List all visible windowscomputer-use:get_active_window- Get currently active window infocomputer-use:focus_window- Focus a window by ID or namecomputer-use:manage_window- Minimize, maximize, restore windows
Input Automation
computer-use:mouse_click- Click at coordinates with button optionscomputer-use:mouse_move- Move mouse to coordinatescomputer-use:type_text- Type text with Unicode supportcomputer-use:press_key- Press keys with modifier supportcomputer-use:scroll- Scroll at specific coordinates
Macro System
computer-use:run_macro- Execute complex automation sequences- Support for all automation actions
- Error handling and reporting
- Configurable timing
System Info
computer-use:get_server_capabilities- Get server capabilities and status
🏗️ Architecture
Core Components
- MCPComputerUse.exe - Main console application with MCP protocol
- WindowsAutomation.dll - Native Windows API automation library
- MCPProtocol.dll - MCP specification implementation
Technology Stack
- .NET 8.0 - Latest LTS framework
- Windows Forms - For screen capture support
- System.Drawing - Image manipulation
- Newtonsoft.Json - JSON serialization
- Native Windows APIs - Direct P/Invoke integration
📦 Installation
Prerequisites
- Windows 10 or Windows 11
- No additional runtime required (self-contained)
Download
- Download the latest release from GitHub
- Extract
MCPComputerUse.exeto your desired location - No installation required - single executable file
Claude Desktop Integration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"computer-use": {
"command": "c:/path/to/MCPComputerUse.exe",
"args": []
}
}
}
🔧 Building from Source
Requirements
- Visual Studio 2022 or VS Code with C# extension
- .NET 8.0 SDK
- Windows 10/11 development machine
Build Steps
# Clone the repository
git clone <repository-url>
cd MCPComputerUse
# Restore dependencies
dotnet restore
# Build solution
dotnet build --configuration Release
# Publish self-contained executable
dotnet publish src/MCPComputerUse -c Release -r win-x64 --self-contained -o ./publish
The resulting executable will be in the ./publish folder.
📖 Usage Examples
Taking Screenshots
{
"method": "tools/call",
"params": {
"name": "computer-use:take_screenshot",
"arguments": {
"target": "screen",
"filename": "desktop_capture"
}
}
}
Automating Mouse Clicks
{
"method": "tools/call",
"params": {
"name": "computer-use:mouse_click",
"arguments": {
"x": 500,
"y": 300,
"button": "left",
"clicks": 2
}
}
}
Running Macros
{
"method": "tools/call",
"params": {
"name": "computer-use:run_macro",
"arguments": {
"commands": [
{
"action": "click",
"x": 100,
"y": 100
},
{
"action": "type",
"text": "Hello World"
},
{
"action": "key",
"key": "enter"
}
]
}
}
}
🔍 Troubleshooting
Common Issues
Permission Errors
- Ensure the executable has permission to capture screens
- Some applications may require running as administrator
Window Focus Issues
- UAC-protected applications may not respond to focus commands
- Try using window IDs instead of window titles for better reliability
Screenshot Capture Problems
- Check display index for multi-monitor setups
- Verify target window exists and is visible
Logging
The application logs to console output. Use the following log levels:
- Information: General operation status
- Debug: Detailed execution information
- Error: Error conditions and failures
🚀 Performance
Benchmarks
- Screenshot capture: <100ms for 1920x1080
- Window enumeration: <50ms for 100 windows
- Mouse/keyboard actions: <10ms per action
- Macro execution: 100ms between commands (configurable)
Memory Usage
- Base memory: <50MB
- Per screenshot: <10MB temporary
- Window caching: <5MB
🔒 Security
Permissions
- No elevation required for basic operations
- Screen capture permissions may be requested by Windows
- Input simulation works with most applications
Safety Features
- Coordinate validation prevents out-of-bounds operations
- Rate limiting prevents input flooding
- Emergency stop sequences available
🤝 Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request
Development Setup
# Clone your fork
git clone <your-fork-url>
cd MCPComputerUse
# Install dependencies
dotnet restore
# Run tests
dotnet test
# Start development
code .
📋 Roadmap
Upcoming Features
- OCR Integration - Text recognition from screenshots
- Image Matching - Find UI elements by template
- Macro Recording - Record user actions automatically
- Plugin System - Extensible architecture
- UI Automation - Windows accessibility API integration
Performance Improvements
- Async Operations - Better responsiveness
- Caching - Reduced API calls
- Optimization - Faster screenshot capture
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Microsoft for the .NET platform
- Anthropic for the MCP specification
- The open-source community for inspiration and libraries
📞 Support
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting guide
- Review existing issues and discussions
Built with ❤️ for the Windows automation community
Related Servers
n8n
Provides AI assistants with direct access to the n8n automation platform.
HubSpot MCP Server
Interact with the HubSpot CRM API for sales analysis and insights.
SSE Calculator
A stateful calculator server using Server-Sent Events (SSE) for real-time communication.
MCP Redmine
A server integration for the Redmine project management tool.
TalkToAnki
Seamlessly integrate the Anki flashcard application with AI assistants. Requires Anki desktop with the AnkiConnect plugin.
MCP Chatbot
An intelligent chatbot for automating tasks like browser control, web searches, and travel planning.
Web Whiteboard
A web-based whiteboard for displaying output from Chatbots and LLMs.
Atlassian Jira
Integrates AI with Atlassian Jira to manage projects, search for issues, and view development information like commits and pull requests.
Tachikoma Router Management MCP
Manage various router types using natural language. Requires router credentials to be configured.
Rememberizer Common Knowledge
Access personal and team knowledge repositories, including documents and Slack discussions.