@predotdev/mcp 2.1.0 → 2.1.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 +5 -1
- package/package.json +1 -1
- package/src/setup.mjs +12 -4
package/README.md
CHANGED
|
@@ -59,6 +59,10 @@ Then restart your agent and try:
|
|
|
59
59
|
|
|
60
60
|
The command is safe to run again at any time, and running it again updates to the latest version. `npx -y @predotdev/mcp check` shows the state of everything, and `uninstall` removes it from every agent.
|
|
61
61
|
|
|
62
|
+
### Coming from Claude in Chrome?
|
|
63
|
+
|
|
64
|
+
Run the setup command above, then type `/chrome` in Claude Code and turn off **Enabled by default** (or start a session with `claude --no-chrome`). Your Chrome profiles and logins carry over, because this server drives the Chrome you already use. The [switching guide](https://docs.pre.dev/browser-agents/switch-from-claude-in-chrome) maps each Claude in Chrome tool to its pre.dev tool and has a line you can paste into `CLAUDE.md`.
|
|
65
|
+
|
|
62
66
|
## Local or cloud?
|
|
63
67
|
|
|
64
68
|
Both editions of pre.dev Browser Agents are in this server, and your agent picks per task.
|
|
@@ -169,7 +173,7 @@ pi mcp add predev -- npx -y @predotdev/mcp
|
|
|
169
173
|
pi mcp list
|
|
170
174
|
```
|
|
171
175
|
|
|
172
|
-
`pi mcp list` should say `predev: connected`. Pi
|
|
176
|
+
`pi mcp list` should say `predev: connected`. `pi mcp add` needs Pi 0.99 or newer. On an older Pi, run `pi install npm:pi-mcp-adapter` and add the `predev` entry to `~/.pi/agent/mcp.json` by hand (`setup` writes it for you).
|
|
173
177
|
|
|
174
178
|
</details>
|
|
175
179
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@predotdev/mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "pre.dev in any coding agent: Browser Agents in the Chrome you already use and in the cloud, plus specs and plans. One command to set up. Free and open source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/setup.mjs
CHANGED
|
@@ -481,10 +481,18 @@ export function createSetup(ctx) {
|
|
|
481
481
|
if (!found) continue;
|
|
482
482
|
try { if (agent.unregister()) ok(`Removed from ${agent.label}`); } catch (error) { skip(`${agent.label}: ${error.message}`); }
|
|
483
483
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
fs.
|
|
487
|
-
|
|
484
|
+
// Every daemon it runs (one per Chrome data dir), then everything it keeps in ~/.predev/mcp:
|
|
485
|
+
// the stable copy, the saved key, logs and the cached profile list (names and emails).
|
|
486
|
+
const subdirs = (() => { try { return fs.readdirSync(baseStateDir, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => path.join(baseStateDir, d.name)); } catch { return []; } })();
|
|
487
|
+
const alive = pid => { try { process.kill(pid, 0); return true; } catch { return false; } };
|
|
488
|
+
for (const dir of new Set([stateDir, baseStateDir, ...subdirs])) {
|
|
489
|
+
const state = (() => { try { return JSON.parse(fs.readFileSync(path.join(dir, 'daemon.json'), 'utf8')); } catch { return null; } })();
|
|
490
|
+
if (!state) continue;
|
|
491
|
+
await request(state, 'POST', '/shutdown', {}, 3000).catch(() => {});
|
|
492
|
+
// It exits just after answering; wait, so its last log line can't recreate the folder.
|
|
493
|
+
for (let i = 0; i < 30 && state.pid && alive(state.pid); i++) await sleep(100);
|
|
494
|
+
}
|
|
495
|
+
fs.rmSync(baseStateDir, { recursive: true, force: true });
|
|
488
496
|
ok('Stopped it and deleted its files and saved key');
|
|
489
497
|
console.log('\nDone. Restart your agents. To also turn off remote debugging, open chrome://inspect/#remote-debugging.');
|
|
490
498
|
}
|