[codex] Add source-integrated WebMCP skill - #155
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8ac284b. Configure here.
Addresses feedback from Cursor Bugbot and Socket Security
Step 5 proves a tool is discoverable and that its executor ran, not that it did what it claimed. Add step 6: probe schema closure, required fields, types and constraints, error honesty, annotation honesty, clean rejection, and consequential gating against the live page, then verify the effect in the application rather than trusting the return value. Also: - Default --local validation to headed so the browser is visible; add --headless for CI and unattended runs. - Record that document.modelContext is the live accessor while navigator.modelContext is undefined, so the fallback is load-bearing. - Record that registerTool is idempotent by name with no unregister handle, which is what makes remount and hot reload safe. - Require handlers to read results back from application state instead of echoing the request, including polling asynchronous stores until they settle.
The self-invocation guard compared path.resolve(process.argv[1]) against fileURLToPath(import.meta.url). path.resolve normalizes . and .. but does not resolve symlinks, so when the skill is installed as a link the two paths never match, main() never runs, and the scanner prints nothing and exits 0. That is the default install shape for a Claude Code user, whose skill directory is a symlink to the real one, and step 1 points them at exactly that path. Resolve symlinks on both sides before comparing. Also tell the skill to report what each step found as it goes, rather than saving everything for the final report.
Dev servers commonly bind localhost only, so validating against http://127.0.0.1:PORT discovers zero tools while http://localhost:PORT works. The examples recommended the address that fails, and the symptom is indistinguishable from tools never registering. Point the examples at localhost and say what zero discovered tools usually means.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
/add-webmcp, a source-first skill that inventories an existing web app and implements first-party WebMCP tools around real routes, forms, handlers, services, schemas, and statepage.tools()API, with@browserbasehq/stagehandpinned to4.0.2Why step 6 exists
Discovery plus a passing
webmcp.e2e.jsonproves a tool is registered and that its executor ran. It does not prove the contract is sound: a handler can accept undeclared fields, silently coerce a string into a number, returnCompletedwith a null result when a required field is missing, or report success without changing anything. Every one of those passes step 5.Step 6 probes schema closure, required fields, types and constraints, error honesty, annotation honesty, clean rejection, and consequential gating against a live persistent browser session, then verifies the effect independently — DOM assertions where there is readable DOM, a screenshot where the surface is a canvas or chart.
Behaviour change
--localvalidation now runs headed by default so the browser is visible while it validates. Pass--headlessfor CI and unattended runs.--browserbaseis unaffected.E2E Test Matrix
node --test tests/*.test.mjspass 2, fail 0node scripts/validate-stagehand.mjs --url <eval site> --config tests/fixtures/browserbase-owned-webmcp.e2e.json --localdiscovered 4 WebMCP tool(s); 2 read-only invoked, failure and consequential left discovery-only;Validation passed: 4/4... --localwith no flag /... --local --headlessValidation passed--headlessopt-out both work.... --browserbase(no flag) /... --browserbase --headedBROWSERBASE_API_KEY is requirederror /--headed and --headless are only valid with --localValidation passed: 3/3FAIL set_active_tool: output.activeTool was "selection"; expected "ellipse"elementCount: 2; screenshot showed the labeled shape actually rendered, and it was the only shape present<canvas>with no readable DOM.Integration work on the third-party app was local only; nothing was pushed upstream.
Benchmark-informed hardening
additionalProperties: falsediscovery schemas with execute-time unknown-key rejectionNo benchmark repository changes were pushed upstream.
Note
Low Risk
Documentation and skill tooling only; no production app or auth paths in this repo are modified. Validator behavior change is limited to default headed local runs.
Overview
Introduces
add-webmcp, a Claude skill for making existing web apps agent-ready by analyzing source (routes, forms, server actions, schemas) and wiring first-party WebMCP tools into the app—distinct fromwebmcp-gen, which targets standalone init scripts from a live URL.The skill ships a seven-step workflow (boundary scan → capability inventory → contracts → integration → Stagehand verification → adversarial live probes → report), reference docs for implementation patterns and a quality rubric, plus
scan-codebase.mjs(bounded repo signal finder) andvalidate-stagehand.mjs(Stagehand 4.0.2page.tools()/ invoke / result checks againstwebmcp.e2e.json, with refusal of consequential invocations unless--allow-consequential). Local validation now runs headed by default (--headlessfor CI).Also adds eval prompts, unit tests (scanner + pre-browser consequential guard), e2e fixtures, MIT license, and registers the skill in the README and Claude plugin marketplace.
Reviewed by Cursor Bugbot for commit f3137f5. Bugbot is set up for automated code reviews on this repo. Configure here.