@minicor/mcp-server 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -124
- package/dist/__tests__/helpers.test.js +3 -3
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +7 -4
- package/dist/helpers.js.map +1 -1
- package/dist/inspect-scripts.d.ts +1 -1
- package/dist/inspect-scripts.js +1 -1
- package/dist/lds-client.d.ts +1 -1
- package/dist/lds-client.js +2 -2
- package/dist/prompts/build-rpa.d.ts.map +1 -1
- package/dist/prompts/build-rpa.js +37 -9
- package/dist/prompts/build-rpa.js.map +1 -1
- package/dist/tools/vm-rpa.js +12 -12
- package/dist/tools/vm-rpa.js.map +1 -1
- package/dist/tools/vm.js +4 -4
- package/dist/tools/workflow-ops.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
# Minicor MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build, deploy, and debug VM-based browser and desktop automations from **Cursor** or **Claude Code**. The AI agent connects to your Windows VM, writes Python automation scripts, tests them live, and saves them as Minicor workflows.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Cursor
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm install -g @minicor/mcp-server
|
|
11
|
-
minicor-mcp-setup
|
|
12
|
-
claude mcp add minicor -- minicor-mcp
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Add to Cursor
|
|
16
|
-
|
|
17
|
-
Run the setup, then add to your Cursor MCP config (`~/.cursor/mcp.json`):
|
|
9
|
+
Run the setup wizard, then add to your Cursor MCP config (`~/.cursor/mcp.json`):
|
|
18
10
|
|
|
19
11
|
```json
|
|
20
12
|
{
|
|
@@ -27,119 +19,126 @@ Run the setup, then add to your Cursor MCP config (`~/.cursor/mcp.json`):
|
|
|
27
19
|
}
|
|
28
20
|
```
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
If you run `minicor-mcp-setup`, it writes this config automatically.
|
|
31
23
|
|
|
32
|
-
|
|
24
|
+
### Claude Code
|
|
33
25
|
|
|
34
26
|
```bash
|
|
35
27
|
npm install -g @minicor/mcp-server
|
|
36
28
|
minicor-mcp-setup
|
|
29
|
+
claude mcp add minicor -- minicor-mcp
|
|
37
30
|
```
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
For headless environments:
|
|
32
|
+
### Authenticate
|
|
42
33
|
|
|
43
34
|
```bash
|
|
44
|
-
minicor
|
|
35
|
+
npx @minicor/mcp-server-setup
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
Opens a browser to sign in or create an account. Tokens are stored at `~/.minicor/tokens.json` and auto-refresh. For headless environments: `npx @minicor/mcp-server-setup --cli`.
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
### Update
|
|
50
41
|
|
|
51
|
-
|
|
52
|
-
- **Workflows** -- create, update, clone, delete, restore workflows
|
|
53
|
-
- **Flows (Steps)** -- read/write individual steps, view version history, bulk update
|
|
54
|
-
- **Executions** -- list, search, filter by date/status, inspect full payloads, view per-step results
|
|
55
|
-
- **Execute** -- trigger workflows synchronously or async, poll for status
|
|
56
|
-
- **Configuration Stores** -- manage key-value configs used by `{{config.xxx}}` references
|
|
57
|
-
- **Issues** -- create and manage workspace issues
|
|
58
|
-
- **Desktop RPA** -- connect to a VM, take screenshots, inspect UI, run scripts, build RPA workflows iteratively
|
|
59
|
-
- **Browser RPA** -- session-based browser automation with natural-language actions
|
|
60
|
-
- **RPA Debugging** -- before/after screenshots, batch testing, state reset, execution diagnosis
|
|
61
|
-
- **Log Search** _(advanced)_ -- full-text Elasticsearch search across execution logs
|
|
62
|
-
- **Incident Investigation** -- correlate failures across workflows with timeline analysis
|
|
63
|
-
- **CRON Management** _(advanced)_ -- scheduled job management
|
|
64
|
-
- **Workflow File Sync** -- pull/push workflows to local files for git version control
|
|
42
|
+
`npx` users: just restart your editor (fetches latest automatically). Global install: `npm update -g @minicor/mcp-server`.
|
|
65
43
|
|
|
66
|
-
##
|
|
44
|
+
## How It Works
|
|
67
45
|
|
|
68
|
-
Connect to a VM running the Laminar Desktop Service (LDS)
|
|
46
|
+
1. **Connect to a VM** — The agent connects to your Windows VM running the Laminar Desktop Service (LDS) via a Cloudflare tunnel
|
|
47
|
+
2. **Build automations** — The agent takes screenshots, inspects UI elements, writes Python scripts, and tests them on the VM in real time
|
|
48
|
+
3. **Deploy as workflows** — Validated scripts are saved as step-based Minicor workflows with credentials stored in config stores
|
|
49
|
+
4. **Debug failures** — Before/after screenshots, video recordings of each step, execution diagnosis, and replay on live VMs
|
|
69
50
|
|
|
70
|
-
|
|
51
|
+
## What You Can Automate
|
|
71
52
|
|
|
72
|
-
|
|
53
|
+
- **Web portals** — Chrome on the VM controlled via CDP (Chrome DevTools Protocol). Works on React/Angular SPAs, anti-bot protected sites, payor portals, EHR web apps.
|
|
54
|
+
- **Desktop applications** — Native Windows apps driven via uiautomation, pywinauto, or pyautogui. EMR clients, billing software, legacy systems.
|
|
55
|
+
- **APIs** — Direct HTTP calls when the agent discovers usable REST endpoints behind a web portal.
|
|
56
|
+
- **Hybrid workflows** — Mix browser, desktop, and API steps in a single workflow.
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
2. Start it on port 1016
|
|
76
|
-
3. Expose via Cloudflare Tunnel: `cloudflared tunnel --url http://localhost:1016`
|
|
77
|
-
4. In Cursor: `vm_connect` with the tunnel URL
|
|
78
|
-
|
|
79
|
-
### RPA Tools
|
|
80
|
-
|
|
81
|
-
| Tool | Description |
|
|
82
|
-
|---|---|
|
|
83
|
-
| `vm_connect` | Connect to LDS via Cloudflare Tunnel URL |
|
|
84
|
-
| `vm_screenshot` | Capture VM desktop screenshot |
|
|
85
|
-
| `vm_inspect_ui` | Inspect UI elements (accessibility tree, element at point, etc.) |
|
|
86
|
-
| `vm_execute_script` | Run Python script on the VM |
|
|
87
|
-
| `create_rpa_flow` | Save validated Python script as an RPA step (auto-wraps in correct format) |
|
|
88
|
-
| `vm_read_clipboard` | Read clipboard text after copy operations |
|
|
89
|
-
| `vm_screenshot_region` | Crop and zoom a specific screen region |
|
|
90
|
-
| `debug_rpa_step` | Run script with before/after screenshots |
|
|
91
|
-
| `vm_reset_state` | Smart Launch -- reset app to known state |
|
|
92
|
-
| `batch_test_rpa` | Run workflow with multiple test inputs |
|
|
93
|
-
| `get_lds_setup_guide` | Full LDS installation walkthrough |
|
|
94
|
-
|
|
95
|
-
## Browser RPA
|
|
96
|
-
|
|
97
|
-
Session-based browser automation for web applications.
|
|
98
|
-
|
|
99
|
-
| Tool | Description |
|
|
100
|
-
|---|---|
|
|
101
|
-
| `browser_connect` | Connect to browser RPA service |
|
|
102
|
-
| `browser_create_session` | Start a new browser session |
|
|
103
|
-
| `browser_act` | Natural-language browser actions |
|
|
104
|
-
| `browser_extract` | Extract data from the current page |
|
|
105
|
-
| `browser_screenshot` | Screenshot the browser |
|
|
106
|
-
| `browser_close_session` | Clean up session |
|
|
107
|
-
| `create_browser_rpa_flow` | Save browser action as a workflow step |
|
|
108
|
-
|
|
109
|
-
## Workflow Tools
|
|
110
|
-
|
|
111
|
-
| Tool | Description |
|
|
112
|
-
|---|---|
|
|
113
|
-
| `preview_flow_changes` | Diff current vs proposed code before pushing |
|
|
114
|
-
| `get_workflow_overview` | Full workflow snapshot with code + executions |
|
|
115
|
-
| `test_workflow_step` | Run up to / from / only a specific step |
|
|
116
|
-
| `diagnose_execution` | Find failures with RPA-specific error analysis |
|
|
117
|
-
| `compare_flow_versions` | Diff between two step versions |
|
|
118
|
-
|
|
119
|
-
## Advanced Setup
|
|
120
|
-
|
|
121
|
-
Elasticsearch (log search) and CRON (scheduling) are configured during `minicor-mcp-setup` under Advanced Settings, or via `~/.minicor/config.json`:
|
|
58
|
+
## VM Setup
|
|
122
59
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
60
|
+
1. Install LDS on a Windows 10/11 or Server VM with Python 3.11+
|
|
61
|
+
2. Start LDS on port 1016
|
|
62
|
+
3. Expose via Cloudflare Tunnel: `cloudflared tunnel --url http://localhost:1016`
|
|
63
|
+
4. For browser automation: start Chrome with `--remote-debugging-port=9222`
|
|
64
|
+
5. In your editor, tell the agent: "Connect to my VM at https://your-tunnel-url.com"
|
|
65
|
+
|
|
66
|
+
Use the `get_lds_setup_guide` tool for detailed step-by-step instructions.
|
|
67
|
+
|
|
68
|
+
## Tools
|
|
69
|
+
|
|
70
|
+
### VM Tools
|
|
71
|
+
|
|
72
|
+
| Tool | What it does |
|
|
73
|
+
| ---------------------- | ------------------------------------------------------------------------------------------ |
|
|
74
|
+
| `vm_connect` | Connect to VM via LDS Cloudflare tunnel URL |
|
|
75
|
+
| `vm_disconnect` | Disconnect from VM |
|
|
76
|
+
| `vm_status` | Health check for the connected VM |
|
|
77
|
+
| `vm_screenshot` | Full-screen capture of the VM desktop |
|
|
78
|
+
| `vm_screenshot_region` | Zoom into a specific screen area |
|
|
79
|
+
| `vm_execute_script` | Run a Python script on the VM |
|
|
80
|
+
| `vm_execution_status` | Check status of a running script |
|
|
81
|
+
| `vm_execution_control` | Pause, resume, stop, or skip a running script |
|
|
82
|
+
| `vm_inspect_ui` | Inspect Windows UI elements (window list, element tree, element at point, focused element) |
|
|
83
|
+
| `vm_read_clipboard` | Read VM clipboard contents |
|
|
84
|
+
|
|
85
|
+
### Automation Building
|
|
86
|
+
|
|
87
|
+
| Tool | What it does |
|
|
88
|
+
| ----------------------- | --------------------------------------------------------- |
|
|
89
|
+
| `create_rpa_flow` | Save a validated Python script as a Minicor workflow step |
|
|
90
|
+
| `debug_rpa_step` | Test a script with before/after screenshots |
|
|
91
|
+
| `vm_reset_state` | Manage windows: focus app, minimize all, close dialogs |
|
|
92
|
+
| `batch_test_rpa` | Run a workflow with multiple test inputs |
|
|
93
|
+
| `replay_execution_step` | Re-run a step from a failed execution on the VM |
|
|
94
|
+
| `get_lds_setup_guide` | LDS installation walkthrough |
|
|
95
|
+
|
|
96
|
+
### Workflows and Executions
|
|
97
|
+
|
|
98
|
+
| Tool | What it does |
|
|
99
|
+
| ---------------------------------------------------------- | --------------------------------------------------- |
|
|
100
|
+
| `create_workflow` / `update_workflow` / `delete_workflow` | Workflow CRUD |
|
|
101
|
+
| `create_flow` / `update_flow` / `delete_flow` | Step CRUD |
|
|
102
|
+
| `execute_workflow` / `execute_workflow_async` | Run workflows synchronously or async |
|
|
103
|
+
| `list_executions` / `get_execution` / `get_full_execution` | View execution history and details |
|
|
104
|
+
| `diagnose_execution` | Analyze failures with RPA-specific pattern matching |
|
|
105
|
+
| `get_workflow_overview` | Full snapshot: steps, code, recent executions |
|
|
106
|
+
| `test_workflow_step` | Run a single step in isolation |
|
|
107
|
+
| `preview_flow_changes` / `compare_flow_versions` | Diff code before deploying |
|
|
108
|
+
|
|
109
|
+
### Config Stores
|
|
110
|
+
|
|
111
|
+
| Tool | What it does |
|
|
112
|
+
| --------------------------------------------------- | --------------------------------------------------- |
|
|
113
|
+
| `create_config_store` | Create a credential store with key-value properties |
|
|
114
|
+
| `list_config_stores` / `get_config_store` | Browse stores |
|
|
115
|
+
| `update_config_property` / `remove_config_property` | Manage individual properties |
|
|
116
|
+
|
|
117
|
+
Scripts reference credentials as `{{config.propertyKey}}` — resolved at runtime by the workflow engine.
|
|
118
|
+
|
|
119
|
+
### Workflow Sync
|
|
120
|
+
|
|
121
|
+
| Tool | What it does |
|
|
122
|
+
| --------------------------------- | --------------------------------------------- |
|
|
123
|
+
| `init_project` | Scaffold a git-ready project from a workspace |
|
|
124
|
+
| `pull_workflow` / `push_workflow` | Sync individual workflows |
|
|
125
|
+
| `pull_all` / `push_changed` | Bulk sync |
|
|
126
|
+
| `sync_status` | Diff local vs deployed |
|
|
127
|
+
|
|
128
|
+
## Prompts
|
|
129
|
+
|
|
130
|
+
| Prompt | What it does |
|
|
131
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
132
|
+
| `build-rpa-workflow` | Guided automation building: strategy selection, iterative build loop, Minicor testing, deployment |
|
|
133
|
+
| `debug-workflow-execution` | Analyze a failed execution with VM-aware debugging and replay |
|
|
134
|
+
| `minicor-workflow-guide` | Full workflow specification: step types, data access, keywords, libraries |
|
|
134
135
|
|
|
135
136
|
## Auth
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- **
|
|
140
|
-
- **
|
|
141
|
-
- **Auto-refresh**: tokens refresh automatically before expiry
|
|
142
|
-
- **Region**: US (default) or Canada, selected during setup
|
|
138
|
+
- **Sign in**: `minicor-mcp-setup` (browser) or `minicor-mcp-setup --cli`
|
|
139
|
+
- **Token storage**: `~/.minicor/tokens.json`
|
|
140
|
+
- **Auto-refresh**: tokens refresh before expiry
|
|
141
|
+
- **Regions**: US (default) or Canada
|
|
143
142
|
|
|
144
143
|
## Development
|
|
145
144
|
|
|
@@ -147,25 +146,4 @@ Authentication uses stored session tokens only. No API keys.
|
|
|
147
146
|
npm install
|
|
148
147
|
npm run build
|
|
149
148
|
npm test
|
|
150
|
-
npm run dev # watch mode
|
|
151
|
-
npm run test:watch # test watch mode
|
|
152
149
|
```
|
|
153
|
-
|
|
154
|
-
### Project Structure
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
src/
|
|
158
|
-
index.ts -- server orchestrator (auth, init, registration)
|
|
159
|
-
helpers.ts -- shared response helpers (ok, text, safe, buildRpaProgram)
|
|
160
|
-
state.ts -- session state (VM + browser connections)
|
|
161
|
-
paths.ts -- token/config path resolution with ~/.minicor/ + ~/.laminar/ fallback
|
|
162
|
-
types.ts -- shared ToolDeps interface
|
|
163
|
-
setup.ts -- interactive setup (browser + CLI modes)
|
|
164
|
-
tools/ -- tool modules (each exports register())
|
|
165
|
-
prompts/ -- prompt modules (each exports register())
|
|
166
|
-
__tests__/ -- vitest unit tests
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## License
|
|
170
|
-
|
|
171
|
-
MIT
|
|
@@ -40,9 +40,9 @@ describe("buildRpaProgram", () => {
|
|
|
40
40
|
it("generates cloudflare_tunnel pattern with lam.httpRequest", () => {
|
|
41
41
|
const program = buildRpaProgram('print("hello")', "cloudflare_tunnel", "test-step", "Test Step", "A test step");
|
|
42
42
|
expect(program).toContain("lam.httpRequest");
|
|
43
|
-
expect(program).toContain("{{config.
|
|
44
|
-
expect(program).toContain("{{config.
|
|
45
|
-
expect(program).toContain("{{config.
|
|
43
|
+
expect(program).toContain("{{config.minicor_desktop_service_url}}/execute");
|
|
44
|
+
expect(program).toContain("{{config.minicor_desktop_service_api_key}}");
|
|
45
|
+
expect(program).toContain("{{config.minicor_desktop_service_id}}");
|
|
46
46
|
expect(program).toContain('"flowId": "test-step"');
|
|
47
47
|
expect(program).toContain('print("hello")');
|
|
48
48
|
expect(program).toMatch(/^\(data\) =>/);
|
package/dist/helpers.d.ts
CHANGED
|
@@ -20,6 +20,6 @@ export declare function safe<T>(fn: () => Promise<T>): Promise<{
|
|
|
20
20
|
text: string;
|
|
21
21
|
}[];
|
|
22
22
|
}>;
|
|
23
|
-
export declare const NOT_CONNECTED_VM = "No VM connected. Ask the user for their Cloudflare Tunnel URL for the
|
|
24
|
-
export declare function buildRpaProgram(pythonScript: string, pattern: "cloudflare_tunnel" | "channel", flowId: string, stepName: string, stepDescription: string): string;
|
|
23
|
+
export declare const NOT_CONNECTED_VM = "No VM connected. Ask the user for their Cloudflare Tunnel URL for the Minicor Desktop Service, then call vm_connect.";
|
|
24
|
+
export declare function buildRpaProgram(pythonScript: string, pattern: "cloudflare_tunnel" | "channel" | "browser", flowId: string, stepName: string, stepDescription: string): string;
|
|
25
25
|
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAE1C;AAED,wBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO;;;;;EAE/B;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM;;;;;EAE/B;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;;;;;GAMjD;AAED,eAAO,MAAM,gBAAgB,yHAAyH,CAAC;AAEvJ,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAE1C;AAED,wBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO;;;;;EAE/B;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM;;;;;EAE/B;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;;;;;GAMjD;AAED,eAAO,MAAM,gBAAgB,yHAAyH,CAAC;AAEvJ,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,GAAG,SAAS,EACpD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,MAAM,CAwCR"}
|
package/dist/helpers.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function safe(fn) {
|
|
|
18
18
|
return text(`Error: ${e.message}`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export const NOT_CONNECTED_VM = `No VM connected. Ask the user for their Cloudflare Tunnel URL for the
|
|
21
|
+
export const NOT_CONNECTED_VM = `No VM connected. Ask the user for their Cloudflare Tunnel URL for the Minicor Desktop Service, then call vm_connect.`;
|
|
22
22
|
export function buildRpaProgram(pythonScript, pattern, flowId, stepName, stepDescription) {
|
|
23
23
|
const escaped = pythonScript.replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
24
24
|
if (pattern === "channel") {
|
|
@@ -34,6 +34,9 @@ ${escaped}
|
|
|
34
34
|
};
|
|
35
35
|
}`;
|
|
36
36
|
}
|
|
37
|
+
// Browser scripts go to /execute/browser — MDS provides an isolated Chrome tab
|
|
38
|
+
// Desktop scripts go to /execute — no Chrome, just runs the script
|
|
39
|
+
const endpoint = pattern === "browser" ? "/execute/browser" : "/execute";
|
|
37
40
|
return `(data) => {
|
|
38
41
|
const pythonScript = \`
|
|
39
42
|
${escaped}
|
|
@@ -41,11 +44,11 @@ ${escaped}
|
|
|
41
44
|
return {
|
|
42
45
|
"lam.httpRequest": {
|
|
43
46
|
"method": "POST",
|
|
44
|
-
"url": "{{config.
|
|
47
|
+
"url": "{{config.minicor_desktop_service_url}}${endpoint}",
|
|
45
48
|
"headers": {
|
|
46
49
|
"Content-Type": "application/json",
|
|
47
|
-
"X-API-Key": "{{config.
|
|
48
|
-
"X-Service-ID": "{{config.
|
|
50
|
+
"X-API-Key": "{{config.minicor_desktop_service_api_key}}",
|
|
51
|
+
"X-Service-ID": "{{config.minicor_desktop_service_id}}"
|
|
49
52
|
},
|
|
50
53
|
"body": {
|
|
51
54
|
"flowId": "${flowId}",
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,UAAU,IAAI,CAAC,IAAa;IAChC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,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EAAE,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,EAAoB;IAChD,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,sHAAsH,CAAC;AAEvJ,MAAM,UAAU,eAAe,CAC7B,YAAoB,EACpB,OAAoD,EACpD,MAAc,EACd,QAAgB,EAChB,eAAuB;IAEvB,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;;EAET,OAAO;;;;;;;;EAQP,CAAC;IACD,CAAC;IACD,+EAA+E;IAC/E,mEAAmE;IACnE,MAAM,QAAQ,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC;IACzE,OAAO;;EAEP,OAAO;;;;;sDAK6C,QAAQ;;;;;;;qBAOzC,MAAM;;;2BAGA,MAAM,eAAe,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;;;;EAIrI,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Python script generators for VM UI inspection.
|
|
3
3
|
*
|
|
4
4
|
* Each function returns a Python script string that, when executed on the VM
|
|
5
|
-
* via
|
|
5
|
+
* via MDS /execute, prints structured JSON to stdout for the agent to parse.
|
|
6
6
|
*/
|
|
7
7
|
export type InspectMode = "window_list" | "screen_info" | "element_at_point" | "element_tree" | "focused_element";
|
|
8
8
|
export type InspectFramework = "auto" | "uiautomation" | "pywinauto" | "jab";
|
package/dist/inspect-scripts.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Python script generators for VM UI inspection.
|
|
3
3
|
*
|
|
4
4
|
* Each function returns a Python script string that, when executed on the VM
|
|
5
|
-
* via
|
|
5
|
+
* via MDS /execute, prints structured JSON to stdout for the agent to parse.
|
|
6
6
|
*/
|
|
7
7
|
export function generateInspectScript(params) {
|
|
8
8
|
const fw = params.framework ?? "auto";
|
package/dist/lds-client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Stateless HTTP client for the
|
|
2
|
+
* Stateless HTTP client for the Minicor Desktop Service (MDS).
|
|
3
3
|
*
|
|
4
4
|
* Every method receives the base URL (Cloudflare Tunnel) and optional auth
|
|
5
5
|
* credentials so the caller (tool handler) can pull them from session state.
|
package/dist/lds-client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Stateless HTTP client for the
|
|
2
|
+
* Stateless HTTP client for the Minicor Desktop Service (MDS).
|
|
3
3
|
*
|
|
4
4
|
* Every method receives the base URL (Cloudflare Tunnel) and optional auth
|
|
5
5
|
* credentials so the caller (tool handler) can pull them from session state.
|
|
@@ -19,7 +19,7 @@ async function request(url, init) {
|
|
|
19
19
|
const res = await fetch(url, init);
|
|
20
20
|
if (!res.ok) {
|
|
21
21
|
const body = await res.text().catch(() => "");
|
|
22
|
-
throw new Error(`
|
|
22
|
+
throw new Error(`MDS ${init?.method ?? "GET"} ${url} returned ${res.status}: ${body}`);
|
|
23
23
|
}
|
|
24
24
|
return res.json();
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-rpa.d.ts","sourceRoot":"","sources":["../../src/prompts/build-rpa.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"build-rpa.d.ts","sourceRoot":"","sources":["../../src/prompts/build-rpa.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,QAmT5C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function register({ server }) {
|
|
3
|
-
server.prompt("build-rpa-workflow", "Iteratively build an RPA workflow on a VM using the
|
|
4
|
-
workspaceId: z.string().describe("
|
|
3
|
+
server.prompt("build-rpa-workflow", "Iteratively build an RPA workflow on a VM using the Minicor Desktop Service. Guides you through connecting to the VM, researching the target app's UI framework, taking screenshots, inspecting UI elements, writing and testing RPA scripts, and saving each working step as a Minicor workflow flow.", {
|
|
4
|
+
workspaceId: z.string().describe("Minicor workspace ID"),
|
|
5
5
|
task: z
|
|
6
6
|
.string()
|
|
7
7
|
.describe("Description of what to automate (e.g. 'Log into Centricity, navigate to Documents, download the latest report')"),
|
|
@@ -18,7 +18,7 @@ export function register({ server }) {
|
|
|
18
18
|
role: "user",
|
|
19
19
|
content: {
|
|
20
20
|
type: "text",
|
|
21
|
-
text: `You are building an RPA workflow on the Minicor platform. Your goal is to iteratively create automation steps that run on a VM via the
|
|
21
|
+
text: `You are building an RPA workflow on the Minicor platform. Your goal is to iteratively create automation steps that run on a VM via the Minicor Desktop Service (MDS).
|
|
22
22
|
|
|
23
23
|
## Task
|
|
24
24
|
${task}
|
|
@@ -48,9 +48,11 @@ Screenshots alone are unreliable for reading data (resolution issues, misreads).
|
|
|
48
48
|
## Strategy Selection (BEFORE writing any automation)
|
|
49
49
|
|
|
50
50
|
### For Web/Browser Targets:
|
|
51
|
-
- Chrome runs on the VM with \`--remote-debugging-port=9222\`
|
|
52
51
|
- Use **CDP via Python websocket** for page manipulation (fastest, most reliable for anti-bot sites)
|
|
53
|
-
-
|
|
52
|
+
- The MDS provides an isolated Chrome instance per execution via \`/execute/browser\`
|
|
53
|
+
- Multiple browser automations run **in parallel** on the same VM — each gets its own Chrome
|
|
54
|
+
- Scripts always use \`127.0.0.1:9222\` — the MDS transparently routes to the correct Chrome instance
|
|
55
|
+
- Use CDP \`Page.captureScreenshot\` for screenshots within the browser tab
|
|
54
56
|
- Check if the site has usable internal APIs (inspect network traffic via CDP \`fetch\` interception)
|
|
55
57
|
- If clean APIs exist and are stable → consider direct \`requests\`/\`httpx\` instead of UI automation
|
|
56
58
|
- If anti-bot protection exists (Cloudflare, reCAPTCHA) → CDP through the VM browser avoids detection
|
|
@@ -61,16 +63,33 @@ Screenshots alone are unreliable for reading data (resolution issues, misreads).
|
|
|
61
63
|
- **Electron / web-based desktop** → \`pywinauto\` or \`pyautogui\`
|
|
62
64
|
- **Legacy Win32** → \`uiautomation\`
|
|
63
65
|
- Start with \`uiautomation\` if unsure.
|
|
66
|
+
- Desktop scripts use \`/execute\` and run **one at a time** per VM (the physical screen is shared)
|
|
67
|
+
|
|
68
|
+
### Mixed Browser + Desktop (IMPORTANT)
|
|
69
|
+
Some browser automations need to interact with the physical screen — for example:
|
|
70
|
+
- Clicking OS-level alerts or confirmation dialogs
|
|
71
|
+
- File upload/download dialogs (native file picker)
|
|
72
|
+
- Browser notifications or permission prompts
|
|
73
|
+
- CAPTCHA solving that requires clicking outside the browser
|
|
74
|
+
|
|
75
|
+
**These automations CANNOT use \`/execute/browser\`** because they need the screen, which is shared.
|
|
76
|
+
Use \`/execute\` instead and treat them like desktop automations — they run one at a time per VM.
|
|
77
|
+
|
|
78
|
+
When building a workflow, determine which category it falls into:
|
|
79
|
+
- **Pure CDP** (all interaction via \`Runtime.evaluate\`, \`Page.navigate\`, etc.) → \`/execute/browser\` — parallel-safe
|
|
80
|
+
- **Needs screen interaction** (any \`pyautogui\`, OS dialogs, file pickers) → \`/execute\` — one at a time
|
|
64
81
|
|
|
65
82
|
## Browser Automation via CDP (Python WebSocket)
|
|
66
83
|
|
|
67
|
-
Chrome
|
|
84
|
+
Your Python scripts connect to Chrome via the Chrome DevTools Protocol. The MDS handles Chrome lifecycle and port routing transparently — scripts always use port 9222.
|
|
85
|
+
|
|
86
|
+
**Dispatch:** Use \`dispatchPattern: "browser"\` when saving with \`create_rpa_flow\`. This routes to \`/execute/browser\` which provides an isolated Chrome instance.
|
|
68
87
|
|
|
69
88
|
### How CDP Works:
|
|
70
89
|
1. Discover tabs: \`GET http://127.0.0.1:9222/json\`
|
|
71
90
|
2. Connect via WebSocket to the target tab's \`webSocketDebuggerUrl\`
|
|
72
91
|
3. Use \`Runtime.evaluate\` to execute JavaScript in the page context
|
|
73
|
-
4. Use \`
|
|
92
|
+
4. Use CDP \`Page.captureScreenshot\` for screenshots
|
|
74
93
|
|
|
75
94
|
### CDP Starter Template:
|
|
76
95
|
\`\`\`python
|
|
@@ -107,10 +126,17 @@ ws.close()
|
|
|
107
126
|
- **Button clicks by text**: Use \`querySelectorAll("button").forEach()\` + \`textContent.trim()\` matching — more resilient than IDs or classes that change
|
|
108
127
|
- **Credentials**: Use \`\\\${username}\` / \`\\\${password}\` interpolated from JS wrapper variables sourced from \`{{config.xxx}}\` — NEVER hardcode
|
|
109
128
|
- **Waits**: \`time.sleep()\` between navigations (8-15s for page loads, 1-3s for UI actions)
|
|
110
|
-
- **Verification**:
|
|
129
|
+
- **Verification**: Use CDP \`Page.captureScreenshot\` for per-tab screenshots
|
|
111
130
|
- **Dropdown handling**: Click to open, then use \`querySelectorAll\` to find options by text and click
|
|
112
131
|
- **Tab management**: If multiple tabs open, filter \`/json\` response by URL or title
|
|
113
132
|
|
|
133
|
+
### Parallel Execution Notes:
|
|
134
|
+
- \`/execute/browser\` runs your script with its own Chrome instance — multiple workflows can run at the same time on one VM
|
|
135
|
+
- \`/execute\` runs your script without Chrome — for desktop automation or mixed browser+desktop scripts
|
|
136
|
+
- The MDS transparently rewrites \`127.0.0.1:9222\` in your script to the correct Chrome port — you never need to handle ports
|
|
137
|
+
- Recordings from \`/execute/browser\` capture only the browser tab (CDP screencast), not the full desktop
|
|
138
|
+
- Recordings from \`/execute\` capture the full desktop (MSS screen recording)
|
|
139
|
+
|
|
114
140
|
## Procedure
|
|
115
141
|
|
|
116
142
|
### 1. Connect to the VM
|
|
@@ -150,7 +176,9 @@ Before writing any automation:
|
|
|
150
176
|
**e. SAVE — Call \`create_rpa_flow\` (only after c + d pass)**
|
|
151
177
|
- Pass the validated Python script, step name, description, flowId, and executionOrder
|
|
152
178
|
- The tool handles all JS wrapping automatically
|
|
153
|
-
-
|
|
179
|
+
- For browser/CDP automations: set \`dispatchPattern: "browser"\` — routes to \`/execute/browser\` (parallel-safe)
|
|
180
|
+
- For desktop automations: use default \`dispatchPattern: "cloudflare_tunnel"\` — routes to \`/execute\`
|
|
181
|
+
- For mixed browser+desktop: use default \`dispatchPattern: "cloudflare_tunnel"\` — runs one at a time
|
|
154
182
|
|
|
155
183
|
### 5. Data Passing Between Steps (CRITICAL)
|
|
156
184
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-rpa.js","sourceRoot":"","sources":["../../src/prompts/build-rpa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,QAAQ,CAAC,EAAE,MAAM,EAAY;IAC3C,MAAM,CAAC,MAAM,CACX,oBAAoB,EACpB,wSAAwS,EACxS;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACxD,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,CACP,iHAAiH,CAClH;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,uFAAuF,CACxF;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,Q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C,CAAC,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoH1I,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAmJsC;iBAC9C;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/tools/vm-rpa.js
CHANGED
|
@@ -20,9 +20,9 @@ export function register(deps) {
|
|
|
20
20
|
.string()
|
|
21
21
|
.describe("Flow ID used inside the RPA payload for tracking"),
|
|
22
22
|
dispatchPattern: z
|
|
23
|
-
.enum(["cloudflare_tunnel", "channel"])
|
|
23
|
+
.enum(["cloudflare_tunnel", "channel", "browser"])
|
|
24
24
|
.default("cloudflare_tunnel")
|
|
25
|
-
.describe("How the script is dispatched to the VM"),
|
|
25
|
+
.describe("How the script is dispatched to the VM. Use 'browser' for pure CDP browser automations (parallel-safe, each gets its own Chrome instance). Use 'cloudflare_tunnel' for desktop automations or mixed browser+desktop scripts that need screen interaction (e.g. OS dialogs, file pickers)."),
|
|
26
26
|
}, async ({ workflowId, name, description, pythonScript, executionOrder, flowId, dispatchPattern, }) => {
|
|
27
27
|
const program = buildRpaProgram(pythonScript, dispatchPattern, flowId, name, description);
|
|
28
28
|
return safe(() => deps.client().createFlow({
|
|
@@ -268,8 +268,8 @@ if not found:
|
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
// ── Setup guide ───────────────────────────────────────────
|
|
271
|
-
server.tool("get_lds_setup_guide", "Get the step-by-step guide for installing the
|
|
272
|
-
return text(`#
|
|
271
|
+
server.tool("get_lds_setup_guide", "Get the step-by-step guide for installing the Minicor Desktop Service (MDS) on a Windows VM and connecting it via Cloudflare Tunnel.", {}, async () => {
|
|
272
|
+
return text(`# Minicor Desktop Service (MDS) — Setup Guide
|
|
273
273
|
|
|
274
274
|
## Prerequisites
|
|
275
275
|
- Windows 10/11 or Windows Server VM
|
|
@@ -280,17 +280,17 @@ if not found:
|
|
|
280
280
|
Copy \`vm_setup.bat\` to the VM and run **as Administrator**.
|
|
281
281
|
This installs Git, Python 3.11, and VS Code via Chocolatey.
|
|
282
282
|
|
|
283
|
-
## Step 2: Clone and configure
|
|
283
|
+
## Step 2: Clone and configure MDS
|
|
284
284
|
Open **Git Bash** and run:
|
|
285
285
|
\`\`\`bash
|
|
286
|
-
git clone <your-
|
|
287
|
-
cd
|
|
286
|
+
git clone <your-mds-repo-url>
|
|
287
|
+
cd minicor-desktop-service
|
|
288
288
|
cp .env.example .env
|
|
289
289
|
\`\`\`
|
|
290
290
|
|
|
291
291
|
Edit \`.env\` with your workspace values:
|
|
292
|
-
- \`
|
|
293
|
-
- \`
|
|
292
|
+
- \`MINICOR_DESKTOP_SERVICE_API_KEY\` — from your Minicor workspace
|
|
293
|
+
- \`MINICOR_DESKTOP_SERVICE_ID\` — from your Minicor workspace
|
|
294
294
|
- \`PORT=1016\` (default)
|
|
295
295
|
- \`SCRIPT_VM_NAME\` — a name for this VM
|
|
296
296
|
|
|
@@ -300,7 +300,7 @@ Edit \`.env\` with your workspace values:
|
|
|
300
300
|
./setup.sh # sets up the script execution venv
|
|
301
301
|
\`\`\`
|
|
302
302
|
|
|
303
|
-
## Step 4: Start the
|
|
303
|
+
## Step 4: Start the MDS server
|
|
304
304
|
\`\`\`
|
|
305
305
|
2-start-app.bat
|
|
306
306
|
\`\`\`
|
|
@@ -329,9 +329,9 @@ Call the \`vm_connect\` tool with the tunnel URL:
|
|
|
329
329
|
You can now use \`vm_screenshot\`, \`vm_execute_script\`, \`vm_inspect_ui\`, and all other VM tools.
|
|
330
330
|
|
|
331
331
|
## Troubleshooting
|
|
332
|
-
- **
|
|
332
|
+
- **MDS won't start**: Check Python is on PATH, check .env values, check port 1016 is free
|
|
333
333
|
- **Tunnel fails**: Ensure cloudflared is installed and port 1016 is accessible locally
|
|
334
|
-
- **vm_connect fails**: Verify the tunnel URL is correct and
|
|
334
|
+
- **vm_connect fails**: Verify the tunnel URL is correct and MDS is running (\`/health\` endpoint)
|
|
335
335
|
`);
|
|
336
336
|
});
|
|
337
337
|
}
|
package/dist/tools/vm-rpa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vm-rpa.js","sourceRoot":"","sources":["../../src/tools/vm-rpa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAGxC,SAAS,SAAS;IAChB,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,6DAA6D;IAE7D,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,uPAAuP,EACvP;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACpD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,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,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CACF,CAAC;IAEF,6DAA6D;IAE7D,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,sIAAsI,EACtI,EAAE,EACF,KAAK,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DjB,CAAC,CAAC;IACC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/vm.js
CHANGED
|
@@ -11,10 +11,10 @@ function requireVM() {
|
|
|
11
11
|
export function register(deps) {
|
|
12
12
|
const { server } = deps;
|
|
13
13
|
// ── Connection management ─────────────────────────────────
|
|
14
|
-
server.tool("vm_connect", "Connect to a VM via
|
|
15
|
-
url: z.string().describe("
|
|
16
|
-
apiKey: z.string().optional().describe("
|
|
17
|
-
serviceId: z.string().optional().describe("
|
|
14
|
+
server.tool("vm_connect", "Connect to a VM via Minicor Desktop Service (Cloudflare Tunnel URL). Must be called before any other vm_* tool. Returns connection info and guidance on available automation approaches (CDP for browsers, uiautomation for desktop, requests for APIs).", {
|
|
15
|
+
url: z.string().describe("MDS base URL (Cloudflare Tunnel)"),
|
|
16
|
+
apiKey: z.string().optional().describe("MDS API key"),
|
|
17
|
+
serviceId: z.string().optional().describe("MDS service ID"),
|
|
18
18
|
}, async ({ url, apiKey, serviceId }) => {
|
|
19
19
|
try {
|
|
20
20
|
const health = await lds.health(url);
|
|
@@ -258,7 +258,7 @@ export function register(deps) {
|
|
|
258
258
|
errorStr.includes("ECONNREFUSED")) {
|
|
259
259
|
rpaAnalysis = {
|
|
260
260
|
pattern: "lds_connection_failed",
|
|
261
|
-
suggestion: "Could not reach the
|
|
261
|
+
suggestion: "Could not reach the Minicor Desktop Service. Check that the Cloudflare Tunnel is still active and the MDS process is running on the VM. Try vm_status to verify connectivity.",
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
else if (errorStr.includes("resolution") ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minicor/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Desktop and browser RPA automation, workflow management, and AI-powered debugging for the Minicor platform. Formerly Laminar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|