@orkestrate/agent-webmcp 0.1.0 → 0.2.1

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 CHANGED
@@ -1,57 +1,136 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/orkestrate-dot-space/agent-webmcp/main/.github/assets/banner.png" alt="agent-webmcp: tools for every site your agent visits" width="100%">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@orkestrate/agent-webmcp"><img src="https://img.shields.io/npm/v/@orkestrate/agent-webmcp?color=000&label=npm" alt="npm version"></a>
7
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-000" alt="MIT license"></a>
8
+ <a href="https://web.orkestrate.space/webmcp/sites"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fagent-webmcp-index.agent-webmcp.workers.dev%2Findex.json&query=%24.sites&suffix=%20sites&label=directory&color=000" alt="Sites in the directory"></a>
9
+ </p>
10
+
1
11
  # agent-webmcp
2
12
 
3
- Browser drivers give an agent a browser. agent-webmcp turns the websites
4
- inside that browser into a searchable, callable toolkit.
13
+ Your agent is clicking through pages that already have typed tools.
14
+ agent-webmcp tells it which ones before it opens them.
15
+
16
+ Sites can now register [WebMCP](https://github.com/webmachinelearning/webmcp)
17
+ tools: named functions with a description and an input schema, callable from
18
+ the page. An agent that calls `searchFlights({origin, destination, ...})`
19
+ skips the screenshots, the guessed selectors and the retries. The catch is
20
+ that nothing tells the agent which sites have tools, so it drives the page
21
+ by hand anyway.
22
+
23
+ agent-webmcp is that missing lookup. One call, before the agent opens a
24
+ page:
25
+
26
+ ```console
27
+ $ agent-webmcp find "search flights"
28
+ googlechromelabs.github.io/searchFlights [unspecified]
29
+ Searches for flights with the given parameters.
30
+ open https://googlechromelabs.github.io/webmcp-tools/demos/react-flightsearch/
31
+ ```
32
+
33
+ | Without agent-webmcp | With agent-webmcp |
34
+ |---|---|
35
+ | Open the page, snapshot, find the form, type into each field, click search, snapshot again to check | `find` names the page and tool, open it, call `searchFlights` once with typed arguments |
36
+ | Breaks when the layout changes | Calls the interface the site publishes for agents |
37
+ | Never learns the site had a tool | Knows before the page loads |
5
38
 
6
- No browser ownership, no CDP, no directory to browse. A local BM25 index of
7
- per-site WebMCP tools (native + custom), a flagless `document.modelContext`
8
- polyfill, and targeted `.init.js` bundles your driver injects.
39
+ It works with the browser driver you already use: agent-browser, Playwright
40
+ MCP, Chrome DevTools MCP or OpenCode Browse. agent-webmcp never opens pages
41
+ or calls tools itself; your driver does. When nothing matches, `find` says
42
+ so, and the agent uses its driver as usual.
9
43
 
10
- ## Install
44
+ ## Quickstart
11
45
 
12
- ```sh
13
- npm i -g @orkestrate/agent-webmcp
14
- npx skills add orkestrate-dot-space/agent-webmcp
15
- agent-webmcp search "docs" # verify: must return matches, no setup needed
46
+ ```console
47
+ $ npm i -g @orkestrate/agent-webmcp
48
+ $ agent-webmcp setup
16
49
  ```
17
50
 
18
- ## Use
51
+ `setup` downloads the index, installs the agent skill (Claude Code, OpenCode
52
+ and any `~/.agents` client), adds the MCP server to OpenCode, and prints
53
+ one-line installs for Claude Code and Codex:
19
54
 
20
- ```sh
21
- agent-webmcp search "empty shopping cart" # BM25 over native + custom tools
22
- agent-webmcp get allbirds.com # schemas + entry URL + init script
23
- agent-webmcp save news.ycombinator.com ./hn.js --entry-url https://news.ycombinator.com/
24
- agent-webmcp sync # pull managed index (only network verb)
25
- agent-webmcp init [--stdout] # installed init.js path (or bytes)
55
+ ```console
56
+ $ claude mcp add agent-webmcp -s user -- agent-webmcp mcp
57
+ $ codex mcp add agent-webmcp -- agent-webmcp mcp
26
58
  ```
27
59
 
28
- Then, in your driver:
60
+ Some drivers need a flag to turn WebMCP on. [docs/drivers.md](docs/drivers.md)
61
+ has the setup for each one, checked on 18 Nov 2026.
62
+
63
+ Or skip all of this: the **Copy prompt** button on
64
+ [web.orkestrate.space/webmcp](https://web.orkestrate.space/webmcp) gives your
65
+ agent a prompt that installs and checks everything itself.
66
+
67
+ ## Check a site, a URL or a task
68
+
69
+ ```console
70
+ $ agent-webmcp find cal.com
71
+ cal.com/ask_cal_com [unspecified]
72
+ Ask a question about Cal.com (plans, features, integrations, self-hosting, the API) and get an answer grounded in the documentation.
73
+ open https://cal.com/
74
+
75
+ $ agent-webmcp find stripe.com
76
+ No indexed site has a tool for "stripe.com". Use your browser driver as usual.
77
+ ```
78
+
79
+ Site lookup is the main use: your agent already knows where it is going.
80
+ Task search covers the sites in the index. Add `--json` for each tool's
81
+ input schema.
82
+
83
+ ## The directory
84
+
85
+ Every indexed site and its tools are listed at
86
+ [web.orkestrate.space/webmcp/sites](https://web.orkestrate.space/webmcp/sites).
87
+ A bot rechecks every site weekly in a fresh Chromium, so listings reflect
88
+ what pages register today.
89
+
90
+ **Own a site with WebMCP tools?** Paste its URL into **Add your site**. The
91
+ bot checks it and lists it within a couple of minutes, with no account or
92
+ ownership proof needed. [CONTRIBUTING.md](CONTRIBUTING.md) has the rules.
93
+ Owners can ask for removal at support@orkestrate.space.
94
+
95
+ ## Commands
96
+
97
+ | Command | What it does |
98
+ |---|---|
99
+ | `find <site, URL or task>` | Check a site first, or search by task. `--json` for machine output. |
100
+ | `setup` | First run: index, skill, MCP wiring, driver notes. |
101
+ | `mcp` | Run an MCP server with one tool, `find`. |
102
+ | `update` | Check for a newer index now (it also checks hourly). |
103
+ | `upgrade [version]` | Upgrade agent-webmcp itself through npm (latest by default). |
104
+ | `status` | Show the index in use and where it came from. |
105
+
106
+ How matching, listing and index updates work: [docs/index.md](docs/index.md).
107
+
108
+ ## Next
109
+
110
+ Planned for 0.3, not shipped yet:
111
+
112
+ - **`call`**: open the page and call a site's tool in one command, from the
113
+ CLI or the MCP server. Tools marked consequential will need explicit
114
+ confirmation.
115
+ - **Registry**: `agent-webmcp add` for reviewed, versioned items, pinned in a
116
+ lockfile and kept current with `outdated` and `update`.
117
+
118
+ Watch the repo or follow the [changelog](CHANGELOG.md) to hear when they land.
29
119
 
30
- - OpenCode Browse MCP (code-mode): `page.evaluate(INIT_SOURCE)` with the
31
- `get`-emitted bundle bytes, then `window.webmcp.list()` / `call(name, args)`.
32
- Script-tag and init-script injection are neutered in the execute realm —
33
- evaluate-inline is the only working mount.
34
- - agent-browser: `agent-browser --init-script <bundle> open <url>`, then
35
- native `webmcp list` / `webmcp invoke <tool> --params '{...}'`.
120
+ ## Privacy
36
121
 
37
- Skill first: `agent-webmcp mcp serve` exposes
38
- `skill/search/get/save/init`. Install the skill with
39
- `npx skills add orkestrate-dot-space/agent-webmcp`.
122
+ No analytics. The CLI fetches only the public index (hourly, or on demand
123
+ with `update`), and the index server stores nothing about who reads it. Site
124
+ submissions keep the submitted URL and a salted hash of the submitter's IP
125
+ for rate limiting.
40
126
 
41
- ## Layout
127
+ ## Contributing
42
128
 
43
- `init.js` (polyfill), `src/` (cli, mcp, index-engine, compiler, runtime),
44
- `registry/` (managed index + custom site sources), `skills/`,
45
- `specs/v1.md` (the locked spec), `test/`.
129
+ Build from source with `cargo build --release`; the result is the same
130
+ binary npm ships. Bugs go in [issues](https://github.com/orkestrate-dot-space/agent-webmcp/issues),
131
+ security reports to [SECURITY.md](SECURITY.md). v1 is preserved on the
132
+ `archive/v1-main` branch.
46
133
 
47
- ## Trust model
134
+ ## License
48
135
 
49
- - Injected scripts never phone home; nothing uploads without `sync`/`save`.
50
- - `save` runs file top-level code in a `node:vm` sandbox with a stub
51
- registry (5s timeout, no `require`/`process`), but vm escape via
52
- constructor chains is not hardened — treat site scripts as code you
53
- review, same as any dependency. Only `sync` touches the network.
54
- - Custom in-page `fetch` obeys the host page's CSP; cross-origin API calls
55
- fail on CSP-strict sites (use CSP-permissive hosts or same-origin endpoints).
56
- - Every MCP/CLI result that came from a page is untrusted data, never
57
- instructions.
136
+ MIT
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ // Run the platform binary installed as an optional dependency. npm installs
3
+ // only the optional dependency matching this machine, so exactly one exists.
4
+ import { spawnSync } from "node:child_process";
5
+ import { chmodSync } from "node:fs";
6
+ import { createRequire } from "node:module";
7
+ import { join } from "node:path";
8
+ import { pathToFileURL } from "node:url";
9
+
10
+ const pkgs = {
11
+ "linux-x64": "@orkestrate/agent-webmcp-linux-x64",
12
+ "linux-arm64": "@orkestrate/agent-webmcp-linux-arm64",
13
+ "darwin-arm64": "@orkestrate/agent-webmcp-darwin-arm64",
14
+ "darwin-x64": "@orkestrate/agent-webmcp-darwin-x64",
15
+ "win32-x64": "@orkestrate/agent-webmcp-win32-x64",
16
+ };
17
+ const key = `${process.platform}-${process.arch}`;
18
+ const name = pkgs[key];
19
+ if (!name) {
20
+ console.error(`agent-webmcp: no binary for ${key}`);
21
+ process.exit(1);
22
+ }
23
+ const subpath = `${name}/bin/agent-webmcp${process.platform === "win32" ? ".exe" : ""}`;
24
+
25
+ function tryResolve(base) {
26
+ try {
27
+ return createRequire(base).resolve(subpath);
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+
33
+ // A folder install (`npm i ./packages/...`) symlinks the wrapper, and Node
34
+ // resolves symlinks before looking for siblings. Fall back to the project
35
+ // the command runs in, which lists the same optional dependency.
36
+ const bin =
37
+ tryResolve(import.meta.url) ??
38
+ tryResolve(pathToFileURL(join(process.cwd(), "package.json")).href);
39
+ if (!bin) {
40
+ console.error(`agent-webmcp: optional dependency ${name} is missing; reinstall with npm i -g @orkestrate/agent-webmcp`);
41
+ process.exit(1);
42
+ }
43
+ function run(bin) {
44
+ return spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
45
+ }
46
+
47
+ let r = run(bin);
48
+ if (r.error?.code === "EACCES" && process.platform !== "win32") {
49
+ // actions/upload-artifact does not preserve the exec bit, so a binary
50
+ // that lost it in transit lands non-executable. Repair once and retry.
51
+ try {
52
+ chmodSync(bin, 0o755);
53
+ r = run(bin);
54
+ } catch (e) {
55
+ console.error(`agent-webmcp: cannot execute ${bin}: ${e.message}`);
56
+ process.exit(1);
57
+ }
58
+ }
59
+ if (r.error) {
60
+ console.error(`agent-webmcp: cannot execute ${bin}: ${r.error.message}`);
61
+ process.exit(1);
62
+ }
63
+ // A signal kill (SIGTERM, SIGINT, ...) must propagate, not masquerade as
64
+ // exit 1, so supervisors and shells see the real cause.
65
+ if (r.signal) process.kill(process.pid, r.signal);
66
+ process.exit(r.status ?? 1);
package/bin/check.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ // Postinstall: fail loudly when no platform binary landed, so `agent-webmcp`
3
+ // never silently does nothing.
4
+ import { createRequire } from "node:module";
5
+
6
+ const pkgs = {
7
+ "linux-x64": "@orkestrate/agent-webmcp-linux-x64",
8
+ "linux-arm64": "@orkestrate/agent-webmcp-linux-arm64",
9
+ "darwin-arm64": "@orkestrate/agent-webmcp-darwin-arm64",
10
+ "darwin-x64": "@orkestrate/agent-webmcp-darwin-x64",
11
+ "win32-x64": "@orkestrate/agent-webmcp-win32-x64",
12
+ };
13
+ const name = pkgs[`${process.platform}-${process.arch}`];
14
+ if (!name) {
15
+ console.warn(`agent-webmcp: no binary for ${process.platform}-${process.arch}; this platform is untested`);
16
+ process.exit(0);
17
+ }
18
+ try {
19
+ createRequire(import.meta.url).resolve(`${name}/package.json`);
20
+ } catch {
21
+ console.error(`agent-webmcp: ${name} did not install. Check your npm optional-dependency settings and reinstall.`);
22
+ process.exit(1);
23
+ }
package/package.json CHANGED
@@ -1,50 +1,26 @@
1
1
  {
2
2
  "name": "@orkestrate/agent-webmcp",
3
- "version": "0.1.0",
4
- "description": "Turn websites into a searchable, callable WebMCP toolkit for your browser driver.",
3
+ "version": "0.2.1",
4
+ "description": "Check whether a site offers WebMCP tools before you open it, then use them with the browser driver you already use.",
5
5
  "license": "MIT",
6
+ "homepage": "https://github.com/orkestrate-dot-space/agent-webmcp#readme",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/orkestrate-dot-space/agent-webmcp.git"
9
10
  },
10
- "homepage": "https://github.com/orkestrate-dot-space/agent-webmcp",
11
- "keywords": [
12
- "webmcp",
13
- "mcp",
14
- "model-context-protocol",
15
- "browser-use",
16
- "ai-agents",
17
- "agent-skills"
18
- ],
19
11
  "type": "module",
20
12
  "bin": {
21
- "agent-webmcp": "dist/cli.js"
13
+ "agent-webmcp": "bin/agent-webmcp.js"
22
14
  },
23
- "files": [
24
- "dist/",
25
- "init.js",
26
- "registry/",
27
- "skills/",
28
- "README.md",
29
- "LICENSE",
30
- "CHANGELOG.md"
31
- ],
32
- "engines": {
33
- "node": ">=20"
15
+ "files": ["bin", "README.md"],
16
+ "optionalDependencies": {
17
+ "@orkestrate/agent-webmcp-linux-x64": "0.2.1",
18
+ "@orkestrate/agent-webmcp-linux-arm64": "0.2.1",
19
+ "@orkestrate/agent-webmcp-darwin-arm64": "0.2.1",
20
+ "@orkestrate/agent-webmcp-darwin-x64": "0.2.1",
21
+ "@orkestrate/agent-webmcp-win32-x64": "0.2.1"
34
22
  },
35
23
  "scripts": {
36
- "test": "bun test src init.test.ts test",
37
- "typecheck": "bunx tsc --noEmit",
38
- "build": "bun build ./src/cli.ts --outfile dist/cli.js --target node && chmod +x dist/cli.js",
39
- "build:binary": "bun build --compile ./src/cli.ts --outfile dist/agent-webmcp",
40
- "gate": "bun run typecheck && bun test src init.test.ts test"
41
- },
42
- "dependencies": {
43
- "@modelcontextprotocol/sdk": "1.32.1",
44
- "minisearch": "^7.2.0"
45
- },
46
- "devDependencies": {
47
- "@types/bun": "latest",
48
- "typescript": "latest"
24
+ "postinstall": "node bin/check.js"
49
25
  }
50
26
  }
package/CHANGELOG.md DELETED
@@ -1,20 +0,0 @@
1
- # Changelog
2
-
3
- ## Unreleased
4
-
5
- - Polyfill shorthands: `window.webmcp.<tool>(args)` bound at register time,
6
- unbound on unregister/abort. `get` emits `how_to_run` blocks (Browse
7
- evaluate-inline, agent-browser `--init-script`, Playwright MCP).
8
- - MCP `save` runs the full pipeline (validate → compile → merge, 64KB cap).
9
- - Registry seed: `upstash.com` (3 native), `allbirds.com` (12 native),
10
- `docs.stripe.com` (1 custom `ask_ai`, live-proven).
11
- - Verified native contract on Chrome 157: async `registerTool`,
12
- promise `getTools`, handle-based `executeTool`, string outputs parsed back.
13
-
14
- ## 0.1.0
15
-
16
- Complete rewrite from zero. `agent-webmcp` is now a capability layer, not a
17
- browser driver: flagless `document.modelContext` polyfill + `window.webmcp`
18
- facade (`init.js`), BM25 per-site index (`search`), targeted bundles
19
- (`get`), local authoring (`save`), managed sync (`sync`), stdio MCP
20
- (`skill/search/get/save/init`). No CDP, no tabs, no directory to browse.
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Orkestrate
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.