@extension.dev/mcp 3.17.0-canary.1779910200.ddcd9eb → 4.0.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # Changelog
2
+
3
+ ## 4.0.8
4
+
5
+ Tracks the `extension` 4.0.8 suite (the versioning convention: this package's
6
+ version follows the CLI suite release it pairs with). One tool was added since
7
+ 3.17.0, `extension_release_promote`, bringing the surface to 27 tools.
8
+
9
+ - Bump `extension-create`, `extension-develop`, `extension-install` from
10
+ ^3.13.5 to ^4.0.8. All consumed APIs (`extensionCreate`, `extensionBuild`,
11
+ `extensionInstall`, `getManagedBrowsersCacheRoot`) and all CLI verbs the
12
+ tools shell out to (`dev`, `start`, `preview`, `logs`, `eval`, `storage`,
13
+ `reload`, `open`, `inspect`, `publish`, including `--allow-control`,
14
+ `--allow-eval` and `--no-browser`) are unchanged in 4.x; verified
15
+ end-to-end (create -> build -> dev ready contract -> manifest validate).
16
+ - `package.json` version now matches the published line (was a stale 0.0.1)
17
+ and the server reports its version from `package.json` instead of a
18
+ hardcoded string (previously stuck at 3.13.5).
19
+ - `browser-extension-manifest-fields` ^2.2.8 -> ^2.2.9.
20
+ - vitest config: resolve the extension-* test aliases from the packages'
21
+ exports maps; 4.x dropped the CJS entry, so `require.resolve` on the bare
22
+ specifier no longer works.
23
+
24
+ ## 3.17.0
25
+
26
+ First stable release on npm. The registry previously carried only canary
27
+ builds (3.17.0-canary.*), so `npx @extension.dev/mcp` resolved a canary;
28
+ this release graduates that line to stable and becomes `latest`.
29
+
30
+ - 26 tools across scaffolding, build/dev/preview, live inspection (CDP +
31
+ agent bridge), act tools (eval/storage/reload/open), browser management,
32
+ and platform auth/publish.
33
+ - Claude Code integration assets (CLAUDE.md, slash commands, rules) and the
34
+ @extension.dev/skill pairing.
35
+ - MIT license shipped; repository moved to extensiondev/mcp.
36
+
1
37
  # @extension.dev/mcp — Changelog
2
38
 
3
39
  ## Unreleased — agent-bridge tools
@@ -34,3 +70,36 @@ New tools (22 total):
34
70
  Internal: `lib/act` (CLI shell-out helper), `lib/exec.runExtensionCli` (capture),
35
71
  `lib/cdp.getClosedShadowRoots`. Test infra aligned to the workspace vitest
36
72
  catalog.
73
+
74
+ ## Unreleased — login (auth tools)
75
+
76
+ Adds the missing `login` flow so `extension_publish` no longer requires the user
77
+ to mint and export `EXTENSION_DEV_TOKEN` by hand. Auth stays auth-AWARE: the
78
+ token lives in a local credentials file, never in the MCP process state or logs.
79
+
80
+ New tools (25 total):
81
+
82
+ - **`extension_login`** — GitHub **device-code** flow (no local server; works
83
+ headless). Two-phase: call with `project` (`<workspace>/<project>`) to get a
84
+ code + URL, call again with the returned `deviceCode` to finish. On success it
85
+ writes a project-scoped token to the credentials file. Never returns the token.
86
+ - **`extension_whoami`** — report the stored workspace/project and token expiry
87
+ without revealing the token.
88
+ - **`extension_logout`** — delete the local credentials file.
89
+
90
+ Token resolution for publish is now `EXTENSION_DEV_TOKEN` env **>** the
91
+ credentials file (expired file tokens are ignored).
92
+
93
+ Credentials file (versioned, `0600`): `$XDG_CONFIG_HOME/extension-dev/auth.json`
94
+ (or `~/.config/...`; `%APPDATA%\extension-dev\auth.json` on Windows).
95
+
96
+ Platform endpoints this depends on (in `apps/www.extension.dev`):
97
+
98
+ - `GET /api/cli/login/config` — public GitHub OAuth client id + scope.
99
+ - `POST /api/cli/login/exchange` — trades a GitHub **user** token for a
100
+ project-scoped access token after checking workspace membership. Modeled on
101
+ `/api/oidc/exchange`; tokens are recorded so they stay revocable.
102
+
103
+ > ⚠️ **Ops:** the device flow requires **device flow enabled** on the GitHub
104
+ > OAuth App behind `WWW_GITHUB_OAUTH_CLIENT_ID`. Until then, `extension_login`
105
+ > can't complete and users fall back to a dashboard-minted `EXTENSION_DEV_TOKEN`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Extension Dev
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.
package/README.md CHANGED
@@ -1,27 +1,46 @@
1
+ [npm-version-image]: https://img.shields.io/npm/v/%40extension.dev%2Fmcp
2
+ [npm-version-url]: https://www.npmjs.com/package/@extension.dev/mcp
3
+ [action-image]: https://github.com/extensiondev/mcp/actions/workflows/ci.yml/badge.svg?branch=main
4
+ [action-url]: https://github.com/extensiondev/mcp/actions
5
+
6
+ [![Version][npm-version-image]][npm-version-url] [![workflow][action-image]][action-url]
7
+
1
8
  # @extension.dev/mcp
