bookmark-bridge 2.0.2 → 3.0.0

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
@@ -3,161 +3,67 @@
3
3
  An MCP client can read and reorganize your Chrome bookmarks through this.
4
4
  Every change lands in git first, so anything can be rolled back.
5
5
 
6
- ```
7
- MCP client --stdio--> bookmark-bridge --ws(127.0.0.1)-- Chrome extension --chrome.bookmarks--> Chrome
8
- ```
9
-
10
- The extension dials out rather than listening, because an extension cannot open
11
- a port. A second MCP process that finds the port taken joins the first as a peer
12
- and relays through it, so several sessions share one browser.
6
+ Chrome starts the Bridgey host through Native Messaging. An MCP client runs
7
+ the server over stdio, and the server talks to the host over an authenticated
8
+ loopback connection.
13
9
 
14
10
  ## Install
15
11
 
16
- The default package uses the existing WebSocket connection. For the opt-in
17
- Native Messaging release, see [Native Messaging](#native-messaging).
18
-
19
- **1. Register the server with your MCP client.** It downloads itself on first
20
- run, so you do not need Rust. macOS, Linux and Windows.
21
-
22
- <details open>
23
- <summary><b>Claude Code</b></summary>
24
-
25
- ```sh
26
- claude mcp add bookmark-bridge -- npx -y bookmark-bridge
27
- ```
28
-
29
- </details>
30
-
31
- <details>
32
- <summary><b>Codex</b> — <code>~/.codex/config.toml</code></summary>
33
-
34
- ```toml
35
- [mcp_servers.bookmark-bridge]
36
- command = "npx"
37
- args = ["-y", "bookmark-bridge"]
38
- ```
39
-
40
- </details>
41
-
42
- <details>
43
- <summary><b>Any other client</b> — the standard entry</summary>
44
-
45
- ```json
46
- {
47
- "mcpServers": {
48
- "bookmark-bridge": {
49
- "command": "npx",
50
- "args": ["-y", "bookmark-bridge"]
51
- }
52
- }
53
- }
54
- ```
55
-
56
- Put it wherever your client keeps its MCP servers.
57
-
58
- </details>
59
-
60
- <details>
61
- <summary><b>Or have your agent do it</b> — paste this</summary>
62
-
63
- ```
64
- Install the bookmark-bridge MCP server for me.
65
-
66
- 1. Register it with this client as an MCP server named "bookmark-bridge",
67
- running: npx -y bookmark-bridge
68
- Use whatever config file this client uses, and do not disturb the servers
69
- already there.
70
- 2. Restart or reload so the server is picked up, then call its bridge_status
71
- tool and tell me what it reports.
72
- 3. If it says the extension is not connected, tell me to install the Chrome
73
- extension from https://github.com/semanticist21/bookmark-bridge and then
74
- check again.
75
-
76
- Do not build from source; the npx package fetches a prebuilt binary.
77
- ```
78
-
79
- </details>
80
-
81
- Your client starts and stops it for you. Nothing to leave running. `git` must be
82
- on PATH — the snapshots are a real git repository.
83
-
84
- **2. Install the extension.** Get [Bridgey from the Chrome Web Store](https://chromewebstore.google.com/detail/ekokljgbbianihlpahackkfdendobngd)
85
- and leave its mode set to **Legacy (WebSocket)**. For the unpacked legacy
86
- extension, use `extension/` from the `v0.1.2` tag.
87
-
88
- That is all of it. The extension's popup goes green once the two find each other.
89
-
90
- The extension sleeps when you are not using it. Chrome ends an idle service
91
- worker, and this one is not woken on a timer — tidying bookmarks is occasional
92
- work, and polling a socket nobody is using is what Manifest V3 set out to stop.
93
- It wakes on its own when the browser starts, when a setting changes, when you
94
- touch a bookmark, and when you open its popup. If an agent reports that the
95
- extension is not connected, clicking the toolbar icon reconnects it.
96
-
97
- <details>
98
- <summary>Build the legacy server from source</summary>
99
-
100
- Use the `v0.1.2` tag for the legacy server.
101
-
102
- ```sh
103
- cd mcp && cargo build --release
104
- ```
105
-
106
- Then point the same config entry at the binary instead:
107
- `"command": "<repo>/mcp/target/release/bookmark-bridge"`, with no `args`.
108
-
109
- A source checkout also gets a shared token automatically: the server writes one
110
- to `~/.config/bookmark-bridge/token` and copies it into `extension/`, so both
111
- ends have it. A Web Store install is read-only and cannot receive one, so the
112
- server runs without a token there and relies on the loopback binding — a token
113
- only one side knows would reject the extension forever. Set
114
- `BOOKMARK_BRIDGE_TOKEN` to demand one regardless, and put the same value in the
115
- extension's storage. `BOOKMARK_BRIDGE_PORT` changes the port.
116
-
117
- </details>
118
-
119
- ## Native Messaging
120
-
121
- The v2 server is available on the npm `native` channel. The standard
122
- `bookmark-bridge` command still installs the legacy server.
123
-
124
- 1. In your MCP client, change the command arguments from `-y bookmark-bridge`
125
- to `-y bookmark-bridge@native`, then restart its MCP connection. With Claude
126
- Code, the command for a new entry is
127
- `claude mcp add bookmark-bridge -- npx -y bookmark-bridge@native`.
128
- 2. Open Bridgey's popup and choose **Native Messaging**. Approve Chrome's
129
- permission prompt. If setup fails, the extension stays in Legacy mode.
130
- 3. Run `bridge_status` from your MCP client to confirm the connection.
131
-
132
- The Native npm package contains the prebuilt servers and their checksums.
133
- The first server startup installs the native host in a user data directory
134
- outside the npm cache and registers it with Chrome. Chrome launches that host
135
- when the extension connects. The host and the MCP process communicate over an
136
- authenticated loopback connection. Keep `git` on the MCP client's PATH. The
137
- server remembers its absolute path so the Chrome-launched host can use it.
138
-
139
- Bridgey serves one Native Messaging browser profile at a time. Each profile's
140
- v2 snapshots live under `native-v2/<profileId>` inside the existing history
141
- state directory. Legacy snapshots remain available in Legacy mode.
142
-
143
- To switch back, choose **Legacy (WebSocket)** in the popup, restore the MCP
144
- command arguments to `-y bookmark-bridge`, and restart its MCP connection.
145
- Restarting Chrome or reconnecting the popup refreshes the browser connection.
146
- Restart the MCP connection after updating the server to refresh its tool list.
147
-
148
- For an unpacked development extension, build the v2 binary and run
149
- `bookmark-bridge register-native <extension-id>` with that binary before
150
- selecting Native Messaging. It remembers the ID alongside the published one.
151
- On macOS and Linux, set `BOOKMARK_BRIDGE_CHROME_USER_DATA_DIR` to the absolute
152
- user data directory when registering for a Chrome test profile outside the
153
- default location.
12
+ 1. Install [Bridgey from the Chrome Web Store](https://chromewebstore.google.com/detail/ekokljgbbianihlpahackkfdendobngd).
13
+ 2. Add the server to your MCP client. You need Node.js 18 or later and Git on
14
+ the client's PATH. The npm package includes verified binaries for macOS,
15
+ Linux and Windows.
16
+
17
+ **Claude Code**
18
+ ```sh
19
+ claude mcp add bookmark-bridge -- npx -y bookmark-bridge
20
+ ```
21
+
22
+ **Codex** (~/.codex/config.toml)
23
+ ```toml
24
+ [mcp_servers.bookmark-bridge]
25
+ command = "npx"
26
+ args = ["-y", "bookmark-bridge"]
27
+ ```
28
+
29
+ **Other MCP clients**
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "bookmark-bridge": {
34
+ "command": "npx",
35
+ "args": ["-y", "bookmark-bridge"]
36
+ }
37
+ }
38
+ }
39
+ ```
40
+ 3. Restart your MCP client so the server can register the host with Chrome.
41
+ Open the Bridgey popup and click **Reconnect**. When it shows
42
+ **Bridge Connected**, call `bridge_status` from your MCP client.
43
+
44
+ The first server startup installs the native host outside the npm cache and
45
+ registers it with Chrome. Bridgey connects one Chrome profile at a time. If
46
+ another profile is connected, turn Bridgey off in that profile first.
47
+
48
+ ### Unpacked development extension
49
+
50
+ In `chrome://extensions`, enable Developer mode and load the `extension/`
51
+ directory. Copy the extension ID and run
52
+ `npx -y bookmark-bridge register-native <extension-id>` before reconnecting.
53
+ For a non-default Chrome user data directory on macOS and Linux, set
54
+ `BOOKMARK_BRIDGE_CHROME_USER_DATA_DIR` to its absolute path when registering.
55
+
56
+ To run from source, build with `cargo build --release --locked --manifest-path mcp/Cargo.toml`
57
+ and point the MCP client at the resulting binary. The binary accepts the same
58
+ `register-native` command.
154
59
 
155
60
  ## Safety model
156
61
 
157
62
  Three mechanisms, in the order they engage.
158
63
 
159
- **Snapshots.** Every mutating call commits the whole tree to a git repository at
160
- `~/.local/state/bookmark-bridge/history`, before and after. A failed
64
+ **Snapshots.** Every mutating call commits the whole tree to a git repository under
65
+ `bookmark-bridge/native-v2/<profileId>/history` in the user state directory,
66
+ before and after. A failed
161
67
  before-snapshot refuses the change: a mutation nobody can undo is not worth
162
68
  making. `force: true` overrides that.
163
69
 
@@ -213,10 +119,9 @@ does not read your real Chrome bookmarks.
213
119
 
214
120
  ## Privacy
215
121
 
216
- The extension holds `bookmarks` and `storage`. Native Messaging also requires
217
- an optional permission and uses Chrome's extension allowlist. Legacy mode uses
218
- `127.0.0.1` and rejects handshakes carrying a web origin. Both transports keep
219
- bookmark data on this computer.
122
+ The extension uses Chrome's `bookmarks`, `storage` and `nativeMessaging`
123
+ permissions. Chrome restricts access to the host by extension ID. Bridgey
124
+ keeps bookmark data on this computer.
220
125
 
221
126
  ## License
222
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bookmark-bridge",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "Chrome bookmarks as MCP tools, with every change recorded in git so it can be rolled back",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,10 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "scripts": {
20
- "prepublishOnly": "node -e \"if (process.env.npm_config_tag !== 'native' || !require('fs').existsSync('release-assets/SHA256SUMS')) { console.error('Publish the bundled release with npm publish --tag native.'); process.exit(1); }\""
21
- },
22
- "publishConfig": {
23
- "tag": "native"
20
+ "prepublishOnly": "node -e \"if (!require('fs').existsSync('release-assets/SHA256SUMS')) { console.error('Bundle the release binaries before publishing.'); process.exit(1); }\""
24
21
  },
