mcp-browser-extension 0.9.30 → 0.9.32

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.
Files changed (50) hide show
  1. package/README.md +77 -14
  2. package/SETUP.md +40 -7
  3. package/dist/shared/activity.d.ts +25 -0
  4. package/dist/shared/activity.js +72 -0
  5. package/dist/shared/browser-permissions.d.ts +20 -0
  6. package/dist/shared/browser-permissions.js +40 -0
  7. package/dist/shared/client-auth.d.ts +28 -0
  8. package/dist/shared/client-auth.js +38 -0
  9. package/dist/shared/observers.d.ts +1 -1
  10. package/dist/shared/observers.js +1 -3
  11. package/dist/shared/policy.d.ts +5 -7
  12. package/dist/shared/policy.js +11 -26
  13. package/dist/shared/protocol.d.ts +4 -0
  14. package/dist/shared/protocol.js +3 -3
  15. package/dist/shared/screenshot.d.ts +4 -2
  16. package/dist/shared/screenshot.js +13 -8
  17. package/dist/src/access-browser.d.ts +15 -0
  18. package/dist/src/access-browser.js +202 -0
  19. package/dist/src/access.d.ts +2 -0
  20. package/dist/src/access.js +92 -18
  21. package/dist/src/bridge/client-identity.d.ts +10 -0
  22. package/dist/src/bridge/client-identity.js +28 -0
  23. package/dist/src/bridge/connection.d.ts +5 -0
  24. package/dist/src/bridge/connection.js +4 -12
  25. package/dist/src/bridge/peer.d.ts +4 -19
  26. package/dist/src/bridge/peer.js +17 -8
  27. package/dist/src/bridge/server.d.ts +7 -16
  28. package/dist/src/bridge/server.js +64 -17
  29. package/dist/src/bridge/site-grants.d.ts +1 -2
  30. package/dist/src/bridge/site-grants.js +4 -3
  31. package/dist/src/cli.js +1 -3
  32. package/dist/src/config.js +16 -5
  33. package/dist/src/executor/cdp-executor.d.ts +3 -0
  34. package/dist/src/executor/cdp-executor.js +69 -25
  35. package/dist/src/mcp/server.js +5 -3
  36. package/dist/src/mcp/tools.d.ts +0 -12
  37. package/dist/src/mcp/tools.js +48 -22
  38. package/dist/src/remote/key.js +12 -2
  39. package/dist/src/security/policy.d.ts +4 -0
  40. package/dist/src/security/policy.js +3 -1
  41. package/docs/BLUEPRINT.md +6 -1
  42. package/docs/CLIENT-APPROVAL.md +150 -0
  43. package/extension-dist/activity-dashboard.css +43 -0
  44. package/extension-dist/background.js +1036 -73
  45. package/extension-dist/manifest.json +10 -9
  46. package/extension-dist/options.html +101 -32
  47. package/extension-dist/options.js +558 -70
  48. package/extension-dist/popup.html +164 -90
  49. package/extension-dist/popup.js +576 -79
  50. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "MCP Browser Extension – AI agent in your logged-in Chrome",
4
- "version": "0.9.30",
4
+ "version": "0.9.32",
5
5
  "description": "Lets your AI agent use the Chrome you are signed into, through a local MCP server. Deny-all by default.",
6
6
  "homepage_url": "https://mcp-browser-extension.com",
7
7
  "minimum_chrome_version": "116",
@@ -17,18 +17,15 @@
17
17
  "permissions": [
18
18
  "tabs",
19
19
  "scripting",
20
- "downloads",
21
20
  "storage",
22
21
  "alarms",
23
- "cookies",
24
22
  "debugger",
25
23
  "webNavigation",
26
- "proxy",
27
- "webRequest",
28
- "webRequestAuthProvider"
24
+ "proxy"
29
25
  ],
30
- "host_permissions": [
31
- "<all_urls>"
26
+ "optional_host_permissions": [
27
+ "http://*/*",
28
+ "https://*/*"
32
29
  ],
33
30
  "options_page": "options.html",
34
31
  "action": {
@@ -43,7 +40,11 @@
43
40
  },
44
41
  "optional_permissions": [
45
42
  "nativeMessaging",
46
- "privacy"
43
+ "privacy",
44
+ "cookies",
45
+ "downloads",
46
+ "webRequest",
47
+ "webRequestAuthProvider"
47
48
  ],
48
49
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnU/ZEDvOqegaznGSdMp4U69LsSZj18ZMdJdekRkCl4MGoQO09K3bXMFS4jxlWS6ZXlh4GLuM+BusovfLTaFDivzMoArAnsYzaB6aoi7mwihMdxRHZ/BgZ63SMwH2z2HQ9X32Lx+AS0de92aMx4NxyKcLZSP46jV+051Ch2xhMFBAOlby2R5mu7rRo2Bq68/aVYU2q4TQ2UN+uSi9aRlej/7DasVyqQ6OpC8iqcw1pS7nCCngNDAfzmAZcpgWjRE0kl+5cOZskK3bnScH+PscCstyGQ5d1D2x8H43dNYFVel4HyM46G4vegi38AUQs5ldriprqSleYpEI3yq1br/g4wIDAQAB"
49
50
  }
