Skip to content

Commit d55133a

Browse files
committed
feat: add MCP server for Claude Desktop, Cursor, and MCP-compatible agents
- Add core/mcp_server.py: MCP server exposing 15 DeskBridge tools over stdio - Desktop control: capture, click, type, key, scroll, drag, list-apps, list-windows, focus-app, list-backends - Wrapper management: call, install, list - Activity: log-read, chart-generate - Add mcp_server.py entry point (root level) - Add MCP server tests (builds, exposes 15 tools, handles unknown tool) - Update CI workflow to include MCP server files - Update README with MCP configuration for Hermes Agent and Claude Desktop - Add PyAutoGUI backend mention in completed checklist
1 parent dbe58cc commit d55133a

5 files changed

Lines changed: 546 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Compile-check all Python files
3030
run: |
31-
python -m py_compile deskbridge.py core/activity_log.py core/chart_generator.py core/confirm.py core/desktop_control.py core/installer.py core/loader.py wrappers/blender/actions.py wrappers/blender/cli.py wrappers/gimp/actions.py wrappers/gimp/cli.py wrappers/inkscape/actions.py wrappers/inkscape/cli.py wrappers/obsidian/actions.py wrappers/obsidian/cli.py wrappers/zotero/actions.py wrappers/zotero/cli.py hub/app.py hub/run_production.py tests/test_discovery.py
31+
python -m py_compile deskbridge.py mcp_server.py core/activity_log.py core/chart_generator.py core/confirm.py core/desktop_control.py core/installer.py core/loader.py core/mcp_server.py wrappers/blender/actions.py wrappers/blender/cli.py wrappers/gimp/actions.py wrappers/gimp/cli.py wrappers/inkscape/actions.py wrappers/inkscape/cli.py wrappers/obsidian/actions.py wrappers/obsidian/cli.py wrappers/zotero/actions.py wrappers/zotero/cli.py hub/app.py hub/run_production.py tests/test_discovery.py
3232
3333
- name: Run test suite
3434
run: |

‎README.md‎

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ not locked to a single desktop automation vendor:
7474

7575
- `DesktopBackend` — abstract base class; subclass it to add a new backend.
7676
- `HermesComputerUseBackend` — wraps the Hermes `computer_use` tool (cua-driver).
77+
- `PyAutoGUIBackend` — wraps PyAutoGUI for cross-platform desktop control without the Hermes agent.
7778
- `DesktopController` — auto-detects available backends and routes calls to the first one.
7879

7980
To add a non-Hermes backend (MCP, Claude Desktop, pyautogui, etc.):
@@ -93,12 +94,73 @@ register_backend(MCPDesktopBackend())
9394
Register backends before calling any desktop function. The controller tries
9495
backends in registration order and uses the first available one.
9596

97+
## MCP Server (Model Context Protocol)
98+
99+
DeskBridge includes an MCP server so AI agents like Claude Desktop, Cursor,
100+
and other MCP-compatible agents can connect directly without custom code.
101+
102+
### Run the MCP server
103+
104+
```bash
105+
python mcp_server.py
106+
```
107+
108+
The server communicates over stdio and exposes 15 tools:
109+
110+
| Tool | Description |
111+
|------|-------------|
112+
| `desktop_capture` | Capture screenshot |
113+
| `desktop_click` | Click element/coordinate |
114+
| `desktop_type` | Type text |
115+
| `desktop_key` | Press key combination |
116+
| `desktop_scroll` | Scroll |
117+
| `desktop_drag` | Drag between points |
118+
| `desktop_list_apps` | List running applications |
119+
| `desktop_list_windows` | List open windows |
120+
| `desktop_focus_app` | Focus an application |
121+
| `desktop_list_backends` | List desktop backends |
122+
| `wrapper_call` | Call a wrapper action |
123+
| `wrapper_install` | Install a new wrapper |
124+
| `wrapper_list` | List installed wrappers |
125+
| `activity_log_read` | Read activity log |
126+
| `activity_chart_generate` | Generate activity chart |
127+
128+
### Configure in Hermes Agent
129+
130+
Add to `~/.hermes/config.yaml`:
131+
132+
```yaml
133+
mcp_servers:
134+
deskbridge:
135+
command: "python"
136+
args: ["D:/GitHub Project nextjohnp7/DeskBridge/mcp_server.py"]
137+
```
138+
139+
Restart Hermes Agent. The MCP tools become available as `mcp_deskbridge_*`
140+
in every conversation.
141+
142+
### Configure in Claude Desktop
143+
144+
Add to `claude_desktop_config.json`:
145+
146+
```json
147+
{
148+
"mcpServers": {
149+
"deskbridge": {
150+
"command": "python",
151+
"args": ["D:/GitHub Project nextjohnp7/DeskBridge/mcp_server.py"]
152+
}
153+
}
154+
}
155+
```
156+
96157
## Completed
97158
- [x] Blender render wrapper
98159
- [x] Core loader + confirmation
99160
- [x] Activity log tracking
100161
- [x] Chart generation (SVG)
101-
- [x] Desktop control (computer_use integration)
162+
- [x] Desktop control (computer_use + PyAutoGUI backends)
163+
- [x] MCP server (15 tools for Claude Desktop, Cursor, etc.)
102164
- [x] Simple CLI-Hub registry
103165
- [x] Second application wrapper (GIMP)
104166
- [x] Install command (`deskbridge install <app>`)

0 commit comments

Comments
 (0)