Bridge MCP

平台与服务

by barhamagha1

Visual Desktop Bridge,让任意AI完整控制Windows,自动化应用操作与输入。

什么是 Bridge MCP

Visual Desktop Bridge,让任意AI完整控制Windows,自动化应用操作与输入。

README

🌉 Bridge MCP

Universal PC Control for Any AI

FastMCP License Python Windows

Give any AI complete control over your Windows PC

FeaturesQuick StartConfigurationToolsTroubleshootingContributing


🔄 How Persistence Works

Bridge MCP v2.0 stores agent registrations in a persistent JSON file:

  • Windows: %APPDATA%\bridge-mcp\agents.json
  • Linux/Mac: ~/.config/bridge-mcp/agents.json

This means:

  • ✅ Register once, works forever
  • ✅ Survives Claude Code session restarts
  • ✅ Survives computer reboots
  • ✅ Works across all AI clients

First-Time Setup

  1. Start the local agent:
bash
   cd Bridge-MCP
   python local_agent.py
  1. The agent auto-registers itself - no manual registration needed!

  2. Verify in any Claude session:

code
   Use list_agents() to see registered agents

Troubleshooting

If you see "No agents connected":

  1. Check if local_agent.py is running - it must be running in a terminal
  2. Check health: Use check_agent_health() tool
  3. Manual register: Use register_agent("local", "http://127.0.0.1:8006", "My PC")

Running Local Agent as Background Service

For always-on access, install local_agent as a Windows service:

bash
python install_service.py install
python install_service.py start

To remove:

bash
python install_service.py stop
python install_service.py remove

🎯 What is Bridge MCP?

Bridge MCP is a Model Context Protocol (MCP) server that gives any AI full control over a Windows PC. Whether you're using Claude, ChatGPT, Cursor, Gemini, or any other MCP-compatible AI, Bridge MCP lets you:

  • 🖥️ Control Applications - Launch, switch, resize, close any app
  • 🖱️ Automate Input - Mouse clicks, keyboard typing, hotkeys, scrolling
  • 📸 See the Screen - Screenshots, UI element detection, desktop state
  • 🌐 Browse the Web - Full Chrome automation and control
  • Run Commands - PowerShell, CMD, file operations
  • 📋 Manage Clipboard - Copy, paste, clear

Think of it as giving your AI eyes and hands to control your computer!


✨ Features

CategoryToolsDescription
🚀 App Control8 toolsLaunch, switch, close, resize, minimize, maximize applications
🖱️ Mouse & Keyboard10 toolsClick, type, hotkeys, scroll, drag, move cursor
📸 Screen Capture7 toolsScreenshots, desktop state, find UI elements
System8 toolsPowerShell, CMD, file read/write, system info
🌐 Browser15 toolsChrome control, tabs, navigation, web scraping
📋 Clipboard3 toolsCopy, paste, clear clipboard
🔧 Utilities5+ toolsWait, dialogs, action sequences

Total: 40+ powerful tools for complete PC automation!


🏗️ Architecture

Bridge MCP uses a Relay Architecture to work across platforms:

code
┌─────────────────┐         ┌─────────────────┐         ┌─────────────────┐
│    Any AI       │         │  Cloud Relay    │         │  Your Windows   │
│  (Claude, etc.) │◄───────►│  (bridge_mcp)   │◄───────►│  PC (Agent)     │
└─────────────────┘         └─────────────────┘         └─────────────────┘
  • bridge_mcp.py - MCP server (runs locally or on FastMCP Cloud)
  • local_agent.py - HTTP server on your PC that executes commands (port 8006)

🔒 Enterprise-Grade Security

Bridge MCP 2.0 includes:

  • Auth Tokens: Uses secure Bearer tokens to prevent unauthorized access.
  • Auto-Config: Tokens are auto-generated and saved to agents.json.

🌐 Next-Gen Browser Automation

Powered by Playwright, Bridge MCP can now:

  • Click & Type: Interact with any website element.
  • Semantic Understanding: Read page content programmatically.
  • Headless Mode: Run automations invisible or visible.

🧠 Semantic Computer Vision

Bridge MCP "sees" your apps:

  • UI Tree: It can read the accessibility tree of Windows apps.
  • Precision: Knows exactly where buttons are (no more guessing pixels).

🛡️ Safety Sentinel (Human-in-the-Loop)

Bridge MCP now puts YOU in control:

  • Command Interception: Dangerous commands (writing files, running shell scripts) are BLOCKED by default.
  • Approval Overlay: Approval requests appear directly in the AI Activity Overlay with three options:
    • APPROVE - Execute this one command
    • DENY - Block this command
    • ALWAYS APPROVE - Disable Safe Mode and approve all future commands
  • Dashboard Control: View all pending requests at http://localhost:8006
  • Safe Mode Toggle: Switch Safe Mode on/off anytime from the web dashboard
  • Peace of Mind: You can leave the agent running without fear of it deleting your files.

👁️ Terminator Vision (Live Observability)

See what the AI sees, in real-time:

  • Live Stream: The dashboard features a low-latency 1080p MJPEG stream of your desktop.
  • Semantic Overlay: Green bounding boxes highlight every button, link, and window the AI detects.
  • Debug Instantly: Visual confirmation that the AI has found the correct "Submit" button.

📚 Full MCP Specification Support

Bridge MCP now implements the complete Model Context Protocol specification:

Resources API

Expose desktop data as addressable resources:

  • desktop://screenshot/latest - Current screenshot
  • desktop://windows - Open windows list
  • desktop://logs - Agent command logs
  • file:///{path} - Read any desktop file
  • desktop://session/context - Recent session history

Prompts API

Pre-built workflow templates for one-click automation:

  • automate_desktop_task - Step-by-step task automation
  • debug_error - Interactive error debugging
  • web_automation - Playwright web workflows

Session Memory

Never lose context:

  • Stores last 100 commands across restarts
  • Provides AI with recent session history
  • Enables "continue where I left off" workflows

🚀 Quick Start

Step 1: Clone the Repository

bash
git clone https://github.com/BarhamAgha1/Bridge-MCP.git
cd Bridge-MCP

Step 2: Install Dependencies

bash
pip install -r requirements-local.txt

Note: Playwright browsers (~100MB) auto-install on first use - no manual setup needed!

Step 3: Start the Local Agent

bash
python local_agent.py

Keep this terminal open! The agent will display:

code
Bridge MCP Local Agent running on http://127.0.0.1:8006

Step 4: Configure Your AI Client

See Configuration below for Claude Desktop, Cursor, or VS Code setup.

Step 5: Register Your Agent

In your AI conversation, register the local agent:

code
Use register_agent with:
- agent_id: "my-pc"
- callback_url: "http://127.0.0.1:8006"
- agent_name: "My Windows PC"

Step 6: Start Controlling!

Now use any tool like screenshot(), click(100, 200), type_text("Hello"), app_launch("notepad"), etc.


🔧 Configuration

Claude Desktop

  1. Open the config file at %APPDATA%\Claude\claude_desktop_config.json

  2. Add Bridge MCP:

json
{
  "mcpServers": {
    "bridge-mcp": {
      "command": "python",
      "args": ["C:\\Users\\YourName\\Path\\To\\Bridge-MCP\\bridge_mcp.py"]
    }
  }
}

⚠️ Important: Replace the path with the actual location where you cloned the repository!

Example paths:

  • C:\\Users\\PC\\Desktop\\Bridge-MCP\\bridge_mcp.py
  • D:\\Projects\\Bridge-MCP\\bridge_mcp.py
  1. Restart Claude Desktop completely (close and reopen)

Cursor

Add to your MCP settings in Cursor preferences with the same configuration format.

VS Code + Claude Code

Create .vscode/mcp.json in your project:

json
{
  "mcpServers": {
    "bridge-mcp": {
      "command": "python",
      "args": ["C:\\Users\\YourName\\Path\\To\\Bridge-MCP\\bridge_mcp.py"]
    }
  }
}

Remote Access (Optional)

To control your PC from anywhere, expose the local agent with ngrok:

bash
ngrok http 8006

Then use the ngrok URL (e.g., https://xxxx.ngrok.io) as your callback_url when registering.


🛠️ Available Tools

<details> <summary><b>🚀 App Control Tools</b></summary>
ToolDescriptionExample
app_launchLaunch an applicationapp_launch("notepad")
app_switchSwitch to open appapp_switch("Chrome")
app_closeClose an applicationapp_close("notepad")
app_listList all open appsapp_list()
</details> <details> <summary><b>🖱️ Input Tools (Mouse & Keyboard)</b></summary>
ToolDescriptionExample
clickClick at coordinatesclick(500, 300)
double_clickDouble-clickdouble_click(500, 300)
right_clickRight-clickright_click(500, 300)
type_textType texttype_text("Hello World!")
press_keyPress a keypress_key("enter")
hotkeyKeyboard shortcuthotkey("ctrl,c")
scrollScrollscroll("down", 3)
dragDrag and dropdrag(100, 100, 500, 500)
move_mouseMove cursormove_mouse(500, 300)
</details> <details> <summary><b>📸 Screen Tools</b></summary>
ToolDescriptionExample
screenshotTake screenshotscreenshot()
get_desktop_stateGet full desktop stateget_desktop_state()
get_screen_sizeGet screen dimensionsget_screen_size()
get_mouse_positionGet cursor positionget_mouse_position()
</details> <details> <summary><b>⚡ System Tools</b></summary>
ToolDescriptionExample
run_powershellRun PowerShellrun_powershell("Get-Process")
run_cmdRun CMD commandrun_cmd("dir")
file_readRead filefile_read("C:/test.txt")
file_writeWrite filefile_write("C:/test.txt", "Hello")
file_listList directoryfile_list("C:/Users")
</details> <details> <summary><b>🌐 Browser Tools (Chrome)</b></summary>
ToolDescriptionExample
chrome_openOpen Chromechrome_open("https://google.com")
chrome_navigateGo to URLchrome_navigate("https://example.com")
</details> <details> <summary><b>🌐 Browser Tools (Playwright - Advanced)</b></summary>
ToolDescriptionExample
browser_navigateGo to URLbrowser_navigate("google.com")
browser_clickClick element (CSS)browser_click("#submit-btn")
browser_typeType in elementbrowser_type("#search", "hello")
browser_pressPress keybrowser_press("Enter")
browser_contentGet page textbrowser_content()
browser_screenshotBrowser screenshotbrowser_screenshot()
</details> <details> <summary><b>📋 Clipboard Tools</b></summary>
ToolDescriptionExample
clipboard_copyCopy to clipboardclipboard_copy("Hello")
clipboard_pasteGet clipboardclipboard_paste()
</details>

💡 Usage Examples

Example 1: Open Notepad and Write Text

code
User: Open notepad and write "Hello from AI!"

AI uses:
1. app_launch("notepad")
2. wait(1)
3. type_text("Hello from AI!")

Example 2: Take a Screenshot

code
User: What's on my screen right now?

AI uses:
1. screenshot()
2. [AI analyzes the image and describes what it sees]

Example 3: Search on Google

code
User: Search for "Bridge MCP" on Google

AI uses:
1. chrome_open("https://google.com")
2. type_text("Bridge MCP")
3. press_key("enter")

🔧 Troubleshooting

Claude Desktop shows "Server disconnected"

  1. Check the path - Make sure the path in your config points to the actual bridge_mcp.py file. The path must be absolute and use double backslashes (\\) in JSON.

  2. Test manually - Open Command Prompt and run:

cmd
   cd "C:\path\to\Bridge-MCP"
   python bridge_mcp.py

It should stay running (not exit immediately). Press Ctrl+C to stop.

  1. Install dependencies:
cmd
   pip install fastmcp httpx
  1. Restart Claude Desktop - Fully close and reopen after any config changes.

Local agent not receiving commands

  1. Make sure local_agent.py is running in a terminal (keep it open!)
  2. Verify the callback URL is correct when registering the agent
  3. For local use: http://127.0.0.1:8006
  4. For remote access: Use ngrok (ngrok http 8006) and use the ngrok URL

"No agents connected" error

You need to register your local agent first:

code
register_agent("my-pc", "http://127.0.0.1:8006", "My PC")

Unicode/Emoji errors on Windows

If local_agent.py crashes with Unicode errors, the terminal may not support emojis. This has been fixed in the latest version.


☁️ FastMCP Cloud Deployment

Bridge MCP can be deployed on FastMCP Cloud for easy access:

  1. Fork this repository
  2. Go to fastmcp.cloud
  3. Sign in with GitHub
  4. Create project from your forked repo
  5. Set entrypoint: bridge_mcp.py
  6. Deploy!

Your MCP will be available at: https://your-project.fastmcp.app/mcp


🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Ideas for Contributions

  • Add more browser support (Firefox, Edge)
  • Add Linux support
  • Add macOS support
  • Add more automation tools
  • Improve UI element detection
  • Add OCR capabilities

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments


👤 Author

Barham Agha


⭐ If you find this project useful, please give it a star! ⭐

Made with ❤️ for the AI community

常见问题

Bridge MCP 是什么?

Visual Desktop Bridge,让任意AI完整控制Windows,自动化应用操作与输入。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论