aboutsummaryrefslogtreecommitdiff
path: root/mcp/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/README.md')
-rw-r--r--mcp/README.md46
1 files changed, 24 insertions, 22 deletions
diff --git a/mcp/README.md b/mcp/README.md
index 51a53af..4bda454 100644
--- a/mcp/README.md
+++ b/mcp/README.md
@@ -1,18 +1,22 @@
# pi-chrome-mcp
+Part of [sz-chrome-remote-extension](../FORK.md), the pi-chrome fork; until 2026-10 it was its own
+repo, and loaded pi-chrome from npm. It now loads the fork's own copy, the directory above this
+one.
+
**Your everyday browser, driven by any MCP client.**
Claude Code, Claude Desktop and other MCP clients get tools that read, click, type in and
screenshot the browser you are already signed into — your real profile, your sessions, your
logins — instead of a fresh automation browser that is logged into nothing.
-The tools themselves are [pi-chrome](https://github.com/tianrendong/pi-chrome)'s, loaded as a
-dependency rather than copied. pi-chrome gives them to the [pi](https://pi.dev) agent; this server
+The tools themselves are [pi-chrome](https://github.com/tianrendong/pi-chrome)'s, loaded from this
+repository's `extensions/chrome-profile-bridge` rather than copied. pi-chrome gives them to the [pi](https://pi.dev) agent; this server
gives the same tools to everyone else.
## What you get
-21 tools: page snapshots with stable element ids, click, type, fill, scroll, keys, navigation, tab
+23 tools: page snapshots with stable element ids, click, type, fill, scroll, keys, navigation, tab
management, console and network inspection, screenshots (returned inline, so the model sees them),
file uploads, and JavaScript evaluation.
@@ -39,22 +43,23 @@ Plus, over plain pi-chrome:
**1. Install.** The repo is public; the clone needs no credentials.
```bash
-git clone https://git.soarez.net/sz/pi-chrome-mcp.git
-cd pi-chrome-mcp
+git clone https://git.soarez.net/sz/sz-chrome-remote-extension.git
+cd sz-chrome-remote-extension/mcp
./run.sh --install-only # fetches dependencies, then prints the extension path
```
+Clone it somewhere it will stay: the browser loads the extension from inside the checkout.
+
**2. Load the companion extension** (this is the human step). In Chrome, open
-`chrome://extensions`, turn on **Developer mode**, click **Load unpacked**, and select the
-`extension` folder that the previous command created — it prints the full path. The folder is not
-in git: it is copied out of the installed pi-chrome.
+`chrome://extensions`, turn on **Developer mode**, click **Load unpacked**, and select
+`extensions/chrome-profile-bridge/browser-extension` in the checkout — the previous command prints
+the full path.
Load it once, whatever you drive it from. If pi already loaded pi-chrome's extension on this
machine, that copy serves this server too; see [Using it from pi](#using-it-from-pi).
It is about 2000 lines of plain JavaScript with no dependencies, and worth reading before you load
-it. It comes from pi-chrome; `run.sh` copies it out of `node_modules` so that updating dependencies
-cannot delete the folder Chrome is loading from.
+it. It is pi-chrome's, unchanged by the fork.
Chrome shows "Pi Chrome Connector started debugging this browser" while a tool is attached. That
banner is Chrome's, and expected.
@@ -105,7 +110,7 @@ Add it to `claude_desktop_config.json` with an absolute path, and restart Deskto
```json
{
"mcpServers": {
- "chrome": { "command": "/absolute/path/to/pi-chrome-mcp/run.sh" }
+ "chrome": { "command": "/absolute/path/to/sz-chrome-remote-extension/mcp/run.sh" }
}
}
```
@@ -131,13 +136,13 @@ which adds an entry like:
{
"mcpServers": {
"my-chrome": {
- "command": "/absolute/path/to/pi-chrome-mcp/run.sh"
+ "command": "/absolute/path/to/sz-chrome-remote-extension/mcp/run.sh"
}
}
}
```
-`pi mcp list` should then show `my-chrome: connected, 21 tools`.
+`pi mcp list` should then show `my-chrome: connected, 23 tools`.
**2. Add the session gate.** Copy `pi/browser-gate.ts` from this repo into
`~/.pi/agent/extensions/`. The first browser call in a pi session asks once — for the session, for
@@ -212,8 +217,7 @@ Nothing listens on the network unless you ask for `--http`.
| `MCP_IDLE_CLEANUP_MS` | How long an HTTP client's tabs stay open after its last call, default an hour. |
| `MCP_STATE_FILE` | Where `--http` records open sessions so a restart can hand them back. |
-pi-chrome reads a few of its own, which matter only when `PI_CHROME_PATH` points at a fork that
-supports them: `PI_CHROME_REMOTE` (drive a browser on another host through a broker),
+pi-chrome reads a few of its own, which this repository's copy supports (FORK.md has them all): `PI_CHROME_REMOTE` (drive a browser on another host through a broker),
`PI_CHROME_OTHER_BROWSER_TOOLS` (what its prompt calls the other browser's tools) and
`PI_CHROME_AUTHORIZE`. This server sets `PI_CHROME_AUTHORIZE` itself, since the client's prompts are
the gate.
@@ -237,15 +241,15 @@ This drives a browser that is signed in as you, so treat it accordingly:
## Updating
-pi-chrome is pinned in `package.json`. To move to a newer one, change the version, run
-`./run.sh --install-only`, and reload the extension at `chrome://extensions` if it reports that the
-extension changed.
+`git pull` (the fork is rebased onto upstream releases and force-pushed, so `git fetch` and
+`git reset --hard origin/master` when a pull refuses), then `./run.sh --install-only`, and reload
+the extension at `chrome://extensions` if `browser-extension/` changed.
## Uninstall
```bash
claude mcp remove --scope user my-chrome # and delete the entry from Claude Desktop's config
-rm -rf /path/to/pi-chrome-mcp # the repo, its node_modules and ./extension
+rm -rf /path/to/sz-chrome-remote-extension # the checkout, the extension and mcp/node_modules
```
Then remove "Pi Chrome Connector" at `chrome://extensions`.
@@ -255,6 +259,4 @@ Then remove "Pi Chrome Connector" at `chrome://extensions`.
The browser tools, the companion extension and the bridge are pi-chrome:
[the npm package `pi-chrome`](https://www.npmjs.com/package/pi-chrome), published by tianrendong of
Earendil Inc., source at [github.com/tianrendong/pi-chrome](https://github.com/tianrendong/pi-chrome),
-MIT licensed. It is pinned by version in `package.json` and by hash in `package-lock.json`, so an
-install fetches exactly what was tested. This repository adds the MCP server around it and is MIT
-licensed too.
+MIT licensed. This directory adds the MCP server around it and is MIT licensed too.