Windows MCP Server

Windows MCP Server

Enables comprehensive Windows desktop automation including screen capture, OCR text extraction, mouse/keyboard control, window management, process control, and clipboard operations through 25+ tools for AI agents.

Category
访问服务器

README

Windows MCP Server

Comprehensive Windows automation MCP server for AI agents

Full control over Windows desktop applications with 25+ tools: screenshots, OCR, mouse/keyboard control, window management, process control, clipboard operations, and more.

Features

Screen Capture

  • Full screen screenshots
  • Window-specific capture
  • Region capture

OCR (Optical Character Recognition)

  • Full screen text extraction
  • Region-based OCR
  • Powered by Tesseract

Mouse Control

  • Click (left/right/middle)
  • Double-click
  • Drag and drop
  • Mouse movement with duration
  • Scroll (up/down)
  • Get mouse position

Keyboard Control

  • Type text with configurable speed
  • Press individual keys
  • Execute hotkey combinations (Ctrl+C, Alt+F4, etc.)
  • Full keyboard shortcuts support

Clipboard

  • Copy text to clipboard
  • Paste/read clipboard content
  • Seamless clipboard integration

Window Management

  • List all open windows
  • Focus/activate windows
  • Close windows
  • Minimize/maximize/restore
  • Resize windows
  • Move windows
  • Get window details (position, size, state)

Process Management

  • List running processes with PIDs
  • Filter processes by name
  • Kill processes by PID
  • Memory usage monitoring

Installation

Prerequisites

  1. Python 3.10+ installed
  2. Tesseract OCR for text recognition:
    • Download: https://github.com/UB-Mannheim/tesseract/wiki
    • Install to default location or add to PATH
    • Verify: tesseract --version

Install Package

Option 1: Install from PyPI (Recommended)

pip install win32-mcp-server

Option 2: Install from GitHub

pip install git+https://github.com/RandyNorthrup/win32-mcp-server.git

Option 3: Install from source

# Clone repository
git clone https://github.com/RandyNorthrup/win32-mcp-server.git
cd win32-mcp-server

# Install with dependencies
pip install -e .

Configuration

VS Code with GitHub Copilot

After installing via pip, add to your MCP configuration (%APPDATA%\Code\User\mcp.json):

{
  "servers": {
    "win32-inspector": {
      "type": "stdio",
      "command": "win32-mcp-server"
    }
  }
}

Or install from VS Code MCP Extensions:

  1. Open VS Code
  2. Press Ctrl+Shift+P
  3. Type "MCP: Install Server"
  4. Search for "Windows Automation Inspector"
  5. Click Install

Claude Desktop

After installing via pip, add to %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "win32-inspector": {
      "command": "win32-mcp-server"
    }
  }
}

Other MCP Clients

The server uses STDIO transport and works with any MCP-compatible client that supports stdio.

Usage Examples

Capture Screenshot

"Capture screenshot of the window titled 'Compliance Guard'"

OCR Text Extraction

"Extract text from the screen using OCR"
"OCR the region at x=100, y=100, width=500, height=300"

Automate UI Interactions

"Click at coordinates (500, 300)"
"Double-click the button at (450, 250)"
"Drag from (100, 100) to (500, 500)"

Keyboard Automation

"Type 'Hello World' at the current cursor position"
"Press Ctrl+C to copy"
"Execute Alt+F4 to close the window"

Window Management

"List all open windows"
"Focus the window titled 'Visual Studio Code'"
"Maximize the Chrome window"
"Resize Notepad to 800x600"

Process Control

"List all running processes"
"Show processes containing 'chrome'"
"Kill process with PID 1234"

Available Tools

Tool Description
capture_screen Capture full screen screenshot
capture_window Capture specific window by title
list_windows List all open windows with details
ocr_screen Extract text from full screen
ocr_region Extract text from specified region
click Click at coordinates (left/right/middle)
double_click Double-click at coordinates
drag Drag from start to end coordinates
type_text Type text at current position
press_key Press keyboard key or shortcut
hotkey Execute hotkey combination
clipboard_copy Copy text to clipboard
clipboard_paste Get clipboard content
mouse_position Get current mouse position
mouse_move Move mouse to position
scroll Scroll up/down
list_processes List running processes with PIDs
kill_process Terminate process by PID
focus_window Activate window
close_window Close window by title
minimize_window Minimize window
maximize_window Maximize window
restore_window Restore window
resize_window Resize window
move_window Move window position

Security Considerations

WARNING: This server has powerful system control capabilities including:

  • Mouse and keyboard control
  • Process termination
  • Clipboard access
  • Screen capture

Only use in trusted environments where you control the MCP client.

Recommended Security Practices

  1. Restrict Usage: Only enable when actively needed
  2. Review Logs: Monitor all automated actions
  3. Sandbox Testing: Test in isolated environments first
  4. Access Control: Limit who can access the MCP client
  5. Disable PyAutoGUI Failsafe: Server disables failsafe for automation - be cautious

Troubleshooting

Tesseract Not Found

TesseractNotFoundError: tesseract is not installed

Solution: Install Tesseract OCR from https://github.com/UB-Mannheim/tesseract/wiki

Permission Errors

PermissionError: [WinError 5] Access is denied

Solution: Run VS Code or MCP client as Administrator for process control features

Module Not Found

ModuleNotFoundError: No module named 'mcp'

Solution: Reinstall dependencies: pip install -e .

Window Not Found

Window not found: [title]

Solution: Use partial window title matching. Check exact title with list_windows first.

Development

Project Structure

win32-mcp-server/
├── server.py          # Main MCP server implementation
├── pyproject.toml     # Package configuration
├── README.md          # This file
└── LICENSE            # MIT License

Dependencies

  • mcp: Model Context Protocol SDK
  • mss: Cross-platform screen capture
  • Pillow: Image processing
  • pyautogui: Mouse and keyboard automation
  • pygetwindow: Window management
  • pyperclip: Clipboard operations
  • pytesseract: OCR text extraction
  • psutil: Process management

License

MIT License - see LICENSE file

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Links

  • Repository: https://github.com/RandyNorthrup/win32-mcp-server
  • Issues: https://github.com/RandyNorthrup/win32-mcp-server/issues
  • MCP Documentation: https://modelcontextprotocol.io/

Support

For bugs and feature requests, please use GitHub Issues.

Credits

Author: Randy Northrup
GitHub: @RandyNorthrup

Built with Python, MCP SDK, and the following open-source libraries:


Made for Windows automation and AI agents

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选