GenClass

io.github.genclass-dev由 GitHub 帳號 genclass-dev 發布v0.2.2更新於 Nov 6, 2026

Find race conditions in your web app by reordering its responses, replay one, prove the fix.

概覽

AI 產生的概覽

GenClass 記錄本機 Web 應用程式頁面中發生的事件,讓編碼助理找出依賴時序的缺陷、重現並驗證修正。

可以做什麼
  • 檢視已連線的開發頁面、已記錄的問題以及探索與重現狀態
  • 列出、排序並解釋回應順序競態、舊資料覆寫、未攔截錯誤、重複請求等問題
  • 執行探索工作階段,以不同回應順序重新載入頁面,並回報結果差異
  • 針對單一問題佈署精確重現並查看結果,同時產生 Playwright 回歸測試
  • 讀取本機各端點的延遲、錯誤率與學習到的流程,或從儀表板取得生產數據
  • 對頁面做視覺檢查、輸出專案接入設定行,並清除已記錄的執行與問題
適用情境
適合使用者回報間歇性問題時使用:有時發生、隨機發生、只在生產環境或慢速網路下發生、儲存後數值又跳回、結果過期、編輯遺失、重複送出,或手機上頁面橫向捲動。也適合在改動請求、送出、自動儲存或輪詢程式碼後驗證,以及在宣布介面改動完成前做版面檢查。
執行需求
以 npx 啟動的本機 stdio 程序執行,需要 Node.js。應用程式的開發組建需透過 GenClass 執行環境的 agent 連線接入,且僅限開發環境。頁面掃描需要 Playwright 的 Chromium。選用環境變數可設定橋接埠、狀態目錄、儀表板連結、回報與允許的來源。
安裝前請注意
它會記錄開發組建中的頁面活動、網路流量與應用程式狀態,並把問題存到磁碟。頁面內容被視為資料處理,但仍是記錄下來的應用程式資料。託管掃描會把頁面網址送到廠商的頁面檢查服務,設定回報變數會把流程中繼資料同步到儀表板。伺服器可能要求安裝套件或加入設定行,應逐項確認。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 GenClass,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@genclass/mcp

Your coding agent can see the race, replay it, and prove the fix.