@@ -3,6 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title>MCP Browser Extension — Settings</title>
6
+ <link rel="stylesheet" href="activity-dashboard.css" />
6
7
  <style>
7
8
  :root {
8
9
  --site-primary: oklch(0.58 0.19 255);
@@ -39,6 +40,19 @@
39
40
  .quick .hint.error { color: #b45309; }
40
41
  select { width: 100%; padding: 0.5rem; font: inherit; }
41
42
  .grid { display: grid; grid-template-columns: 1fr 7rem; gap: 0 0.5rem; }
43
+ #client-connections li { align-items: start; flex-wrap: wrap; gap: 0.75rem; }
44
+ #client-connections code { font-size: 0.8rem; }
45
+ #client-connections button { margin: 0.25rem 0.25rem 0 0; }
46
+ .client-info { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 4px; overflow-wrap: anywhere; }
47
+ .client-status { font-size: 0.9rem; }
48
+ .client-details { flex-basis: 100%; min-width: 0; color: #555; font-size: 0.85rem; overflow-wrap: anywhere; }
49
+ .client-details summary { width: fit-content; padding: 2px 0; cursor: pointer; }
50
+ .client-details summary:focus-visible { outline: 2px solid var(--site-ring); outline-offset: 3px; border-radius: 2px; }
51
+ .client-details p { margin: 4px 0; }
52
+ .client-details code { display: inline-block; margin-top: 4px; }
53
+ #extra-permissions-list li { display: block; padding: 0.75rem 0; }
54
+ #extra-permissions-list p { margin: 0.35rem 0; }
55
+ #extra-permissions-list button { margin-top: 0.25rem; }
42
56
  .proxy-on { background: #ecfdf5; }
43
57
  .proxy-err { background: #fff7ed; }
44
58
  </style>
@@ -49,45 +63,36 @@
49
63
  <div class="quick" id="quick">
50
64
  <button id="connect" class="primary">Connect</button>
51
65
  <p class="hint" id="connect-msg">One click fetches the port and token from the server. Chrome asks once for permission.</p>
66
+ <div class="access-controls">
67
+ <button id="access-stop">Stop access</button>
68
+ <button id="access-resume" hidden>Resume connection</button>
69
+ </div>
70
+ <p class="hint" id="access-note" role="status"></p>
52
71
  </div>
53
- <p class="hint" id="manual-intro">Or pair by hand:</p>
54
- <p class="hint" id="source">Checking pairing source…</p>
55
- <p class="hint">
56
- Manual pairing: run <code>npx -y mcp-browser-extension@latest --print-pairing</code>,
57
- open the printed <code>handshake.json</code>, and paste its <code>port</code>
58
- and <code>token</code> below.
59
- </p>
60
- <label for="port">Port</label>
61
- <input id="port" type="number" inputmode="numeric" placeholder="38017" />
62
- <label for="token">Token</label>
63
- <input id="token" type="password" placeholder="leave blank to keep the current token" />
64
- <label for="profile">Profile</label>
65
- <input id="profile" type="text" placeholder="automatic" />
66
- <p class="hint">
67
- Optional. Leave blank and the server names this browser for you — the first is
68
- <code>default</code>, then <code>profile-2</code>, <code>profile-3</code>… — and
69
- remembers it. Rename one with <code>profile_rename</code>, switch with
70
- <code>profile_use</code>. Type a name here only to pin one yourself.
71
- </p>
72
- <p class="hint" id="paired-as"></p>
73
- <label class="check"><input id="tab-border" type="checkbox" checked /> Outline the tabs the agent is working in</label>
74
- <p class="hint">
75
- A border in the page's theme colour (blue when the site has none) marks every tab the
76
- agent is driving. It never shows in screenshots or PDFs, and is removed when the server disconnects.
77
- </p>
78
- <button id="save">Save & connect</button>
79
- <div class="status" id="status">Status: unknown</div>
72
+ <section id="clients-section">
73
+ <h2>App connections</h2>
74
+ <p class="hint">Only approve a connection you just started. App names are supplied by the app:
75
+ compare the key below with the key shown in your app's tool result.</p>
76
+ <p class="hint">Each entry is a separate connection. Approval lasts eight hours in this Chrome profile. A new app session needs a new approval.
77
+ Revoking access blocks further commands; an action already running may finish.</p>
78
+ <ul class="sites" id="client-connections"></ul>
79
+ <p class="hint" id="client-note" role="status" aria-live="polite"></p>
80
+ </section>
81
+
82
+ <section id="blocked-wrap" hidden>
83
+ <h2>Website access</h2>
84
+ <p class="hint">Allow lets approved apps read and act here, including sending, deleting and buying. Accept Chrome’s prompt if shown.</p>
85
+ <ul class="sites blocked" id="blocked"></ul>
86
+ </section>
80
87
 
81
88
  <section id="sites-section">
82
89
  <h2>Allowed sites</h2>
83
90
  <p class="hint">
84
91
  MCP Browser Extension only reads or acts on sites you allow. Allowing one here applies at once to every
85
- AI session, with no restart, and is remembered.
92
+ approved app session, with no restart, and is remembered. Click Allow, then accept Chrome’s
93
+ website permission request if shown. Remove also removes Chrome’s website permission.
86
94
  </p>
87
- <div id="blocked-wrap" hidden>
88
- <p><strong>Recently blocked</strong></p>
89
- <ul class="sites blocked" id="blocked"></ul>
90
- </div>
95
+ <p class="hint">Allowing a site lets approved apps read and take actions there, including sending, deleting and buying, without a separate approval for each action. Remove access whenever you want to stop new actions.</p>
91
96
  <ul class="sites" id="allowed"></ul>
92
97
  <p class="hint" id="sites-note"></p>
93
98
  <label for="new-site">Allow a site</label>
@@ -96,6 +101,70 @@
96
101
  <button id="add-site">Allow</button>
97
102
  </div>
98
103
  </section>
104
+
105
+ <section id="activity-section">
106
+ <h2>Recent activity</h2>
107
+ <label for="activity-filter">Show requests</label>
108
+ <select id="activity-filter">
109
+ <option value="all">All results</option>
110
+ <option value="running">Running</option>
111
+ <option value="done">Done</option>
112
+ <option value="blocked">Blocked</option>
113
+ <option value="failed">Failed</option>
114
+ <option value="interrupted">Interrupted</option>
115
+ </select>
116
+ <ul id="activity-list" class="activity-list" aria-label="Recent activity" tabindex="0"></ul>
117
+ <p class="hint" id="activity-note" role="status"></p>
118
+ <div class="activity-actions"><button id="activity-clear">Clear history</button></div>
119
+ <details class="activity-help">
120
+ <summary>About this history</summary>
121
+ <p>MCP activity appears automatically. Opening and closing the same tab with the same app share one row. Select a row for the app, key and times.</p>
122
+ <p>Last 100 requests received by this extension, kept only for this Chrome session. Website names, app keys and results only; no page text or entered values. App names are supplied by the apps.</p>
123
+ <p>Requests refused by the server may not appear. Interrupted means the result was withheld or unavailable; an action may still have finished. This is a convenience history, not a complete audit record.</p>
124
+ </details>
125
+ </section>
126
+
127
+ <section id="extra-permissions" hidden>
128
+ <h2>Extra permissions</h2>
129
+ <ul class="sites" id="extra-permissions-list"></ul>
130
+ <p class="hint" id="extra-permissions-note" role="status" aria-live="polite"></p>
131
+ </section>
132
+
133
+ <section id="appearance-section">
134
+ <h2>Appearance</h2>
135
+ <label class="check"><input id="tab-border" type="checkbox" checked /> Outline the tabs the agent is working in</label>
136
+ <p class="hint">
137
+ A border in the page's theme colour (blue when the site has none) marks every tab the
138
+ agent is driving. It never shows in screenshots or PDFs, and is removed when the server disconnects.
139
+ </p>
140
+ </section>
141
+
142
+ <section id="connection-settings">
143
+ <h2>Manual connection</h2>
144
+ <p class="hint" id="manual-intro">Use these fields to pair by hand:</p>
145
+ <p class="hint" id="source">Checking pairing source…</p>
146
+ <p class="hint">
147
+ Manual pairing: run <code>npx -y mcp-browser-extension@latest --print-pairing</code>,
148
+ open the printed <code>handshake.json</code>, and paste its <code>port</code>
149
+ and <code>token</code> below.
150
+ </p>
151
+ <label for="port">Port</label>
152
+ <input id="port" type="number" inputmode="numeric" placeholder="38017" />
153
+ <label for="token">Token</label>
154
+ <input id="token" type="password" placeholder="leave blank to keep the current token" />
155
+ <label for="profile">Profile</label>
156
+ <input id="profile" type="text" placeholder="automatic" />
157
+ <p class="hint">
158
+ Optional. Leave blank and the server names this browser for you — the first is
159
+ <code>default</code>, then <code>profile-2</code>, <code>profile-3</code>… — and
160
+ remembers it. Rename one with <code>profile_rename</code>, switch with
161
+ <code>profile_use</code>. Type a name here only to pin one yourself.
162
+ </p>
163
+ <p class="hint" id="paired-as"></p>
164
+ <button id="save">Save & connect</button>
165
+ <div class="status" id="status">Status: unknown</div>
166
+ </section>
167
+
99
168
  <section id="proxy-section">
100
169
  <h2>Proxy</h2>
101
170
  <p class="hint">