@extension.dev/mcp 10.10.9 → 10.10.10
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +52 -1
- package/README.md +8 -8
- package/claude/ARCHITECTURE.md +13 -13
- package/claude/CLAUDE.md +11 -10
- package/claude/README.md +4 -4
- package/claude/commands/extension-debug.md +1 -1
- package/claude/commands/extension-publish.md +1 -1
- package/claude/commands/extension.md +1 -1
- package/claude/rules/cross-browser.md +4 -3
- package/claude/rules/mcp-tools.md +446 -1009
- package/dist/module.js +4383 -1589
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/allowance.d.ts +1 -1
- package/dist/src/lib/boot-verdict.d.ts +5 -0
- package/dist/src/lib/bridge-tabs.d.ts +3 -1
- package/dist/src/lib/browser-family.d.ts +1 -0
- package/dist/src/lib/carrier-registry.d.ts +4 -0
- package/dist/src/lib/carrier.d.ts +10 -1
- package/dist/src/lib/cdp-connection.d.ts +2 -1
- package/dist/src/lib/cdp-devtools.d.ts +1 -0
- package/dist/src/lib/cdp-extension-page.d.ts +14 -2
- package/dist/src/lib/cdp-page-scripts.d.ts +2 -2
- package/dist/src/lib/cdp-port.d.ts +1 -1
- package/dist/src/lib/cdp.d.ts +13 -1
- package/dist/src/lib/create-answer.d.ts +20 -0
- package/dist/src/lib/credential-source.d.ts +25 -0
- package/dist/src/lib/credentials.d.ts +23 -0
- package/dist/src/lib/docs-tools.d.ts +9 -0
- package/dist/src/lib/engine-manifest-view.d.ts +1 -0
- package/dist/src/lib/envelope.d.ts +1 -1
- package/dist/src/lib/exec.d.ts +2 -0
- package/dist/src/lib/extension-identity.d.ts +7 -0
- package/dist/src/lib/first-build.d.ts +15 -0
- package/dist/src/lib/guest-load-oracle.d.ts +2 -1
- package/dist/src/lib/launch-flags.d.ts +2 -2
- package/dist/src/lib/match-patterns.d.ts +1 -1
- package/dist/src/lib/node-engine.d.ts +11 -0
- package/dist/src/lib/platform-hold.d.ts +1 -0
- package/dist/src/lib/process-identity.d.ts +5 -0
- package/dist/src/lib/process-manager.d.ts +4 -0
- package/dist/src/lib/project-manifest.d.ts +1 -0
- package/dist/src/lib/promote-outcome.d.ts +29 -0
- package/dist/src/lib/publish.d.ts +2 -0
- package/dist/src/lib/registry-access.d.ts +1 -0
- package/dist/src/lib/registry.d.ts +3 -1
- package/dist/src/lib/safari-automation.d.ts +2 -0
- package/dist/src/lib/session-browser.d.ts +5 -0
- package/dist/src/lib/session-paths.d.ts +1 -0
- package/dist/src/lib/store-review.d.ts +14 -2
- package/dist/src/lib/submit-outcome.d.ts +14 -0
- package/dist/src/lib/templates-cache.d.ts +13 -0
- package/dist/src/lib/types.d.ts +2 -1
- package/dist/src/lib/vendor/chrome-theme/chrome-theme-resolve.d.ts +1 -0
- package/dist/src/tools/assert.d.ts +3 -0
- package/dist/src/tools/create.d.ts +1 -0
- package/dist/src/tools/dev.d.ts +2 -2
- package/dist/src/tools/inspect-gecko.d.ts +1 -1
- package/dist/src/tools/logs-filter.d.ts +5 -2
- package/dist/src/tools/open.d.ts +3 -0
- package/dist/src/tools/project-create.d.ts +1 -0
- package/dist/src/tools/start.d.ts +2 -2
- package/dist/src/tools/stop.d.ts +9 -0
- package/dist/src/tools/storage.d.ts +0 -5
- package/dist/src/tools/store-status.d.ts +4 -0
- package/extensions/live-preview/chromium/action/index.css +1 -1
- package/extensions/live-preview/chromium/action/index.js +1 -1
- package/extensions/live-preview/chromium/background/service_worker.js +98 -4
- package/extensions/live-preview/chromium/manifest.json +1 -1
- package/package.json +3 -2
- package/server.json +3 -3
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "extension-mcp",
|
|
11
11
|
"source": "./",
|
|
12
12
|
"description": "MCP tools for browser extension development: scaffold from 50+ templates, run the dev server with HMR, inspect the live DOM and logs, and publish store-ready builds for Chrome, Edge, and Firefox.",
|
|
13
|
-
"version": "10.10.
|
|
13
|
+
"version": "10.10.10",
|
|
14
14
|
"category": "development",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "Cezar Augusto"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extension-mcp",
|
|
3
3
|
"description": "MCP tools for browser extension development: scaffold from 50+ templates, run the dev server with HMR, inspect the live DOM and logs, and publish store-ready builds for Chrome, Edge, and Firefox. Ships /extension, /extension-add, /extension-debug, and /extension-publish commands.",
|
|
4
|
-
"version": "10.10.
|
|
4
|
+
"version": "10.10.10",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cezar Augusto",
|
|
7
7
|
"email": "hello@extension.dev",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 10.10.10
|
|
4
|
+
|
|
5
|
+
Every sentence the server says is now backed by something it read
|
|
6
|
+
(BUGS_TO_FIX_MCP.md entries 45 to 112, two audits of 2026-10-05: a claims
|
|
7
|
+
census of about 2,030 sentences and a fixture sweep against the pinned
|
|
8
|
+
engine and the platform).
|
|
9
|
+
|
|
10
|
+
- Success is read, never assumed. Promote, submit, publish, project and
|
|
11
|
+
workspace create, logout and uninstall read the platform's or the
|
|
12
|
+
library's own answer and say `promoted-partially`, `submit-unconfirmed`,
|
|
13
|
+
`publish-unconfirmed`, `create-unconfirmed`, `not-installed` and the like
|
|
14
|
+
when it falls short. A failed read is reported as unreadable, never as an
|
|
15
|
+
empty list, across eval, open, the tab polls, session markers and
|
|
16
|
+
carriers.
|
|
17
|
+
- One resolver returns the token and the project it belongs to. An
|
|
18
|
+
unnamed call sends `EXTENSION_DEV_TOKEN` and takes its project from the
|
|
19
|
+
token's own claims, never from whichever stored login is active; a named
|
|
20
|
+
project sends its stored login first, the private registry grant
|
|
21
|
+
included.
|
|
22
|
+
- `extension_manifest_validate` judges each browser through the engine's
|
|
23
|
+
own prefix filter, checks every requested browser's references, refuses
|
|
24
|
+
an unknown target, and blocks only where the engine or the browser
|
|
25
|
+
refuses (a `service_worker` the engine rewrites for Firefox is a
|
|
26
|
+
warning).
|
|
27
|
+
- `extension_build` reads `zip_artifacts`, refuses a stale dist, reports a
|
|
28
|
+
timeout as `build-timeout`, uses the engine's own bundle-id rule, and
|
|
29
|
+
writes `firefox-based` builds where the engine does (`dist/gecko-based`).
|
|
30
|
+
- `extension_inspect` names the document it read after navigating, counts
|
|
31
|
+
uncaught exceptions as console errors, reports a section that threw as
|
|
32
|
+
`failedSections` instead of an empty value, and marks every cap.
|
|
33
|
+
- `extension_open` checks popup, options and sidebar against the manifest
|
|
34
|
+
before asking the engine, says when an open could not be confirmed, and
|
|
35
|
+
never counts a tab it rendered itself as the window.
|
|
36
|
+
- `extension_storage` reads a set back; `context` is gone, since the engine
|
|
37
|
+
runs every storage call in the background.
|
|
38
|
+
- `extension_assert` counts only the extension's own log lines, reads the
|
|
39
|
+
guest's id from the contract, compares storage values structurally, and
|
|
40
|
+
does not credit a background the dev build injected.
|
|
41
|
+
- `extension_stop` with `all` leaves sessions owned by another running
|
|
42
|
+
server alone unless `includeOtherServers` is true; stop and auth are
|
|
43
|
+
marked destructive.
|
|
44
|
+
- `extension_dev` reports the control channel from `ready.json`, and a boot
|
|
45
|
+
error that is not a compile error answers `boot-failed`.
|
|
46
|
+
- The tool reference `claude/rules/mcp-tools.md` is generated from the
|
|
47
|
+
schemas, and a test validates every example call in the docs against
|
|
48
|
+
them.
|
|
49
|
+
- Requires Node 22.12 or later, the floor of the engine this package runs
|
|
50
|
+
in-process.
|
|
51
|
+
- The release workflow publishes to npm before it pushes the version
|
|
52
|
+
commit and tag, so a failed publish no longer strands a tag.
|
|
53
|
+
|
|
3
54
|
## 10.10.9
|
|
4
55
|
|
|
5
56
|
- One approval now covers several projects in one workspace
|
|
@@ -114,7 +165,7 @@
|
|
|
114
165
|
of an extension whose policy forbids eval. Use `context: "page"` or
|
|
115
166
|
`extension_dom_snapshot` there.
|
|
116
167
|
|
|
117
|
-
- `extension_submit` and `
|
|
168
|
+
- `extension_submit` and `extension_release_status` (include: ["stores"]) link to the console's
|
|
118
169
|
Submissions tab at `/<workspace>/<project>/submissions`, where the page
|
|
119
170
|
moved; the old `/stores` address still redirects. `@extension.dev/urls`
|
|
120
171
|
moves to `^0.8.2`, which carries the new paths.
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ These tools give agents eyes on the live browser, so they debug from evidence in
|
|
|
29
29
|
- **Run** the dev server with HMR in Chrome, Edge, Firefox, Brave, Opera, Vivaldi, Yandex, Waterfox, LibreWolf, Zen, Floorp, or any Chromium- or Gecko-based binary, plus Safari on macOS (no HMR yet), no build config
|
|
30
30
|
- **See** the live DOM, unified logs from every extension context, `chrome.storage` contents, and the loaded-extension list
|
|
31
31
|
- **Act**: evaluate code in any context, trigger the action button and commands, reload the extension, replay events
|
|
32
|
-
- **Ship**: validate the manifest cross-browser, build for production, publish a shareable preview, and promote builds to release channels
|
|
32
|
+
- **Ship**: validate the manifest cross-browser, build for production, publish a shareable preview, and promote builds to release channels (a stable promotion asks for a human approval first)
|
|
33
33
|
|
|
34
34
|
Built on [Extension.js](https://extension.js.org), the open-source cross-browser extension framework.
|
|
35
35
|
|
|
@@ -146,8 +146,8 @@ npx @extension.dev/mcp login --project <workspace>/<project>
|
|
|
146
146
|
|
|
147
147
|
Two flags (or environment variables) narrow the server before an agent sees it:
|
|
148
148
|
|
|
149
|
-
- `--features=local` exposes
|
|
150
|
-
- `--no-ship`
|
|
149
|
+
- `--features=local` exposes the tools that work on this machine (create, run, inspect, build, plus docs search), which leaves 23 of the 32 tools (the 9 platform tools are off). `--features=platform` exposes only the extension.dev account, share, release and store tools. Both are on by default. Env: `EXTENSION_DEV_FEATURES`.
|
|
150
|
+
- `--no-ship` refuses the calls that put something in front of other people: `extension_publish`, `extension_release_promote`, `extension_submit` with `dryRun: false`, `extension_preview_web` with `share: true`, and a share revoke. Dry runs, share listing, login and project or workspace creation still work. Env: `EXTENSION_DEV_NO_SHIP=1`.
|
|
151
151
|
|
|
152
152
|
A refused call answers `E_TOOL_DISABLED` with the flag to change.
|
|
153
153
|
|
|
@@ -222,12 +222,12 @@ cp node_modules/@extension.dev/mcp/claude/commands/*.md ~/my-extension/.claude/c
|
|
|
222
222
|
| platform | `extension_project_create` | Create the extension.dev project for a built extension, or several under one approval, headless, via device approval |
|
|
223
223
|
| platform | `extension_preview_web` | Render a build in the web emulator, and share it as a link |
|
|
224
224
|
| platform | `extension_shares` | List every link you have shared, and revoke one permanently |
|
|
225
|
-
| platform | `extension_publish` |
|
|
225
|
+
| platform | `extension_publish` | Mint a shareable link for a build extension.dev already holds (nothing is uploaded) |
|
|
226
226
|
| platform | `extension_release_promote` | Promote a build to a release channel, headless |
|
|
227
|
-
| platform | `extension_submit` | Submit for store review: Chrome, Firefox and
|
|
227
|
+
| platform | `extension_submit` | Submit for store review: Chrome, Firefox, Edge and Safari, through extension.dev |
|
|
228
228
|
| platform | `extension_release_status` | Read release channels, recent builds, and store submission and review state |
|
|
229
229
|
|
|
230
|
-
Browser-launching tools (`dev`, `start`) shell out to the `extension` CLI, the project's own `node_modules/.bin/extension` when present, otherwise `npx extension@<pinned>` at the version this package is verified against;
|
|
230
|
+
Browser-launching tools (`dev`, `start`) shell out to the `extension` CLI, the project's own `node_modules/.bin/extension` when present, otherwise `npx extension@<pinned>` at the version this package is verified against; build, doctor, eval, storage, reload, open, dom_snapshot and assert spawn that CLI too, and the rest runs in-process.
|
|
231
231
|
|
|
232
232
|
## Asserting instead of guessing
|
|
233
233
|
|
|
@@ -286,8 +286,8 @@ and `extension_open` with `url` cannot open one on Safari: the bridge
|
|
|
286
286
|
navigates through a background eval, and Safari's MV3 background CSP blocks
|
|
287
287
|
eval, which also blocks `extension_eval` in `background`. Open the page in
|
|
288
288
|
Safari by hand, then read it. Safari has no CDP or RDP, so
|
|
289
|
-
`extension_inspect` has no Safari path
|
|
290
|
-
|
|
289
|
+
`extension_inspect` has no Safari path; `surface-rendered` reads the
|
|
290
|
+
surface through the relay there and can pass or fail.
|
|
291
291
|
|
|
292
292
|
Safari 27 and Safari Technology Preview 247 also ship Apple's own MCP server
|
|
293
293
|
inside `safaridriver` (enable Safari > Settings > Developer > "Allow remote
|
package/claude/ARCHITECTURE.md
CHANGED
|
@@ -14,7 +14,7 @@ examples repo (GitHub)
|
|
|
14
14
|
│
|
|
15
15
|
├── templates-meta.json Auto-generated registry (all templates, structured)
|
|
16
16
|
│ Generated by: scripts/generate-templates-meta.mjs
|
|
17
|
-
│ Published
|
|
17
|
+
│ Published at media.extension.land/templates/latest.json, with a pinned examples commit as fallback
|
|
18
18
|
│ Contains: slug, surfaces, framework, permissions, files, downloads, integrity
|
|
19
19
|
│ File paths are repo-relative: examples/<slug>/...
|
|
20
20
|
│
|
|
@@ -24,19 +24,19 @@ examples repo (GitHub)
|
|
|
24
24
|
|
|
25
25
|
## Three integration layers
|
|
26
26
|
|
|
27
|
-
### Layer 1:
|
|
27
|
+
### Layer 1: ai-claude template
|
|
28
28
|
|
|
29
|
-
**Location:** `examples/
|
|
29
|
+
**Location:** `examples/ai-claude/`
|
|
30
30
|
**Role in ecosystem:** An example in the examples repo, discoverable like any other template.
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
User: "Build me a Claude chatbot extension"
|
|
34
34
|
│
|
|
35
35
|
▼
|
|
36
|
-
npx extension create my-bot --template=
|
|
36
|
+
npx extension create my-bot --template=ai-claude
|
|
37
37
|
│
|
|
38
38
|
▼
|
|
39
|
-
Resolves → https://github.com/extension-js/examples/tree/main/examples/
|
|
39
|
+
Resolves → https://github.com/extension-js/examples/tree/main/examples/ai-claude
|
|
40
40
|
│
|
|
41
41
|
▼
|
|
42
42
|
go-git-it clones → copies to ./my-bot/ → installs deps → done
|
|
@@ -44,10 +44,10 @@ go-git-it clones → copies to ./my-bot/ → installs deps → done
|
|
|
44
44
|
|
|
45
45
|
**How it integrates with the examples pipeline:**
|
|
46
46
|
|
|
47
|
-
- `generate-templates-meta.mjs` auto-discovers it by scanning `examples/
|
|
47
|
+
- `generate-templates-meta.mjs` auto-discovers it by scanning `examples/ai-claude/src/manifest.json`
|
|
48
48
|
- Auto-detects: `uiContext: ["sidebar", "background"]`, `uiFramework: "react"`, `surfaces: ["sidebar", "background"]`
|
|
49
49
|
- Curated `template.meta.json` adds: featured flag, tags (ai, claude), difficulty, useCases, firstSteps
|
|
50
|
-
- CI builds it for Chrome/Edge/Firefox, packages as `.zip`, publishes
|
|
50
|
+
- CI builds it for Chrome/Edge/Firefox, packages as `.zip`, publishes it to media.extension.land
|
|
51
51
|
- `templates-meta.json` includes download URLs with SHA256 integrity
|
|
52
52
|
|
|
53
53
|
### Layer 2: Claude Code rules (CLAUDE.md)
|
|
@@ -76,7 +76,7 @@ Claude now knows:
|
|
|
76
76
|
- References `templates-meta.json` as the source of truth for template discovery
|
|
77
77
|
- Documents the GitHub URL resolution pattern that `extension create` uses
|
|
78
78
|
- Provides the `curl` command to fetch and query the catalog
|
|
79
|
-
- Documents the
|
|
79
|
+
- Documents the download URL pattern for pre-built distributions
|
|
80
80
|
- Teaches how to contribute new templates (template.meta.json format, generator script)
|
|
81
81
|
|
|
82
82
|
### Layer 3: MCP tools
|
|
@@ -91,19 +91,19 @@ Claude (via MCP) calls extension_templates({ surface: "sidebar", tags: ["ai"] })
|
|
|
91
91
|
MCP server fetches templates-meta.json (cached, 1hr TTL)
|
|
92
92
|
│
|
|
93
93
|
▼
|
|
94
|
-
Returns: [{ slug: "
|
|
94
|
+
Returns: [{ slug: "ai-claude", ... }, { slug: "transformers-js", ... }]
|
|
95
95
|
│
|
|
96
96
|
▼
|
|
97
|
-
Claude calls extension_templates({ action: "source", slug: "
|
|
97
|
+
Claude calls extension_templates({ action: "source", slug: "ai-claude", files: ["src/manifest.json", "src/lib/client.ts"] })
|
|
98
98
|
│
|
|
99
99
|
▼
|
|
100
|
-
MCP server fetches
|
|
100
|
+
MCP server fetches the file at the pinned examples commit
|
|
101
101
|
│
|
|
102
102
|
▼
|
|
103
103
|
Claude reads the source, understands the pattern, adapts it for the user
|
|
104
104
|
│
|
|
105
105
|
▼
|
|
106
|
-
Claude calls extension_create({ projectName: "my-bot", template: "
|
|
106
|
+
Claude calls extension_create({ projectName: "my-bot", template: "ai-claude" })
|
|
107
107
|
│
|
|
108
108
|
▼
|
|
109
109
|
MCP server calls extensionCreate() → same go-git-it flow as CLI
|
|
@@ -151,7 +151,7 @@ MCP server calls extensionCreate() → same go-git-it flow as CLI
|
|
|
151
151
|
|
|
152
152
|
1. **Single source of truth.** `templates-meta.json` is generated from the actual examples. No manual sync needed. Add a template to `examples/`, run `pnpm run generate`, and all three layers pick it up.
|
|
153
153
|
|
|
154
|
-
2. **The examples repo is the knowledge base.** The MCP server doesn't hard-code extension patterns, it reads them from examples. This means new patterns (like `
|
|
154
|
+
2. **The examples repo is the knowledge base.** The MCP server doesn't hard-code extension patterns, it reads them from examples. This means new patterns (like `ai-claude`) are immediately available to Claude without updating the MCP server.
|
|
155
155
|
|
|
156
156
|
3. **Graceful degradation.** Users who don't use MCP still benefit from CLAUDE.md. Users who don't use Claude Code still benefit from the template. Each layer works independently.
|
|
157
157
|
|
package/claude/CLAUDE.md
CHANGED
|
@@ -41,7 +41,7 @@ The extension.dev platform ships 50+ templates in the [examples](https://github.
|
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
# The full catalog with metadata (framework, surfaces, permissions, etc.)
|
|
44
|
-
curl -sL https://
|
|
44
|
+
curl -sL https://media.extension.land/templates/latest.json | jq '.templates[] | {slug, description, uiFramework, surfaces}'
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
**Pre-built distributions** are available for every template:
|
|
@@ -121,7 +121,8 @@ npm run preview
|
|
|
121
121
|
|
|
122
122
|
# Target a specific browser
|
|
123
123
|
npm run dev -- --browser=firefox
|
|
124
|
-
npm run build -- --browser=chrome
|
|
124
|
+
npm run build -- --browser=chrome
|
|
125
|
+
npm run build -- --browser=firefox
|
|
125
126
|
|
|
126
127
|
# Zip for distribution
|
|
127
128
|
npm run build -- --zip
|
|
@@ -200,13 +201,13 @@ The `extension_dom_snapshot` MCP tool wraps this verb one-to-one.
|
|
|
200
201
|
|
|
201
202
|
**Debugging protocol (Chromium CDP): `extension_inspect` MCP tool.** Connects directly to the running session's debug port. Use it when the bridge is not enough: closed shadow roots (`deepDom`), selector probes, DOM snapshots, console summaries, or navigating the tab to a URL before inspecting. Returns structured events:
|
|
202
203
|
|
|
203
|
-
- `
|
|
204
|
-
- `
|
|
205
|
-
- `
|
|
206
|
-
- `
|
|
207
|
-
- `
|
|
208
|
-
- `
|
|
209
|
-
- `
|
|
204
|
+
- `html` - full injected HTML (after content scripts run), with `htmlTruncated` when cut
|
|
205
|
+
- `summary` - root/script/style/link counts
|
|
206
|
+
- `meta` - readyState, viewport, frame count
|
|
207
|
+
- `domSnapshot` - structured tree (tag, id, classes, role; `domSnapshotTruncated` names the cap)
|
|
208
|
+
- `console` - error/warn counts + top unique messages
|
|
209
|
+
- `probes` - per-selector element counts and samples
|
|
210
|
+
- `extensionRoots` - extension root elements with reinject generations
|
|
210
211
|
|
|
211
212
|
### Unified logging (`--logs`)
|
|
212
213
|
|
|
@@ -229,7 +230,7 @@ npm run dev -- --logs info --log-url "example.com"
|
|
|
229
230
|
### Other debugging tools
|
|
230
231
|
|
|
231
232
|
- Use `--browser=firefox` to test cross-browser compatibility
|
|
232
|
-
- **Safari (macOS).** On Extension.js 4.1.28 or newer, `--browser=safari` builds the app, opens it, and after you enable the extension in Safari > Settings > Extensions it reloads on every save through the extension's bridge and streams background and content lines into the session log. Start it with `allowEval: true` and the bridge tools work: `extension_storage`, `extension_reload`, `extension_open` for surfaces, `extension_dom_snapshot` by tab id, `extension_logs`, and the assertions
|
|
233
|
+
- **Safari (macOS).** On Extension.js 4.1.28 or newer, `--browser=safari` builds the app, opens it, and after you enable the extension in Safari > Settings > Extensions it reloads on every save through the extension's bridge and streams background and content lines into the session log. Start it with `allowEval: true` and the bridge tools work: `extension_storage`, `extension_reload`, `extension_open` for surfaces, `extension_dom_snapshot` by tab id, `extension_logs`, and the assertions (`surface-rendered` reads the surface through the relay there). `extension_eval` in `content` or `page` needs a tab already open at the url, which you open in Safari by hand: `extension_open` with `url` and `extension_eval` in `background` are blocked by Safari's MV3 background CSP, and the engine says so. Safari has no CDP or RDP, so `extension_inspect` has no Safari path. Apple's Safari MCP server (`claude mcp add safari-mcp -- "/usr/bin/safaridriver" --mcp`, Safari 27+, after enabling Safari > Settings > Developer > "Allow remote automation and external agents") reads a page in its own isolated window with no extension-aware tool, and runs beside a dev session, since this server opens no automation session of its own.
|
|
233
234
|
- Check `dist/<browser>/` for build output
|
|
234
235
|
- Use `--wait` flag to check if dev session is ready (outputs ready.json contract)
|
|
235
236
|
- Use `npm run start` to test production builds (builds first, then launches)
|
package/claude/README.md
CHANGED
|
@@ -12,13 +12,13 @@ claude/
|
|
|
12
12
|
ARCHITECTURE.md How the template, CLAUDE.md, and MCP layers connect
|
|
13
13
|
commands/
|
|
14
14
|
extension.md /extension: create, dev, build, add features, debug
|
|
15
|
-
extension-add.md /extension-add:
|
|
15
|
+
extension-add.md /extension-add: plan a sidebar, popup, content script, etc. (the tool writes no files)
|
|
16
16
|
extension-debug.md /extension-debug: live DOM/console inspection
|
|
17
17
|
extension-publish.md /extension-publish: store submission prep
|
|
18
18
|
rules/
|
|
19
19
|
extension-dev.md Core rules: project structure, manifest, commands
|
|
20
20
|
cross-browser.md Cross-browser manifest field mapping
|
|
21
|
-
mcp-tools.md
|
|
21
|
+
mcp-tools.md MCP tool reference, generated from the server's schemas (pnpm docs:tools)
|
|
22
22
|
examples/
|
|
23
23
|
create-extension.md Example prompt: scaffold and customize an extension
|
|
24
24
|
add-sidebar.md Example prompt: add a sidebar panel to an existing extension
|
|
@@ -59,7 +59,7 @@ Claude Code will automatically pick up the instructions and know how to:
|
|
|
59
59
|
|
|
60
60
|
## How it connects to the examples repo
|
|
61
61
|
|
|
62
|
-
The [examples repo](https://github.com/extension-js/examples)
|
|
62
|
+
The template catalog (`templates-meta.json`) is read from `media.extension.land/templates/latest.json` first and from a pinned commit of the [examples repo](https://github.com/extension-js/examples) as the fallback, with a bundled snapshot when neither answers. It is the single source of truth for:
|
|
63
63
|
|
|
64
64
|
- **CLAUDE.md**, references it so Claude knows all available templates
|
|
65
65
|
- **MCP tools**, `extension_templates` fetches and queries it at runtime
|
|
@@ -69,4 +69,4 @@ When a new template is added to the examples repo, all three layers pick it up a
|
|
|
69
69
|
|
|
70
70
|
## License
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Apache-2.0
|
|
@@ -33,7 +33,7 @@ Debug the currently running extension dev session. The user said: $ARGUMENTS
|
|
|
33
33
|
|
|
34
34
|
To see what else is loaded in the browser (Chromium): `extension_list_extensions`.
|
|
35
35
|
|
|
36
|
-
**Safari sessions** (Extension.js 4.1.28+) have no CDP, but the bridge works once the extension is enabled in Safari: `extension_logs`, `extension_storage`, `extension_reload`, `extension_open` for surfaces, `extension_dom_snapshot` by tab id, and the assertions
|
|
36
|
+
**Safari sessions** (Extension.js 4.1.28+) have no CDP, but the bridge works once the extension is enabled in Safari: `extension_logs`, `extension_storage`, `extension_reload`, `extension_open` for surfaces, `extension_dom_snapshot` by tab id, and the assertions (`surface-rendered` reads the surface through the relay there). `extension_eval` in `content` or `page` needs a tab the user already opened at the url; `extension_open` with `url` and `extension_eval` in `background` are blocked by Safari's MV3 background CSP. `extension_inspect` has no Safari path. Apple's `safari-mcp` can read a page in its own window beside the dev session; neither it nor this server can open the popup or background page, which stay Web Inspector, attended.
|
|
37
37
|
|
|
38
38
|
4. **Diagnose common issues**
|
|
39
39
|
Based on what you find, check for:
|
|
@@ -22,7 +22,7 @@ Default to `chrome` and `firefox`. `all` means chrome, firefox, edge and safari.
|
|
|
22
22
|
- Firefox: a missing `browser_specific_settings.gecko.data_collection_permissions` declaration, which AMO now requires for new add-ons and updates
|
|
23
23
|
- a bundle over 10 MB, source maps in the production build, missing 128px icon
|
|
24
24
|
|
|
25
|
-
4. **Pick the build to submit.** Store review runs from a build on extension.dev, not from local files. Call `extension_release_status` with `include: "releases"` to find the sha. If
|
|
25
|
+
4. **Pick the build to submit.** Store review runs from a build on extension.dev, not from local files. Call `extension_release_status` with `include: ["releases"]` to find the sha. If no build of this version is listed, say so: a build comes from a push to the project's repository (the platform builds it), not from `extension_publish`, which only shares a build that already exists.
|
|
26
26
|
|
|
27
27
|
5. **Rehearse.** Call `extension_submit` with the browsers and `buildSha`, leaving `dryRun` at its default (`true`). Show the per-store credential rows. A store whose credentials are not healthy is fixed in the extension.dev console (the response names the page); drop it from `browsers` or stop.
|
|
28
28
|
|
|
@@ -12,7 +12,7 @@ Parse the user's intent from `$ARGUMENTS` and execute the matching action:
|
|
|
12
12
|
### "create <name>" or "new <name>", Scaffold a new extension
|
|
13
13
|
|
|
14
14
|
1. If MCP tool `extension_templates` is available, use it to find the best template matching the user's description (check for surface type, framework, and keywords)
|
|
15
|
-
2. If not, check the template catalog: `curl -sL https://
|
|
15
|
+
2. If not, check the template catalog: `curl -sL https://media.extension.land/templates/latest.json | jq '.templates[] | {slug, description, uiFramework, surfaces}'`
|
|
16
16
|
3. Run `npx extension@latest create <name> --template=<best-match>`
|
|
17
17
|
4. Report what was created and suggest `npm run dev`
|
|
18
18
|
|
|
@@ -70,8 +70,8 @@ Older Firefox ignores the `chromium:world` field and runs in the default isolate
|
|
|
70
70
|
## API differences
|
|
71
71
|
|
|
72
72
|
- Chromium: use `chrome.*` namespace for Chrome-specific APIs (sidePanel, etc.)
|
|
73
|
-
- Firefox:
|
|
74
|
-
- For cross-browser code:
|
|
73
|
+
- Firefox: `browser.*` is native; `chrome.*` also works there for most APIs
|
|
74
|
+
- For cross-browser code: the polyfill that maps `browser.*` to `chrome.*` on Chromium is on for `extension_dev` and `extension_start` by default and OFF for `extension_build` (pass `polyfill: true` to the build, or write `chrome.*` and check `typeof browser` yourself)
|
|
75
75
|
|
|
76
76
|
## Testing across browsers
|
|
77
77
|
|
|
@@ -82,5 +82,6 @@ npm run dev -- --browser=firefox
|
|
|
82
82
|
npm run dev -- --browser=edge
|
|
83
83
|
|
|
84
84
|
# Build for multiple browsers
|
|
85
|
-
npm run build -- --browser=chrome
|
|
85
|
+
npm run build -- --browser=chrome
|
|
86
|
+
npm run build -- --browser=firefox
|
|
86
87
|
```
|