An MCP server for Claude Code and other coding agents. It connects to the pages of your app running on your machine (through @genclass/runtime's agent link) and gives the agent:

  • What happened, in order. Every click, request and response, the order the responses were delivered, what each response wrote into the app's state, and uncaught errors with the click and request that led to them.
  • Bugs that never throw. A response that overwrote newer data (the classic stale search result or lost edit), the same order submitted twice by two clicks, and the on-device model's own detections.
  • Races found before users find them. genclass_explore runs your steps again with the network answering in different orders (and slower, if you like) and reports what ends differently from the run where responses came back in order.
  • Proof. genclass_replay delivers the exact order that produced a bug again, before your fix (reproduced) and after it (not reproduced), and genclass_explain writes a Playwright test that fails while the bug is there.

By default everything stays on your machine (see Privacy). No dependencies. The server is free. For developers who want the loop run for them, GenClass runs it as a service under Enterprise: the MCP server, collector and dashboard hosted by GenClass or inside your network (genclass.dev/enterprise).

Install

Pick your client. Every block pins this release, so the client starts exactly this version; npx -y @genclass/[email protected] config <client> prints the same lines, and genclass_setup prints the block for the client it runs in.

Claude Code

As a plugin (the server, a prompt hook that brings new findings to each prompt, and the genclass skill with the procedure):

/plugin marketplace add genclass-dev/genclass-plugin/plugin install genclass@genclass

Or the server alone (--scope project writes .mcp.json for everyone on the project; --scope user for all your projects). init also writes the skill to .claude/skills/genclass/SKILL.md (--no-skill leaves it out):

bash
claude mcp add --scope project genclass -- npx -y @genclass/[email protected]# or: npx -y @genclass/[email protected] init --hook   (.mcp.json and the skill, plus the prompt hook in .claude/settings.json)

Or just the skill (no server): npx skills add genclass-dev/genclass-plugin. (genclass-dev/genclass-plugin is this plugin at a repository root, assembled from this package; the marketplace in genclass-dev/GenClass lists the same plugin.)

Claude Desktop

Settings, Developer, Edit Config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

Cursor

[Add genclass MCP server to Cursor] or cursor://anysphere.cursor-deeplink/mcp/install?name=genclass&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBnZW5jbGFzcy9tY3BAMC4yLjIiXX0%3D

Or .cursor/mcp.json in the project (~/.cursor/mcp.json for all projects):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

VS Code

[Install in VS Code] or from a terminal:

bash
code --add-mcp '{"name":"genclass","command":"npx","args":["-y","@genclass/[email protected]"]}'

Or .mcp.json at the workspace root (the portable format; .vscode/mcp.json takes the same entry under servers):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

Codex CLI

As a plugin (the server and the genclass skill):

bash
codex plugin marketplace add genclass-dev/genclass-plugincodex plugin add genclass@genclass

Or the server alone:

bash
codex mcp add genclass -- npx -y @genclass/[email protected]

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:

toml
[mcp_servers.genclass]command = "npx"args = ["-y", "@genclass/[email protected]"]startup_timeout_sec = 30

Gemini CLI

As an extension (the server and the genclass skill):

bash
gemini extensions install https://github.com/genclass-dev/genclass-plugin

Or the server alone:

bash
gemini mcp add genclass npx -- -y @genclass/[email protected]   # -s user: for all projects

Or .gemini/settings.json in the project (~/.gemini/settings.json for all projects):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

Windsurf (Devin Desktop)

~/.codeium/windsurf/mcp_config.json (Windsurf), ~/.config/devin/mcp_config.json (Devin Desktop's Cascade agent; %APPDATA%\devin\mcp_config.json on Windows):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

Devin CLI and Devin Desktop's Devin Local agent:

bash
devin mcp add -s user genclass -- npx -y @genclass/[email protected]

Cline

bash
cline mcp add genclass --yes -- npx -y @genclass/[email protected]

Or MCP Servers, Configure, Configure MCP Servers (~/.cline/data/settings/cline_mcp_settings.json):

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

Goose

goose://extension?cmd=npx&arg=-y&arg=%40genclass%2Fmcp%400.2.2&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/[email protected]), or ~/.config/goose/config.yaml:

yaml
extensions:  genclass:    type: stdio    name: genclass    enabled: true    cmd: npx    args: ["-y", "@genclass/[email protected]"]    env_keys: []    envs: {}    timeout: 300

Zed

~/.config/zed/settings.json (.zed/settings.json in the project), or Settings, AI, MCP Servers, Add Server:

json
{  "context_servers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

JetBrains IDEs

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:

json
{  "mcpServers": {    "genclass": {      "command": "npx",      "args": [        "-y",        "@genclass/[email protected]"      ]    }  }}

OpenCode

opencode.json in the project (~/.config/opencode/opencode.json for all projects), or opencode mcp add:

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "genclass": {      "type": "local",      "command": [        "npx",        "-y",        "@genclass/[email protected]"      ],      "enabled": true    }  }}

Any other MCP client: a stdio server, command npx, arguments -y @genclass/[email protected], no environment variables required.

The genclass skill

The server's instructions (sent when it connects) tell the agent when to reach for GenClass: the symptom words ("sometimes", "randomly", "only in production", "on slow connections", a value that "flips back", stale or old results, lost edits, double submits, sideways scrolling), the code changes that call for an explore, the scan before a UI change is done, and the first call for each. The procedure (the explore arguments, the Playwright pairing, how to read a report, what to say when done, what to do when the tools are missing) is the genclass skill, plugin/skills/genclass/SKILL.md. Three ways to get it:

  • the plugin installs it with the server and the hook;
  • npx -y @genclass/[email protected] init writes it to .claude/skills/genclass/SKILL.md in the project (--no-skill leaves it out). The written file carries a genclass:init marker line: a rerun replaces a file with the marker and leaves one without it (yours, or edited), and says which;
  • npx skills add genclass-dev/genclass-plugin (the skills CLI: Codex, Cursor, Copilot, Gemini CLI, Claude Code and others) or gh skill install genclass-dev/genclass-plugin genclass (GitHub CLI 2.90 or later, for Copilot) installs the skill alone, with no server (the skill then says how to add one). npx skills add genclass-dev/GenClass installs the same file from this repository's root copy, skills/genclass/SKILL.md.

To remove it: delete .claude/skills/genclass/ (or the directory the skill tool wrote to); with the plugin, /plugin uninstall genclass@genclass.

Then connect the app's development build (once). The agent link needs the newest runtime line, @genclass/runtime 0.3.0-beta.1 or later: npm install @genclass/[email protected], the version this release was tested with (npm's latest is the older 0.2.x, which has no agent entry):

ts
import { GenClass } from "@genclass/runtime";import { connectAgent } from "@genclass/runtime/agent";
// Next.js: process.env.NODE_ENV === "development"if (import.meta.env.DEV) {  const rt = GenClass.init();  connectAgent(rt);}

