@genclass/mcp 0.0.0-stage → 0.2.0
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/CHANGELOG.md +83 -0
- package/LICENSE +202 -0
- package/README.md +363 -2
- package/bin/genclass-mcp.mjs +21 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.js +3097 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +736 -0
- package/dist/index.js +2941 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -4
- package/plugin/.claude-plugin/plugin.json +30 -0
- package/plugin/.mcp.json +11 -0
- package/plugin/README.md +64 -0
- package/plugin/hooks/hooks.json +15 -0
- package/plugin/mcp.json +13 -0
- package/plugin/plugin.json +22 -0
- package/plugin/skills/genclass/SKILL.md +64 -0
- package/server.json +24 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 (2026-10-25)
|
|
4
|
+
|
|
5
|
+
The `0.1.0` on npm (published 2026-10-25) is an earlier build: eight tools, no `genclass_scan`, no `GENCLASS_REPORT`.
|
|
6
|
+
Everything below ships first in `0.2.0`.
|
|
7
|
+
|
|
8
|
+
- **`genclass_setup` installs the newest runtime line.** It prints `npm install @genclass/runtime@beta` (the agent
|
|
9
|
+
entry and interaction analytics need 0.3.0-beta.1 or later) for a project on 0.2.x, on a range without a version
|
|
10
|
+
(`*`, `latest`: npm's `latest` is still 0.2.x) or with an older copy in `node_modules`, and says what the project
|
|
11
|
+
has. The README's connect step names `@beta` first.
|
|
12
|
+
- **`genclass_scan {url, phone?, hosted?}`: audit any page in one step** ([docs/runtime/AGENT.md](../../docs/runtime/AGENT.md)
|
|
13
|
+
section 4.2). It runs `@genclass/runtime`'s `scan --json` (the project's own runtime when it has the command, else
|
|
14
|
+
`npx -y @genclass/runtime@beta`) in the project's folder: headless Chromium at desktop and phone sizes with the 23
|
|
15
|
+
measured visual checks, and returns a score and each problem with its element, selector and suggested CSS fix (page
|
|
16
|
+
text cleaned and labelled as data), plus the report as JSON (a second text block and `structuredContent`). It passes
|
|
17
|
+
`--local` unless the agent sets `hosted: true`, so without Playwright's Chromium it says how to install it instead
|
|
18
|
+
of sending the URL anywhere; `hosted: true` uses the genclass.dev page check (public pages only). The server's
|
|
19
|
+
instructions and the plugin skill say to scan a page before calling a UI change done. Nine tools.
|
|
20
|
+
|
|
21
|
+
- **Fixed: a race replay counts page lines.** Explore compares page text as counts, so a product name the page
|
|
22
|
+
always shows once and a stale result showed a second time was "only in the failing run"; the replay verdict then
|
|
23
|
+
checked presence only, and the card alone made every replay "reproduced", including after the fix. The finding's
|
|
24
|
+
evidence now keeps the counts (`textCounts`) and the verdict needs the line as many times as the failing run showed
|
|
25
|
+
it. Found by the end-to-end walkthrough, covered by a test.
|
|
26
|
+
- **Fixed: with `GENCLASS_REPORT` set, the tools' own calls are mirrored too.** The server's in-process API (what
|
|
27
|
+
`genclass_explain`, `genclass_replay`, `genclass_explore` and `genclass_clear` call when this session owns the
|
|
28
|
+
bridge) bypassed the reporting wrapper, so a dashboard only ever received the findings; the evidence read, the test,
|
|
29
|
+
replays armed and their verdicts, explore reports and clears reached it only through the bridge's HTTP path. Found
|
|
30
|
+
by the end-to-end walkthrough (`docs/evidence/e2e-walkthrough`), covered by a test.
|
|
31
|
+
- **Opt-in reporting to the app's dashboard** (`GENCLASS_REPORT`; [docs/runtime/AGENT.md](../../docs/runtime/AGENT.md)
|
|
32
|
+
section 4.5). Set to `on` (with `GENCLASS_DASHBOARD`) or to a dashboard link, the server mirrors its log of the loop
|
|
33
|
+
to that dashboard: each finding the bridge makes, each time the agent reads its evidence (`genclass_explain`), each
|
|
34
|
+
replay armed and each replay verdict, each regression test written, each explore report (page loads compared, races
|
|
35
|
+
found) and each clear: `POST /api/projects/<secret>/agent`, batched, best effort, ids, kinds, page paths, verdicts,
|
|
36
|
+
counts and times only, never page text. The dashboard's Closed-loop development view then draws every issue's path
|
|
37
|
+
(found, reproduced, fix proven, closed, or round again when a replay after a fix still reproduces it) with the
|
|
38
|
+
period's counts, lists the log newest first, and shows per production problem what the agent reproduced, tested and
|
|
39
|
+
proved fixed. Off unless set; nothing sent feeds a decision, a finding or a tool result.
|
|
40
|
+
|
|
41
|
+
- **Explore stops reporting order-dependent bookkeeping as races** ([docs/runtime/AGENT.md](../../docs/runtime/AGENT.md)
|
|
42
|
+
section 5.1, [RESULTS.md](../../docs/runtime/RESULTS.md) section 20). A reordered run is a race only when what the
|
|
43
|
+
page shows, its form values, the requests it sent or its errors differ from the request-order baseline; store values
|
|
44
|
+
that differ while the page is the same are listed as "Internal state only", and an overwrite a later response
|
|
45
|
+
repaired as "Along the way only", neither with a finding. A `[redacted]` value equals any value. Scenarios are
|
|
46
|
+
grouped with digits blanked, parenthesised counts dropped and a typing burst split by a label change joined again,
|
|
47
|
+
falling back to action kinds and element roles, then kinds, when names changed with the order; the report says how
|
|
48
|
+
many reordered runs it compared and says "0 compared" (no verdict) rather than "No race found" when none was. Race
|
|
49
|
+
finding titles, keys, replays and generated tests lead with what the page showed (store values only for a finding
|
|
50
|
+
with nothing else). Snapshots may carry up to 1,200 store fields and say how many the page left out. The explore
|
|
51
|
+
tool's description and the plugin skill say the same. On the Strapi admin's 21 interaction sessions the race-like
|
|
52
|
+
verdicts went from 16 to 0 (reordered runs reported as races: 62, all false, to 0; sessions without a usable verdict:
|
|
53
|
+
5 to 0), and the real 403 race is still found at 300, 600 and 900 ms (6 of 6 runs, 0 false); on a correct Redux
|
|
54
|
+
Toolkit Query page the false reports went from 18 of 18 reordered runs to 0; the e2e page still finds its race in 5
|
|
55
|
+
of 6 reordered runs and none on the fixed page.
|
|
56
|
+
|
|
57
|
+
- First version: the GenClass MCP server for coding agents ([docs/runtime/AGENT.md](../../docs/runtime/AGENT.md)).
|
|
58
|
+
A bridge on 127.0.0.1:47357 that pages connect to through `@genclass/runtime/agent`; eight tools
|
|
59
|
+
(`genclass_status`, `genclass_findings`, `genclass_explain`, `genclass_explore`, `genclass_replay`,
|
|
60
|
+
`genclass_analytics`, `genclass_setup`, `genclass_clear`); findings deduplicated and kept in
|
|
61
|
+
`.genclass/agent/state.json`; explore verdicts from final states against request-order baselines; replays with
|
|
62
|
+
reproduced / not reproduced verdicts; Playwright regression tests generated from a finding; new findings pushed as
|
|
63
|
+
Claude Code channel events or through a `UserPromptSubmit` hook; one bridge shared by every agent session on the
|
|
64
|
+
machine; production numbers read from the developer's GenClass dashboard. No dependencies. The bridge accepts pages
|
|
65
|
+
only from the developer's machine (or origins listed in `GENCLASS_AGENT_ORIGINS`), binds each run to the page that
|
|
66
|
+
registered it (origin and token), guards its agent API with a per-user token, quotes every page string it shows the
|
|
67
|
+
agent and strips invisible characters. A Claude Code plugin (`plugin/`: the server, the prompt hook and a skill) and
|
|
68
|
+
an MCP Registry entry (`server.json`) ship with it. Needs `@genclass/runtime` 0.3.0-beta.1 or later in the app
|
|
69
|
+
(`@genclass/runtime/agent`). Released by `.github/workflows/release-mcp.yml` from a `mcp-v<version>` tag.
|
|
70
|
+
- Ready for registries and directories: a `server.json` description of at most 100 characters (the official MCP
|
|
71
|
+
Registry's limit; checked against its 2025-12-11 schema and accepted by `mcp-publisher validate`), a `title` and
|
|
72
|
+
`websiteUrl`; the release workflow publishes it to the registry with GitHub OIDC (pinned, checksummed
|
|
73
|
+
`mcp-publisher`) after npm, and uploads an MCP Bundle (`npm run bundle`: `genclass-<version>.mcpb`, for Claude
|
|
74
|
+
Desktop and Smithery) as an artifact. Every launcher is pinned to the release (`npx -y @genclass/mcp@<version>`):
|
|
75
|
+
the plugin's server and hook, `init`, and the install blocks; `npm run sync` rewrites the pins from
|
|
76
|
+
`package.json` and the tests fail when one differs. Install blocks for Claude Code, Claude Desktop, Cursor (with an
|
|
77
|
+
install link), VS Code (`code --add-mcp` and an install link), Codex CLI, Gemini CLI, Windsurf, Cline, Goose, Zed,
|
|
78
|
+
JetBrains IDEs and OpenCode, printed by `genclass-mcp config [client]` and in the README; `genclass_setup` adds the
|
|
79
|
+
block for the client it runs in (from `clientInfo` at initialize). Every tool's annotations carry `title`,
|
|
80
|
+
`readOnlyHint`, `destructiveHint` and `openWorldHint`. The plugin has a README (what it installs, what the hook
|
|
81
|
+
sends where, how to turn it off), directory links in `plugin.json`, and an [Agent Plugins](https://agent-plugins.org)
|
|
82
|
+
`plugin.json` and `mcp.json` for Cursor and Codex; the repository root has `glama.json`, `gemini-extension.json`,
|
|
83
|
+
`llms-install.md` and `.cursor-plugin/marketplace.json`. Listing drafts: `docs/adoption/listings/mcp.md`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,364 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @genclass/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Your coding agent can see the race, replay it, and prove the fix.
|
|
4
|
+
|
|
5
|
+
An MCP server for Claude Code and other coding agents. It connects to the pages of your app running on your machine
|
|
6
|
+
(through [`@genclass/runtime`](https://www.npmjs.com/package/@genclass/runtime)'s agent link) and gives the agent:
|
|
7
|
+
|
|
8
|
+
- **What happened, in order.** Every click, request and response, the order the responses were delivered, what each
|
|
9
|
+
response wrote into the app's state, and uncaught errors with the click and request that led to them.
|
|
10
|
+
- **Bugs that never throw.** A response that overwrote newer data (the classic stale search result or lost edit), the
|
|
11
|
+
same order submitted twice by two clicks, and the on-device model's own detections.
|
|
12
|
+
- **Races found before users find them.** `genclass_explore` runs your steps again with the network answering in
|
|
13
|
+
different orders (and slower, if you like) and reports what ends differently from the run where responses came back
|
|
14
|
+
in order.
|
|
15
|
+
- **Proof.** `genclass_replay` delivers the exact order that produced a bug again, before your fix (reproduced) and
|
|
16
|
+
after it (not reproduced), and `genclass_explain` writes a Playwright test that fails while the bug is there.
|
|
17
|
+
|
|
18
|
+
Everything stays on your machine. No dependencies. The server is free. For developers who want the loop run for
|
|
19
|
+
them, GenClass runs it as a service under Enterprise: the MCP server, collector and dashboard hosted by GenClass or
|
|
20
|
+
inside your network ([genclass.dev/enterprise](https://genclass.dev/enterprise)).
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
Pick your client. Every block pins this release, so the client starts exactly this version;
|
|
25
|
+
`npx -y @genclass/mcp@0.2.0 config <client>` prints the same lines, and `genclass_setup` prints the block for the
|
|
26
|
+
client it runs in.
|
|
27
|
+
|
|
28
|
+
<!-- install:start (generated from src/clients.ts by `npm run sync -w @genclass/mcp`; edit it there) -->
|
|
29
|
+
|
|
30
|
+
### Claude Code
|
|
31
|
+
|
|
32
|
+
As a plugin (the server, a prompt hook that brings new findings to each prompt, and a skill that tells Claude when to use it):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/plugin marketplace add genclass-dev/GenClass-lib
|
|
36
|
+
/plugin install genclass@genclass
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or the server alone (`--scope project` writes `.mcp.json` for everyone on the project; `--scope user` for all your projects):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
claude mcp add --scope project genclass -- npx -y @genclass/mcp@0.2.0
|
|
43
|
+
# or: npx -y @genclass/mcp@0.2.0 init --hook (.mcp.json, plus the prompt hook in .claude/settings.json)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Claude Desktop
|
|
47
|
+
|
|
48
|
+
Settings, Developer, Edit Config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"genclass": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": [
|
|
56
|
+
"-y",
|
|
57
|
+
"@genclass/mcp@0.2.0"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Cursor
|
|
65
|
+
|
|
66
|
+
[](https://cursor.com/link/mcp/install?name=genclass&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBnZW5jbGFzcy9tY3BAMC4yLjAiXX0%3D) or `cursor://anysphere.cursor-deeplink/mcp/install?name=genclass&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBnZW5jbGFzcy9tY3BAMC4yLjAiXX0%3D`
|
|
67
|
+
|
|
68
|
+
Or `.cursor/mcp.json` in the project (`~/.cursor/mcp.json` for all projects):
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"genclass": {
|
|
74
|
+
"command": "npx",
|
|
75
|
+
"args": [
|
|
76
|
+
"-y",
|
|
77
|
+
"@genclass/mcp@0.2.0"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### VS Code
|
|
85
|
+
|
|
86
|
+
[](https://vscode.dev/redirect/mcp/install?name=genclass&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40genclass%2Fmcp%400.2.0%22%5D%7D) or from a terminal:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
code --add-mcp '{"name":"genclass","command":"npx","args":["-y","@genclass/mcp@0.2.0"]}'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or `.mcp.json` at the workspace root (the portable format; `.vscode/mcp.json` takes the same entry under `servers`):
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"genclass": {
|
|
98
|
+
"command": "npx",
|
|
99
|
+
"args": [
|
|
100
|
+
"-y",
|
|
101
|
+
"@genclass/mcp@0.2.0"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Codex CLI
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
codex mcp add genclass -- npx -y @genclass/mcp@0.2.0
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or `~/.codex/config.toml` (`.codex/config.toml` in a trusted project). The first start downloads the package, so allow more than the default 10 seconds:
|
|
115
|
+
|
|
116
|
+
```toml
|
|
117
|
+
[mcp_servers.genclass]
|
|
118
|
+
command = "npx"
|
|
119
|
+
args = ["-y", "@genclass/mcp@0.2.0"]
|
|
120
|
+
startup_timeout_sec = 30
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Gemini CLI
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
gemini mcp add genclass npx -- -y @genclass/mcp@0.2.0 # -s user: for all projects
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Or `.gemini/settings.json` in the project (`~/.gemini/settings.json` for all projects):
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"genclass": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": [
|
|
137
|
+
"-y",
|
|
138
|
+
"@genclass/mcp@0.2.0"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Windsurf (Devin Desktop)
|
|
146
|
+
|
|
147
|
+
`~/.codeium/windsurf/mcp_config.json` (Windsurf), `~/.config/devin/mcp_config.json` (Devin Desktop's Cascade agent; `%APPDATA%\devin\mcp_config.json` on Windows):
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"genclass": {
|
|
153
|
+
"command": "npx",
|
|
154
|
+
"args": [
|
|
155
|
+
"-y",
|
|
156
|
+
"@genclass/mcp@0.2.0"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Devin CLI and Devin Desktop's Devin Local agent:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
devin mcp add -s user genclass -- npx -y @genclass/mcp@0.2.0
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Cline
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
cline mcp add genclass --yes -- npx -y @genclass/mcp@0.2.0
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Or MCP Servers, Configure, Configure MCP Servers (`~/.cline/data/settings/cline_mcp_settings.json`):
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"mcpServers": {
|
|
180
|
+
"genclass": {
|
|
181
|
+
"command": "npx",
|
|
182
|
+
"args": [
|
|
183
|
+
"-y",
|
|
184
|
+
"@genclass/mcp@0.2.0"
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Goose
|
|
192
|
+
|
|
193
|
+
`goose://extension?cmd=npx&arg=-y&arg=%40genclass%2Fmcp%400.2.0&id=genclass&name=genclass&description=Find%20race%20conditions%20by%20reordering%20responses%2C%20replay%20one%2C%20prove%20the%20fix` (open it to install), or `goose configure` (Add Extension, Command-line Extension, command `npx -y @genclass/mcp@0.2.0`), or `~/.config/goose/config.yaml`:
|
|
194
|
+
|
|
195
|
+
```yaml
|
|
196
|
+
extensions:
|
|
197
|
+
genclass:
|
|
198
|
+
type: stdio
|
|
199
|
+
name: genclass
|
|
200
|
+
enabled: true
|
|
201
|
+
cmd: npx
|
|
202
|
+
args: ["-y", "@genclass/mcp@0.2.0"]
|
|
203
|
+
env_keys: []
|
|
204
|
+
envs: {}
|
|
205
|
+
timeout: 300
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Zed
|
|
209
|
+
|
|
210
|
+
`~/.config/zed/settings.json` (`.zed/settings.json` in the project), or Settings, AI, MCP Servers, Add Server:
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"context_servers": {
|
|
215
|
+
"genclass": {
|
|
216
|
+
"command": "npx",
|
|
217
|
+
"args": [
|
|
218
|
+
"-y",
|
|
219
|
+
"@genclass/mcp@0.2.0"
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### JetBrains IDEs
|
|
227
|
+
|
|
228
|
+
AI Assistant: Settings, Tools, AI Assistant, Model Context Protocol (MCP), Add, then this JSON. Junie: `.junie/mcp/mcp.json` in the project (`~/.junie/mcp/mcp.json` for all projects), same JSON:
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"mcpServers": {
|
|
233
|
+
"genclass": {
|
|
234
|
+
"command": "npx",
|
|
235
|
+
"args": [
|
|
236
|
+
"-y",
|
|
237
|
+
"@genclass/mcp@0.2.0"
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### OpenCode
|
|
245
|
+
|
|
246
|
+
`opencode.json` in the project (`~/.config/opencode/opencode.json` for all projects), or `opencode mcp add`:
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"$schema": "https://opencode.ai/config.json",
|
|
251
|
+
"mcp": {
|
|
252
|
+
"genclass": {
|
|
253
|
+
"type": "local",
|
|
254
|
+
"command": [
|
|
255
|
+
"npx",
|
|
256
|
+
"-y",
|
|
257
|
+
"@genclass/mcp@0.2.0"
|
|
258
|
+
],
|
|
259
|
+
"enabled": true
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
<!-- install:end -->
|
|
266
|
+
|
|
267
|
+
Any other MCP client: a stdio server, command `npx`, arguments `-y @genclass/mcp@0.2.0`, no environment variables
|
|
268
|
+
required.
|
|
269
|
+
|
|
270
|
+
Then connect the app's development build (once). The agent link needs the newest runtime line, `@genclass/runtime`
|
|
271
|
+
0.3.0-beta.1 or later: `npm install @genclass/runtime@beta` (a bare `npm install @genclass/runtime` gets npm's
|
|
272
|
+
`latest`, the older 0.2.x, which has no agent entry):
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { GenClass } from "@genclass/runtime";
|
|
276
|
+
import { connectAgent } from "@genclass/runtime/agent";
|
|
277
|
+
|
|
278
|
+
const rt = GenClass.init();
|
|
279
|
+
if (import.meta.env.DEV) connectAgent(rt); // Next.js: process.env.NODE_ENV === "development"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Load a page of the dev server and ask the agent for `genclass_status`. The agent can also ask `genclass_setup`, which
|
|
283
|
+
reads your `package.json` and shows the lines for your framework.
|
|
284
|
+
|
|
285
|
+
## What the agent does with it
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
you: the search results are sometimes for an older query
|
|
289
|
+
agent: genclass_findings → f1 [stale-write] /search: the response to GET /api/search "?q=reac"
|
|
290
|
+
overwrote "search.results" after a newer GET /api/search had already written it
|
|
291
|
+
genclass_explain f1 → steps, delivery order, a replay, a regression test
|
|
292
|
+
genclass_replay arm f1 → (loads the page, types) → result: REPRODUCED
|
|
293
|
+
(fixes the handler to keep only the latest answer, adds the test)
|
|
294
|
+
genclass_replay arm f1 → result: not reproduced
|
|
295
|
+
genclass_explore start {slow_ms: 600} → 8 runs → report: no race
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
On a real page in headless Chromium (the package's end-to-end check), explore found that race in 5 of 6 reordered runs
|
|
299
|
+
of a page that never showed it on the developer's fast backend, the generated test failed on the buggy page and passed
|
|
300
|
+
on the fixed one, and explore on the fixed page reported nothing. Details: [docs/runtime/AGENT.md](https://github.com/genclass-dev/GenClass-lib/blob/main/docs/runtime/AGENT.md).
|
|
301
|
+
|
|
302
|
+
## Tools
|
|
303
|
+
|
|
304
|
+
| tool | |
|
|
305
|
+
|---|---|
|
|
306
|
+
| `genclass_status` | connected pages, counts of findings, explore and replay state |
|
|
307
|
+
| `genclass_findings` | ranked, deduplicated findings: races, stale writes, errors, duplicate requests, model detections, visual checks |
|
|
308
|
+
| `genclass_explain` | one finding in causal order, the recorded steps, the replay, a Playwright regression test |
|
|
309
|
+
| `genclass_explore` | `start` / `report` / `stop`: find what depends on response order |
|
|
310
|
+
| `genclass_replay` | `arm` / `result`: reproduce one finding exactly |
|
|
311
|
+
| `genclass_analytics` | per-endpoint latency, error rates and request counts, learned relations and flows; production numbers from your GenClass dashboard |
|
|
312
|
+
| `genclass_setup` | the lines to add for your framework, and the config lines for the client it runs in |
|
|
313
|
+
| `genclass_scan` | `{url, phone?, hosted?}`: audit any page (the dev server or a site you do not own) with the 23 measured visual checks in headless Chromium: a score and each problem with its element, selector and a suggested CSS fix, plus the JSON report. Runs `npx @genclass/runtime@beta scan --json --local` (or the project's own runtime); needs Playwright's Chromium (`npx playwright install chromium`), or `hosted: true` for the genclass.dev page check (public pages only) |
|
|
314
|
+
| `genclass_clear` | forget recorded runs and findings |
|
|
315
|
+
|
|
316
|
+
## New findings without asking
|
|
317
|
+
|
|
318
|
+
- **Channels** (Claude Code research preview): start Claude Code with
|
|
319
|
+
`claude --dangerously-load-development-channels server:genclass` and new findings arrive in the session as they
|
|
320
|
+
happen (`notifications/claude/channel`).
|
|
321
|
+
- **Prompt hook** (part of the Claude Code plugin): `npx -y @genclass/mcp@0.2.0 init --hook` adds a `UserPromptSubmit`
|
|
322
|
+
hook to `.claude/settings.json`; each prompt then carries the findings that changed since the last one.
|
|
323
|
+
|
|
324
|
+
## Environment
|
|
325
|
+
|
|
326
|
+
| variable | default | |
|
|
327
|
+
|---|---|---|
|
|
328
|
+
| `GENCLASS_AGENT_PORT` | `47357` | the bridge's port (the page then needs `connectAgent(rt, { url })`) |
|
|
329
|
+
| `GENCLASS_STATE_DIR` | `.genclass/agent` | where findings persist between sessions; `none` keeps them in memory |
|
|
330
|
+
| `GENCLASS_DASHBOARD` | | your dashboard's private link, for `genclass_analytics` `production` (`sample` reads the public sample) |
|
|
331
|
+
| `GENCLASS_REPORT` | | `on` (with `GENCLASS_DASHBOARD`), or a dashboard link or secret: mirror this server's log of the loop to that dashboard's Closed-loop development view (each finding, each time its evidence is read, each replay armed and its verdict, each regression test written, each explore report, each clear), which draws every issue's path (found, reproduced, fix proven, closed, or round again) with counts and lists the log. Ids, kinds, page paths, verdicts, counts and times only, never page text; off unless set ([AGENT.md section 4.5](https://github.com/genclass-dev/GenClass-lib/blob/main/docs/runtime/AGENT.md)) |
|
|
332
|
+
| `GENCLASS_AGENT_ORIGINS` | | exact page origins allowed besides this machine's, e.g. `http://192.168.1.20:5173` (the page then needs `connectAgent(rt, { anyHost: true })`) |
|
|
333
|
+
| `GENCLASS_TOKEN_DIR` | `~/.genclass` | where the bridge keeps its API token (mode 0600) for the hook and other sessions |
|
|
334
|
+
|
|
335
|
+
## Security
|
|
336
|
+
|
|
337
|
+
The bridge listens on 127.0.0.1 only and checks the `Host` header. Pages may talk to it only from your machine
|
|
338
|
+
(`localhost`, `127.0.0.1`, `*.localhost`) or an origin you list in `GENCLASS_AGENT_ORIGINS` (a `*.test` or LAN dev host): a public
|
|
339
|
+
website, a router page or a captive portal you visit cannot plant findings, and a page can only add to its own run.
|
|
340
|
+
The agent API refuses browsers and needs a token only your user can read. Everything a page sends is validated,
|
|
341
|
+
capped, stripped of invisible characters and shown to the agent as quoted data, never as instructions. Nothing leaves
|
|
342
|
+
your machine (the exceptions are under Privacy). See section 6 of
|
|
343
|
+
[AGENT.md](https://github.com/genclass-dev/GenClass-lib/blob/main/docs/runtime/AGENT.md).
|
|
344
|
+
|
|
345
|
+
## Privacy
|
|
346
|
+
|
|
347
|
+
The server collects nothing and sends nothing to GenClass or anyone else. Findings stay on your machine, in
|
|
348
|
+
`.genclass/agent/` in the server's working directory (the project, for clients that start servers there; set
|
|
349
|
+
`GENCLASS_STATE_DIR` for clients that do not, such as Claude Desktop), which the server gitignores, and in the bridge's memory; the bridge's token is in
|
|
350
|
+
`~/.genclass`. The one request that leaves the machine is `genclass_analytics` `{source: "production"}`, which reads
|
|
351
|
+
your own GenClass dashboard when you set `GENCLASS_DASHBOARD` to its private link. `genclass_scan` loads the page the
|
|
352
|
+
agent names (that is the page's own traffic) in a local browser; only with `hosted: true` is the URL sent to the
|
|
353
|
+
genclass.dev page check, and when the project has no `@genclass/runtime` with `scan`, npx downloads it from npm. With `GENCLASS_REPORT` set (off by
|
|
354
|
+
default) the server also mirrors its log of the loop to that dashboard, in small batches: the id, kind and page path of
|
|
355
|
+
each finding, when its evidence was read, each replay armed and its verdict, when a regression test was written, each
|
|
356
|
+
explore report (page loads compared, races found) and each clear, so the dashboard's Closed-loop development view
|
|
357
|
+
draws every issue's path (found, reproduced, fix proven, closed, or round again) and lists what the agent did; never a
|
|
358
|
+
title, an evidence line, a snapshot or any page text, and nothing it sends feeds a decision. The runtime in your app has its
|
|
359
|
+
own disclosed diagnostics ([PRIVACY.md](https://github.com/genclass-dev/GenClass-lib/blob/main/PRIVACY.md)), which
|
|
360
|
+
`GenClass.init({ telemetry: false })` turns off; the agent link is not part of them.
|
|
361
|
+
|
|
362
|
+
## License
|
|
363
|
+
|
|
364
|
+
Apache-2.0
|