2
9
 
3
- MCP server for building, debugging, and publishing cross-browser extensions. Exposes 15 tools that let AI assistants scaffold, develop, build, inspect, and debug extensions using the [extension.dev](https://extension.dev) platform and template catalog.
10
+ Give your AI agent hands for browser extension development. One command connects Claude Code, Claude Desktop, Cursor, or any MCP client to 26 tools that scaffold, run, inspect, debug, and publish cross-browser extensions:
11
+
12
+ ```bash
13
+ claude mcp add extension-dev npx @extension.dev/mcp
14
+ ```
15
+
16
+ Extensions fail silently: content scripts that never inject, panels that never open, permissions that return `undefined` with no error. These tools give agents eyes on the live browser (DOM probes, unified logs from every context, storage access, event replay) so they debug from evidence instead of guessing. Scaffolding draws on the 60+ template catalog of the [extension.dev](https://extension.dev) platform, built on [Extension.js](https://extension.js.org).
4
17
 
5
18
  ## What's in this package
6
19
 
7
20
  ```
8
21
  @extension.dev/mcp
9
- src/ MCP server source (15 tools across 3 tiers)
22
+ src/ MCP server source (26 tools)
10
23
  claude/ Claude Code integration (CLAUDE.md, slash commands, rules)
11
24
  bin/ CLI entrypoint
12
25
  ```
13
26
 
14
- **MCP server** programmatic bridge between AI assistants and the extension.dev platform. Imports from published npm packages:
27
+ **MCP server**: programmatic bridge between AI assistants and the extension.dev platform. Imports from published npm packages:
15
28
 
16
- - `extension-create` project scaffolding
17
- - `extension-develop` build/dev/preview
18
- - `extension-install` managed browser binaries
29
+ - `extension-create`: project scaffolding
30
+ - `extension-develop`: build/dev/preview
31
+ - `extension-install`: managed browser binaries
19
32
 
20
- **Claude Code integration** drop-in instructions, slash commands, and rules for Claude Code:
33
+ **Claude Code integration**: drop-in instructions, slash commands, and rules for Claude Code:
21
34
 
22
- - `claude/CLAUDE.md` project-level instructions for any extension project
23
- - `claude/commands/` slash commands (`/extension`, `/extension-add`, `/extension-debug`, `/extension-publish`)
24
- - `claude/rules/` rules for extension development, cross-browser compat, and MCP tools
35
+ - `claude/CLAUDE.md`: project-level instructions for any extension project
36
+ - `claude/commands/`: slash commands (`/extension`, `/extension-add`, `/extension-debug`, `/extension-publish`)
37
+ - `claude/rules/`: rules for extension development, cross-browser compat, and MCP tools
38
+
39
+ **Agent Skill**: the knowledge companion to this server lives in [`@extension.dev/skill`](https://npmjs.com/package/@extension.dev/skill): a portable [Agent Skills](https://agentskills.io)-format skill (SKILL.md + references) covering cross-browser rules, silent-failure gotchas, debugging playbooks, and store publishing. This server gives agents hands; the skill gives them judgment. Pair them:
40
+
41
+ ```bash
42
+ mkdir -p .claude/skills && cp -R node_modules/@extension.dev/skill/skills/extension-dev .claude/skills/
43
+ ```
25
44
 
26
45
  Browser-launching tools (`dev`, `start`, `preview`) shell out to the `extension` CLI since they require the full browser launcher infrastructure.
27
46
 
@@ -73,11 +92,22 @@ cp node_modules/@extension.dev/mcp/claude/commands/*.md ~/my-extension/.claude/c
73
92
  | 2 | `extension_manifest_validate` | native | Cross-browser manifest validation |
74
93
  | 2 | `extension_inspect` | native | Build output analysis |
75
94
  | 2 | `extension_source_inspect` | CDP WebSocket | Live DOM inspection |
95
+ | 2 | `extension_dom_inspect` | agent bridge | CDP-free DOM snapshot |
96
+ | 2 | `extension_list_extensions` | CDP WebSocket | List loaded extensions (Chromium) |
97
+ | 2 | `extension_logs` | agent bridge | Stream logs from every context |
76
98
  | 2 | `extension_wait` | native | Poll ready.json contract |
77
99
  | 2 | `extension_add_feature` | native | Add sidebar/popup/content script |
100
+ | act | `extension_eval` | agent bridge | Eval in a context (`--allow-eval`) |
101
+ | act | `extension_storage` | agent bridge | Read/write `chrome.storage` |
102
+ | act | `extension_reload` | agent bridge | Reload extension or tab |
103
+ | act | `extension_open` | agent bridge | Open surface / trigger `action`,`command` |
78
104
  | 3 | `extension_install_browser` | `extensionInstall()` | Install managed browser |
79
105
  | 3 | `extension_list_browsers` | `getManagedBrowsersCacheRoot()` | List managed browsers |
80
106
  | 3 | `extension_detect_browsers` | native | System browser detection |
107
+ | auth | `extension_login` | platform | GitHub device-code → stored token |
108
+ | auth | `extension_whoami` | native | Show stored login (no token) |
109
+ | auth | `extension_logout` | native | Remove stored credentials |
110
+ | auth | `extension_publish` | platform | Publish to extension.dev (token) |
81
111
 
82
112
  ## Development
83
113
 
@@ -96,6 +126,18 @@ NPM_TOKEN=<token> pnpm publish
96
126
 
97
127
  Uses `prepublishOnly` to run tests and compile before publishing.
98
128
 
129
+ ## The extension.dev open source stack
130
+
131
+ | Package | Use it to |
132
+ | --- | --- |
133
+ | [`@extension.dev/skill`](https://github.com/extensiondev/skill) | Teach agents the cross-browser rules and silent-failure gotchas |
134
+ | [`@extension.dev/deploy`](https://github.com/extensiondev/deploy) | Ship to Chrome, Firefox, and Edge stores from CI |
135
+ | [`@extension.dev/artifact-integrity`](https://github.com/extensiondev/artifact-integrity) | Gate releases on artifact verification |
136
+ | [`@extension.dev/compiler`](https://github.com/extensiondev/compiler) | Build extensions in the browser with esbuild-wasm |
137
+ | [`@extension.dev/core`](https://github.com/extensiondev/core) | Authenticate and publish to the extension.dev platform |
138
+
139
+ All of it rides on [Extension.js](https://github.com/extension-js/extension.js), the open-source cross-browser extension framework.
140
+
99
141
  ## License
100
142
 
101
143
  MIT
@@ -1,3 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import {startServer} from '../dist/module.js'
3
- startServer()
2
+ import {startServer, runCli} from '../dist/module.js'
3
+
4
+ const [, , cmd, ...rest] = process.argv
5
+
6
+ if (cmd && ['login', 'logout', 'whoami', 'release'].includes(cmd)) {
7
+ runCli(cmd, rest)
8
+ .then((code) => process.exit(code))
9
+ .catch((err) => {
10
+ process.stderr.write(`${err?.message || String(err)}\n`)
11
+ process.exit(1)
12
+ })
13
+ } else {
14
+ // No subcommand: run as the MCP stdio server (the default and primary mode).
15
+ startServer()
16
+ }
package/claude/CLAUDE.md CHANGED
@@ -242,6 +242,14 @@ npm run dev -- --logs info --log-url "example.com"
242
242
  - Use `--wait` flag to check if dev session is ready (outputs ready.json contract)
243
243
  - Use `npm run start` to test production builds (builds first, then launches)
244
244
 
245
+ ### Triggering events without clicking (requires `--allow-control`)
246
+
247
+ - `extension open action` — fire the toolbar action (opens its popup, or replays `chrome.action.onClicked`).
248
+ - `extension open command --name <cmd>` — replay a `chrome.commands.onCommand` keyboard shortcut.
249
+ - `extension_list_extensions` (MCP tool; no CLI verb) — list extensions with a live context in the browser (Chromium, read-only).
250
+
251
+ These replay your captured listeners, so they work on Chrome and Firefox — but carry **no user gesture**, so `activeTab` is not granted (the result reports `gesture: false`, plus a `warning` when the manifest declares `activeTab`). If you need a genuine-gesture click (activeTab granted), use [chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp)'s `trigger_extension_action` (Chromium only) alongside this server.
252
+
245
253
  ## Contributing templates to the examples repo
246
254
 
247
255
  If you create a new extension pattern worth sharing:
@@ -24,7 +24,17 @@ Debug the currently running extension dev session. The user said: $ARGUMENTS
24
24
  - Read `dist/extension-js/chrome/ready.json` to get the CDP port
25
25
  - Report the port and suggest Chrome DevTools inspection
26
26
 
27
- 3. **Diagnose common issues**
27
+ 3. **Exercise event handlers (when the bug is in an action / command / shortcut)**
28
+ If the session was started with `--allow-control`, fire the events a user would, without clicking:
29
+ - `extension_open` with `surface: "action"` — triggers the toolbar action (opens its popup, or replays `chrome.action.onClicked`).
30
+ - `extension_open` with `surface: "command"` and `name: "<cmd>"` — replays a `chrome.commands.onCommand` keyboard shortcut.
31
+ - Then re-inspect or read `extension_logs` to see what the handler did.
32
+
33
+ **Caveat:** replay carries no user gesture, so `activeTab` is NOT granted. If the handler depends on `activeTab` (e.g. `chrome.scripting.executeScript` on the active tab, `captureVisibleTab`), the result includes `gesture: false` and a `warning`, and behavior differs from a real click. For a genuine-gesture click (activeTab granted), use chrome-devtools-mcp's `trigger_extension_action` (Chromium only) alongside this server.
34
+
35
+ To see what else is loaded in the browser (Chromium): `extension_list_extensions`.
36
+
37
+ 4. **Diagnose common issues**
28
38
  Based on what you find, check for:
29
39
  - **"It didn't load"**: Check extension root count. If 0, content scripts may not be injecting. Check manifest `content_scripts` matches patterns and the target URL.
30
40
  - **Console errors**: Report top errors. Common ones:
@@ -34,7 +44,7 @@ Debug the currently running extension dev session. The user said: $ARGUMENTS
34
44
  - **Wrong page**: Check if the content script `matches` pattern in manifest covers the target URL
35
45
  - **Shadow DOM empty**: Extension root exists but shadow content is empty — likely a CSS or framework mounting issue
36
46
 
37
- 4. **Suggest fixes** based on the diagnosis
47
+ 5. **Suggest fixes** based on the diagnosis
38
48
 
39
49
  ## Examples
40
50
 
@@ -719,8 +719,15 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
719
719
  | `extension_manifest_validate` | `programs/develop` | `plugin-web-extension` | `templates-meta.json` for similar templates | Extract validation logic |
720
720
  | `extension_inspect` | `programs/develop` | `--source` flag logic | — | Extract into callable API |
721
721
  | `extension_source_inspect` | `programs/extension` | CDP client / RDP transport | Live browser via debugging protocol | Wire to running session |
722
+ | `extension_list_extensions` | MCP `lib/cdp` | `Extensions.getExtensionInfo` (read-only) | Live browser via CDP (Chromium) | MCP tool (no CLI verb) |
722
723
  | `extension_wait` | `programs/extension` | `dev-wait.ts` | `ready.json` contract file | Thin wrapper (exists in CLI) |
723
724
  | `extension_add_feature` | New | `extension_get_template_source` | examples repo patterns | Codegen from examples |
725
+ | **Agent bridge — act / triggers** | | | | |
726
+ | `extension_eval` | `programs/extension` | bridge control channel | Live extension context | Wraps `extension eval` (`--allow-eval`) |
727
+ | `extension_storage` | `programs/extension` | bridge control channel | `chrome.storage` | Wraps `extension storage` |
728
+ | `extension_reload` | `programs/extension` | bridge control channel | Live extension | Wraps `extension reload` |
729
+ | `extension_open` | `programs/extension` | bridge control channel | Surfaces + `action`/`command` replay | Wraps `extension open` |
730
+ | `extension_logs` | `programs/extension` | bridge log/control channel | `logs.ndjson` + live channel | Wraps `extension logs` |
724
731
  | **Tier 3 — Browser management** | | | | |
725
732
  | `extension_install_browser` | `programs/install` | `extensionInstall()` | — | Thin wrapper only |
726
733
  | `extension_list_browsers` | `programs/install` | `getManagedBrowsersCacheRoot()` | — | Thin wrapper only |
package/dist/module.d.ts CHANGED
@@ -1 +1 @@
1
- export { startServer } from "./src/index";
1
+ export { startServer, runCli } from "./src/index";