A production build drops all of this (measured with Vite, esbuild and Next.js 15; the package's sideEffects list names neither entry). Load a page of the dev server and ask the agent for genclass_status. The agent can also ask genclass_setup, which reads your package.json and shows the lines for your framework.

The skill and the server's instructions tell the agent to show you each of these and wait for your yes: running that install or adding those lines; npx playwright install chromium and npm i -D playwright; genclass_scan with hosted: true; writing a fix or a test when you only asked what broke.

What the agent does with it

you:    the search results are sometimes for an older query; find out why and fix itagent:  genclass_findings → f1 [stale-write] /search: the response to GET /api/search "?q=reac"        overwrote "search.results" after a newer GET /api/search had already written it        genclass_explain f1 → steps, delivery order, a replay, a regression test        genclass_replay arm f1 → (loads the page, types) → result: REPRODUCED        (fixes the handler to keep only the latest answer, adds the test)        genclass_replay arm f1 → result: not reproduced        genclass_explore start {slow_ms: 600} → 9 runs → report: no race

On a real page in headless Chromium (the package's end-to-end check), explore found that race in 5 of 6 reordered runs of a page that never showed it on the developer's fast backend, the generated test failed on the buggy page and passed on the fixed one, and explore on the fixed page reported nothing. Details: docs/runtime/AGENT.md.

What it calls a race is what the page shows or writes, not the noise of a running page: an age that moved by the time the session took ("13 minutes ago", "14 minutes ago"), a field name made for each load and a different count of a POST that only reads are not differences by themselves; "3:30 PM" against "4:00 PM" and a save that never went out are. With slow_ms one load runs with no added delay (runs + 3 loads: 2 slow baselines, that one, and the reordered runs): what both slow baselines show and it does not is named as what a slow response alone does, and what only one of them does is "worth a look". A report that compared nothing says NO VERDICT, not "no race".

Tools

tool
genclass_statusconnected pages, counts of findings, explore and replay state
genclass_findingsranked, deduplicated findings: races, stale writes, errors, duplicate requests, model detections, visual checks
genclass_explainone finding in causal order, the recorded steps, the replay, a Playwright regression test
genclass_explorestart / report / stop: find what depends on response order
genclass_replayarm / result: reproduce one finding exactly
genclass_analyticsper-endpoint latency, error rates and request counts, learned relations and flows; production numbers from your GenClass dashboard
genclass_setupthe lines to add for your framework, and the config lines for the client it runs in
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/[email protected] 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, the URL is sent there); the agent asks before either
genclass_clearforget recorded runs and findings

New findings without asking

  • Channels (Claude Code research preview): start Claude Code with claude --dangerously-load-development-channels server:genclass and new findings arrive in the session as they happen (notifications/claude/channel).
  • Prompt hook (part of the Claude Code plugin): npx -y @genclass/[email protected] init --hook adds a UserPromptSubmit hook to .claude/settings.json; each prompt then carries the findings that changed since the last one.

Environment

variabledefault
GENCLASS_AGENT_PORT47357the bridge's port (the page then needs connectAgent(rt, { url }))
GENCLASS_STATE_DIR.genclass/agentwhere findings persist between sessions; none keeps them in memory
GENCLASS_DASHBOARDyour dashboard's private link, for genclass_analytics production (sample reads the public sample)
GENCLASS_REPORTon (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)
GENCLASS_AGENT_ORIGINSexact page origins allowed besides this machine's, e.g. http://192.168.1.20:5173 (the page then needs connectAgent(rt, { anyHost: true }))
GENCLASS_TOKEN_DIR~/.genclasswhere the bridge keeps its API token (mode 0600) for the hook and other sessions

Security

The bridge listens on 127.0.0.1 only and checks the Host header. Pages may talk to it only from your machine (localhost, 127.0.0.1, *.localhost) or an origin you list in GENCLASS_AGENT_ORIGINS (a *.test or LAN dev host): a public website, a router page or a captive portal you visit cannot plant findings, and a page can only add to its own run. The agent API refuses browsers and needs a token only your user can read. Everything a page sends is validated, capped, stripped of invisible characters and shown to the agent as quoted data, never as instructions. Nothing leaves your machine (the exceptions are under Privacy). See section 6 of AGENT.md.

Privacy

By default the server collects nothing and sends nothing to GenClass or anyone else. Findings stay on your machine, in .genclass/agent/ in the server's working directory (the project, for clients that start servers there; set 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 ~/.genclass. genclass_analytics {source: "production"} reads your own GenClass dashboard when you set GENCLASS_DASHBOARD to its private link. genclass_scan loads the page the agent names (that is the page's own traffic) in a local browser; only with hosted: true is the URL sent to the genclass.dev page check, and when the project has no @genclass/runtime with scan, npx downloads the version this release pins, @genclass/[email protected], from npm. With GENCLASS_REPORT set (off by default) the server also mirrors its log of the loop to that dashboard, in small batches: the id, kind and page path of each finding, when its evidence was read, each replay armed and its verdict, when a regression test was written, each explore report (page loads compared, races found) and each clear, so the dashboard's Closed-loop development view draws every issue's path (found, reproduced, fix proven, closed, or round again) and lists what the agent did; never a title, an evidence line, a snapshot or any page text, and nothing it sends feeds a decision.

The lines above start the runtime in development builds only. On a local or private address it sends no diagnostics (it does fetch its on-device model from jsDelivr). Running it in production is a separate choice this server does not need: outside the check GenClass.init() runs for every visitor and sends its disclosed anonymous diagnostics from public hosts by default (PRIVACY.md), which GenClass.init({ telemetry: false }) turns off; the agent link is not part of them.

License

Apache-2.0

來源:packages/mcp/README.md,提交 cc78bfc

工具

9

genclass_status

GenClass status

Which pages on this machine are connected to GenClass (route, schedule, model state), counts of findings by kind, the explore session and armed replays. Call it first in a web project, and before you test a page.

無需輸入參數。

genclass_findings

GenClass findings

What GenClass recorded in pages on this machine, ranked and deduplicated with counts: races found by explore (final state depends on response order), responses that overwrote newer data, uncaught errors (with the click and request before them), the same request sent twice by two clicks, the on-device model's detections, visual checks. Use when the user reports an intermittent bug, after changing data-fetching or submit code, or before saying a UI change is done.

輸入參數kindlimitroutesince_minutes

genclass_explain

Explain a GenClass finding

Everything about one finding: what happened in causal order (click → request → response → state write), the recorded steps and delivery order, what differed from the request-order baseline, the model's facts, how to replay it exactly, and a Playwright regression test that fails while the bug is there.

輸入參數id必填

genclass_explore

Explore response orders

Find races before users do. action "start" arms the next page loads: 2 baselines with responses in request order (with `slow_ms`, a third with no added delay), then `runs` loads where overlapping responses arrive in a seeded different order (optionally slower, or with `focus` endpoints last). Run the same scenario once per armed load, then action "report": each load's final state is compared with the baseline; a difference in what the page shows, its form values, the requests it sent or its errors depends on network timing (a race), and comes with a seed that replays it. Store values that differ while the page is the same are listed apart as internal state. Without `route`, the page of the first armed load is the page under test; set `route` when the scenario loads several pages. Armed loads expire after 30 minutes. "stop" disarms.

輸入參數idrunsseedfocusrouteaction必填slow_ms

genclass_replay

Replay a finding

Reproduce one finding exactly. action "arm": the next page load of the finding's route gets the delivery order that produced it; do the same steps (genclass_explain lists them). action "result": whether that replay reproduced it. Use before a fix to confirm the bug and after it to prove the fix.

輸入參數id必填timesaction必填

genclass_analytics

GenClass analytics

What GenClass measured about the app. local: per-endpoint request counts, median and p95 latency, error rates and failure streaks; per-page runs, errors and overwritten fields; learned relations between fields and learned flows, from pages on this machine. production: the GenClass dashboard's sessions, detections by diagnosis and page, and latest decisions (needs GENCLASS_DASHBOARD, the dashboard's private link; "sample" reads the public sample).

輸入參數rangeroutesource

genclass_setup

Set up GenClass

The lines to add so this project's dev build connects to GenClass (detects Vite, Next.js and others from package.json), how to check it works, and this MCP client's config lines for keeping the server configured. It changes no file; show the user the lines and wait for a yes before you run or add them.

無需輸入參數。

genclass_scan

Scan a page for visual bugs

Audit one page in one step with GenClass's 23 measured visual checks: text you cannot read against its background, images, fonts, stylesheets and media that failed to load, a page that scrolls sideways on a phone, controls stuck under fixed bars, layers that swallow clicks, covered dialogs, template leaks like {{name}} or [object Object]. It loads the URL headless at desktop and phone sizes in Playwright's Chromium on this machine (when that is missing it says how to install it); hosted: true runs it on the genclass.dev page check instead, which adds accessibility, speed and security audits, takes public pages only and is the one case where the URL leaves this machine and returns a score and each problem with its element, selector and a suggested CSS fix, worst first, plus the JSON report. Use it before you call a page or UI change done, after CSS or layout changes, and on a site you do not own. Works on any URL, including the dev server (http://localhost:5173/); no page needs GenClass installed.

輸入參數url必填phonehosted

genclass_clear

Clear GenClass records

Forget recorded runs and findings on this machine (all, findings or runs), e.g. after a fix to start clean.

輸入參數what

版本歷史

3
  1. v0.2.2最新Nov 5, 2026
  2. v0.2.1Oct 29, 2026
  3. v0.2.0Oct 26, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分