github/awesome-copilot / skills/webmcpify
webmcpify
UnverifiedWebMCP agent skill for curated core coverage or route-by-route parity — inventory an existing web app, integrate approved tools, then inspect, verify and heal them in a real browser. Use for "webmcpify", "add WebMCP", or "expose app actions to AI agents".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 31.3 KB |
| references/discovery.md | markdown | 8.5 KB |
| references/heal.md | markdown | 8.3 KB |
| references/integrate.md | markdown | 10.7 KB |
| references/inventory.md | markdown | 9.9 KB |
| references/native-compatibility.md | markdown | 5.3 KB |
| references/reverify.md | markdown | 11.3 KB |
| references/runtime.md | markdown | 8.7 KB |
| references/security.md | markdown | 5.0 KB |
| references/verify.md | markdown | 15.4 KB |
| references/workbench.md | markdown | 5.0 KB |
| scripts/workbench.mjs | script | 5.6 KB |
| templates/mutation-journal.js | script | 22.3 KB |
| templates/mutation-journal.ts | script | 25.8 KB |
| templates/webmcp-compat.js | script | 2.5 KB |
| templates/webmcp-jsx.d.ts | script | 2.3 KB |
| templates/webmcp-workbench.js | script | 37.9 KB |
| templates/webmcp.d.ts | script | 6.1 KB |
| templates/webmcp.spec.ts | script | 18.9 KB |
| templates/webmcpify.js | script | 12.0 KB |
| templates/webmcpify.ts | script | 12.5 KB |
| templates/well-known-webmcp.json | config | 1.2 KB |
| tests/README.md | markdown | 1.3 KB |
| tests/workbench-cli.test.mjs | script | 4.5 KB |
| tests/workbench.test.mjs | script | 5.4 KB |
scripts/workbench.mjs
View on GitHub#!/usr/bin/env node
import { createInterface } from 'node:readline/promises';
import { spawn } from 'node:child_process';
import { mkdir, readFile } from 'node:fs/promises';
import { createRequire } from 'node:module';
import { tmpdir } from 'node:os';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const here = dirname(fileURLToPath(import.meta.url));
const argv = process.argv.slice(2);
const playwrightVersion = '1.61.1';
const usage = 'Usage: node workbench.mjs --url <dev-url> [--manifest <path>] [--browser chromium|firefox|webkit] [--native] [--allow-playwright-install] [--allow-browser-download]';
const value = (flag, fallback) => {
const index = argv.indexOf(flag);
if (index === -1) return fallback;
const result = argv[index + 1];
if (!result || result.startsWith('--')) throw new Error(`${flag} needs a value.`);
return result;
};
if (argv.includes('--help')) {
console.log(usage);
process.exit(0);
}
const url = value('--url');
if (!url) {
console.error(usage);
process.exit(2);
}
const browserName = value('--browser', 'chromium');
if (!['chromium', 'firefox', 'webkit'].includes(browserName)) throw new Error(`Unsupported browser "${browserName}".`);
const native = argv.includes('--native');
if (native && browserName !== 'chromium') throw new Error('--native requires Chromium/Chrome.');
function run(command, args, options = {}) {
return new Promise((resolveRun, rejectRun) => {
const child = spawn(command, args, { stdio: 'inherit', ...options });
child.once('error', rejectRun);
child.once('exit', (code, signal) => {
if (code === 0) resolveRun();
else rejectRun(new Error(`${command} exited with ${signal ? `signal ${signal}` : `code ${code}`}.`));
});
});
}
async function consent(flag, action) {
if (argv.includes(flag)) return;
const instruction = `${action} requires explicit approval. Re-run with ${flag} to approve only this action.`;
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error(instruction);
const prompt = createInterface({ input: process.stdin, output: process.stdout });
try {
const answer = await prompt.question(`${action}? [y/N] `);
if (!/^y(es)?$/i.test(answer.trim())) throw new Error(instruction);
} finally {
prompt.close();
}
}
async function loadPlaywright() {
const localRequire = createRequire(import.meta.url);
try {
return { playwright: localRequire('playwright'), resolveModule: localRequire.resolve };
} catch (error) {
if (error?.code !== 'MODULE_NOT_FOUND' || !String(error.message).includes("'playwright'")) throw error;
}
const scratch = join(tmpdir(), `webmcpify-workbench-playwright-${playwrightVersion}`);
const scratchRequire = createRequire(join(scratch, 'package.json'));
try {
return { playwright: scratchRequire('playwright'), resolveModule: scratchRequire.resolve };
} catch (error) {
if (error?.code !== 'MODULE_NOT_FOUND' || !String(error.message).includes("'playwright'")) throw error;
}
await consent('--allow-playwright-install', `Install Playwright ${playwrightVersion} with npm into ${scratch} (no browser download)`);
await mkdir(scratch, { recursive: true });
console.error(`Preparing temporary Playwright ${playwrightVersion} runtime outside the target project…`);
await run(process.platform === 'win32' ? 'npm.cmd' : 'npm', [
'install', '--no-save', '--no-package-lock', `playwright@${playwrightVersion}`,
], { cwd: scratch, env: { ...process.env, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } });
return { playwright: scratchRequire('playwright'), resolveModule: scratchRequire.resolve };
}
const loaded = await loadPlaywright();
const { chromium, firefox, webkit } = loaded.playwright;
const browserType = { chromium, firefox, webkit }[browserName];
const manifestPath = value('--manifest');
const manifest = manifestPath ? JSON.parse(await readFile(resolve(manifestPath), 'utf8')) : { tools: [] };
const source = await readFile(resolve(here, '..', 'templates', 'webmcp-workbench.js'), 'utf8');
const bootSource = `globalThis.__WEBMCPIFY_WORKBENCH__ = ${JSON.stringify({ manifest, open: true })};\n${source}`;
const launchOptions = {
headless: false,
...(native ? { channel: 'chrome', args: ['--enable-features=WebMCP,WebMCPTesting'] } : {}),
};
let browser;
try {
browser = await browserType.launch(launchOptions);
} catch (error) {
const missingBundledBrowser = !native && /Executable doesn't exist|browserType\.launch: Executable/.test(String(error));
if (!missingBundledBrowser) throw error;
await consent('--allow-browser-download', `Download the Playwright ${browserName} browser into its browser cache`);
console.error(`Downloading the temporary ${browserName} browser runtime…`);
await run(process.execPath, [loaded.resolveModule('playwright/cli'), 'install', browserName]);
browser = await browserType.launch(launchOptions);
}
try {
const context = await browser.newContext();
await context.addInitScript({ content: bootSource });
const page = await context.newPage();
page.on('console', (message) => {
if (message.type() === 'error') console.error(`[page] ${message.text()}`);
});
await page.goto(url, { waitUntil: 'domcontentloaded' });
const evidence = await page.locator('#webmcpify-workbench').getAttribute('data-evidence');
console.log(`WebMCP Workbench: ${url} · ${browserName} · ${evidence}`);
console.log('Close the browser or press Ctrl+C to end the temporary session.');
await new Promise((resolveDone) => {
const done = () => resolveDone();
browser.on('disconnected', done);
process.once('SIGINT', done);
process.once('SIGTERM', done);
});
} finally {
await browser.close().catch(() => {});
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |