@explainui/mcp 0.1.0-beta.1 → 0.1.3
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 +71 -13
- package/dist/capture.d.ts +1 -0
- package/dist/capture.d.ts.map +1 -1
- package/dist/capture.js +2077 -27
- package/dist/capture.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -4
- package/dist/client.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +63 -30
- package/dist/index.js.map +1 -1
- package/dist/tools.d.ts +1 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +139 -31
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +195 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -3
- package/dist/types.js.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -29,9 +29,64 @@ Add to your `claude_desktop_config.json`:
|
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
### Cursor
|
|
32
|
+
### Cursor
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Add to `.cursor/mcp.json` in your project root:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"explainui": {
|
|
40
|
+
"command": "explainui-mcp",
|
|
41
|
+
"env": {
|
|
42
|
+
"EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### GitHub Copilot (VS Code)
|
|
50
|
+
|
|
51
|
+
Add to your VS Code `settings.json` or `.vscode/mcp.json`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcp": {
|
|
56
|
+
"servers": {
|
|
57
|
+
"explainui": {
|
|
58
|
+
"command": "explainui-mcp",
|
|
59
|
+
"env": {
|
|
60
|
+
"EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then in Copilot Chat, use agent mode (`@workspace`) and mention your ExplainUI project ID — Copilot will discover and call the MCP tools automatically.
|
|
69
|
+
|
|
70
|
+
### Windsurf
|
|
71
|
+
|
|
72
|
+
Add to your Windsurf MCP config (`~/.codeium/windsurf/mcp_config.json`):
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"explainui": {
|
|
78
|
+
"command": "explainui-mcp",
|
|
79
|
+
"env": {
|
|
80
|
+
"EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Cline
|
|
88
|
+
|
|
89
|
+
Open the Cline MCP settings panel in VS Code and add a new server with command `explainui-mcp` and the environment variable below.
|
|
35
90
|
|
|
36
91
|
## Environment Variables
|
|
37
92
|
|
|
@@ -54,17 +109,16 @@ Load your project configuration. **Call this first** before any analysis.
|
|
|
54
109
|
|
|
55
110
|
### `explainui_analyze`
|
|
56
111
|
|
|
57
|
-
Run a UX QA check. Captures screenshots
|
|
112
|
+
Run a UX QA check. Captures screenshots (desktop 1440×900, multiple scroll positions) and runs analysis against your project's UX constraints. Iteration is tracked automatically — never pass an iteration number.
|
|
58
113
|
|
|
59
114
|
| Parameter | Type | Required | Description |
|
|
60
115
|
|---|---|---|---|
|
|
61
116
|
| `project_id` | string | Yes | Project ID from attach step |
|
|
62
|
-
| `page_key` | string | Yes | Page to check
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `git_snapshot_hash` | string | No | Short SHA from pre-analysis commit |
|
|
117
|
+
| `page_key` | string | Yes | Page to check — must exactly match a `page_key` from attach |
|
|
118
|
+
| `changes_made` | string | Yes | What was built/changed since last analysis (40–2000 chars). For first run: describe the current state of the page. |
|
|
119
|
+
| `git_snapshot_hash` | string | No | Short SHA (`git rev-parse --short HEAD`). Pass `null` if git unavailable. |
|
|
66
120
|
|
|
67
|
-
**Returns:** Pass/fail verdict, per-check results, issues
|
|
121
|
+
**Returns:** Pass/fail verdict, per-check results, issues grouped by fix type, and a `NEXT STEP` instruction block that tells the agent exactly what to do next.
|
|
68
122
|
|
|
69
123
|
### `explainui_close_project`
|
|
70
124
|
|
|
@@ -78,14 +132,18 @@ End the session. Releases browser resources and clears cached config.
|
|
|
78
132
|
## Typical Workflow
|
|
79
133
|
|
|
80
134
|
```
|
|
81
|
-
1. explainui_attach_project
|
|
82
|
-
2. (
|
|
83
|
-
3. explainui_analyze → capture +
|
|
84
|
-
4. (
|
|
135
|
+
1. explainui_attach_project → load config, shows pages + quota, asks which to analyze
|
|
136
|
+
2. (user confirms pages, e.g. "homepage and pricing")
|
|
137
|
+
3. explainui_analyze → capture + analysis (iteration tracked automatically)
|
|
138
|
+
4. (agent applies all fixes listed)
|
|
85
139
|
5. explainui_analyze → re-check (iteration 2)
|
|
86
|
-
6.
|
|
140
|
+
6. ... repeat until next_action="done" or "review_human"
|
|
141
|
+
7. explainui_analyze → next confirmed page
|
|
142
|
+
8. explainui_close_project → cleanup when all pages done
|
|
87
143
|
```
|
|
88
144
|
|
|
145
|
+
The agent never needs to count iterations or ask whether to run analysis — the MCP response includes a `NEXT STEP` block with explicit instructions.
|
|
146
|
+
|
|
89
147
|
## Development
|
|
90
148
|
|
|
91
149
|
```bash
|
package/dist/capture.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { type CaptureResult } from "./types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Capture screenshots at all configured viewports for a given URL.
|
|
14
|
+
* Also runs deterministic DOM checks and extracts element maps.
|
|
14
15
|
* Returns base64-encoded JPEG screenshots with labels.
|
|
15
16
|
*/
|
|
16
17
|
export declare function captureAllViewports(url: string): Promise<CaptureResult>;
|
package/dist/capture.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAGL,KAAK,aAAa,EAYnB,MAAM,YAAY,CAAC;AAo6DpB;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAsK7E;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAKlD"}
|