25
22
  "engines": {
26
23
  "node": ">=18"
@@ -1,5 +1,5 @@
1
- af0dc501199feb693a68cc1d433499e67a633f495fbce1e6f43c5e165f6b99a3 bookmark-bridge-aarch64-apple-darwin.tar.gz
2
- 35968f8114af290d81638e97d5482c23457b0b72c5a6004eabec78a3739a13c8 bookmark-bridge-aarch64-unknown-linux-gnu.tar.gz
3
- 67fae0592491c25bbb8caca61630dd4213d26fe83e09e2f03bf75a130c70efd6 bookmark-bridge-x86_64-apple-darwin.tar.gz
4
- d443279e1a1380f442b69df9c86072d40bb5980d550aba8050e6c84aa3fcf184 bookmark-bridge-x86_64-pc-windows-msvc.tar.gz
5
- 3cc3b1480fd7fb6a39d7407d48bf528debe1216791bade50f1e95cfd5dd237b9 bookmark-bridge-x86_64-unknown-linux-gnu.tar.gz
1
+ 535fe1fbf39b9f8011a4c56f5e8e3f382e5b975c9f4312139dc4164b049bccb7 bookmark-bridge-aarch64-apple-darwin.tar.gz
2
+ 5b4bd7ffef2ee55e069e2501a8b1797831ecb491a3c561d9ac89e4d33886594b bookmark-bridge-aarch64-unknown-linux-gnu.tar.gz
3
+ 58cf6ed481022558fcdb69276a1b9e6dac6706ac48bfaf871b6dc1d4d2a725b5 bookmark-bridge-x86_64-apple-darwin.tar.gz
4
+ 9785fe84c1d77b9280f57d01c75c0620af450201ad3ddedb770a6e42456a4524 bookmark-bridge-x86_64-pc-windows-msvc.tar.gz
5
+ 80ab34e0d61236ba7d6de86a33a072de590167bbf4dc48c208879641d4060b1b bookmark-bridge-x86_64-unknown-linux-gnu.tar.gz