MCP Local Browser Guide (Production)
Last validated: March 11, 2026.
This guide shows how to drive your local Chrome through the production MCP
endpoint (https://api.unchainedsky.com/mcp).
What This Enables
- Keep your real browser session (cookies, extensions, 2FA state, IP)
- Use MCP tools (
cdp_navigate,ddm,cdp_click,js_eval,cdp_set_file,list_chrome_profiles,cdp_provision_launch,list_provisioned_tabs) from any MCP-compatible client - Run multiple Chrome profiles simultaneously (e.g. personal + work + social)
- Discover tabs opened by provisioned Chrome flows, including OAuth popups
- Zero-config path if you already installed the agent via
curl | bash - Avoid setting up and maintaining a custom Playwright skill for each tool host
Prerequisites
- A valid Unchained API key (
uc_live_...) and local Chrome - Either:
- installed agent already running (
~/unchained-agent, recommended) - or local repo checkout +
uvfor manual bridge start
- installed agent already running (
If you already run the packaged agent, reuse its existing API key from
~/unchained-agent/.env.
For local self-hosted dev, you can mint a key:
cd unchained-infra/unchained
uv run python -c "from auth import Auth; print(Auth().create_key('u-dev'))"
Fast Path (Zero Config): Existing Installed Agent
If the agent is already installed, you do not need to run uv run ... chrome_bridge.py
from source.
- Ensure your installed agent is running:
cd ~/unchained-agent
./start.sh --daemon
- Point your MCP client to:
https://api.unchainedsky.com/mcp
- That's it —
agent_idis auto-detected from your API key. You can verify connectivity with:
API_KEY="$(grep '^UNCHAINED_API_KEY=' ~/unchained-agent/.env | cut -d= -f2-)"
curl -sS https://api.unchainedsky.com/api/agents \
-H "Authorization: Bearer $API_KEY"
Manual Path: Start Bridge from Repo
cd unchained-infra/unchained
UNCHAINED_RELAY_URL=wss://api.unchainedsky.com/tunnel \
UNCHAINED_API_KEY=<your_uc_live_key> \
uv run python chrome_bridge.py start --no-headless
Expected output includes:
[agent] authenticated as claude-xxxxxxxx
The agent_id is auto-detected from your API key — you do not need to save or
pass it to MCP tools.
(Optional) Verify Agent Connectivity
curl -sS https://api.unchainedsky.com/api/agents \
-H "Authorization: Bearer <your_uc_live_key>"
You should see your agent_id in the response list.
Connect MCP Client
Example (Claude Code):
claude --mcp-server https://api.unchainedsky.com/mcp
Then call tools directly — agent_id is auto-detected from your API key:
cdp_navigatewithurl=https://slickdeals.netjs_evalwithexpression=document.titleddmwithflags=--text --find Slickdealslist_provisioned_tabsafter a provisioned login flow opens a popup tab
cdp_navigate navigates in the background by default — the Chrome window
stays out of your way while you work on other tasks. If a navigation silently
fails (Chrome 147+ routes Page.navigate to the omnibox AI Mode target when
the tab isn't foregrounded), pass bring_to_front=true to retry with the
window brought forward:
cdp_navigate url=https://slickdeals.net bring_to_front=true
Tool Surface
Browser tools accept agent_id; tab-aware tools also accept tab_id
("auto", a tab ID, an alias, or a prov-<slot>-<id>). Provisioning tools
are scoped by caller: an OAuth connector can launch a temporary copy from a
local profile, but it only sees and drives slots its own grant launched.
Page understanding and extraction
| Tool | Purpose |
|---|---|
ddm |
DOM Density Map — page layout + interactive elements (~500 tokens) |
ddm_frame |
DDM inside one iframe |
intel_probe |
Fingerprint the page and rank extraction strategies |
intel_extract |
Pull structured data with the chosen (or forced) strategy |
intel_stores |
List JS globals over 10KB that may hold page data |
intel_shape |
Map the shape of one JS global |
intel_find_paths |
Find paths to a key inside a JS global |
js_eval |
Run JavaScript in the page |
js_eval_frame |
Run JavaScript inside one iframe |
Interaction
| Tool | Purpose |
|---|---|
cdp_navigate |
Navigate; background by default, bring_to_front=true to show |
cdp_click |
Click by coordinates, DDM element ID, or label |
cdp_type |
Type into the focused element |
cdp_press_enter |
Press Enter in the focused element |
cdp_key_press |
Press a key with modifier flags |
cdp_scroll |
Scroll the page and return updated layout |
cdp_wait_ready |
Wait for dom, network, or both (default) |
cdp_screenshot |
Screenshot for CAPTCHAs/visual checks (prefer DDM) |
cdp_set_file |
Attach a local file to <input type="file"> without the picker |
Tabs, frames, cookies
| Tool | Purpose |
|---|---|
cdp_list_frames |
List iframes with frame IDs and URLs |
cdp_set_tab_alias |
Name a tab so the alias works as tab_id |
cdp_list_tab_aliases |
List named tabs |
cdp_get_cookies |
Read cookies for session saving |
cdp_set_cookies |
Inject cookies; rejects overly broad domains |
Rhythm (event-driven SPA automation)
| Tool | Purpose |
|---|---|
rhythm_train |
Learn a site's element timing once |
rhythm_catch |
Scan the DOM for specific data terms |
rhythm_execute |
Run a multi-step plan at event speed |
rhythm_query |
Query what Rhythm already knows about a site |
Agents and provisioning
| Tool | Purpose |
|---|---|
list_connected_agents |
List connected browsers and their profiles |
list_chrome_profiles |
List local Chrome profiles (Google sign-in) and their paths for cdp_provision_launch |
cdp_provision_launch |
Launch a temporary Chrome from a profile copy |
list_provisioned_tabs |
List tabs, including OAuth popups, in provisioned Chromes (own slots for OAuth callers) |
cdp_provision_cleanup |
Kill provisioned Chrome(s) and remove temp dirs (own slots for OAuth callers) |
Provisioned Chrome Tabs And OAuth Popups
When a provisioned Chrome flow opens a second tab or popup window, the default
profile-level agent_id is not enough to target it. Use the provisioned-tab
discovery tool to get a tab-scoped ID first.
Typical flow:
- Start the provisioned flow in the app or with your existing MCP/browser tools.
- Call
list_provisioned_tabsto discover tabs for the provisioned Chrome slot. - Copy the returned
prov-<slot>-<tab_id>value. - Pass that value as
tab_idtoddm,cdp_click,cdp_type,js_eval, or other tab-aware tools.
Example:
list_provisioned_tabs
Slot ab12 (profile: Profile 5, 2 tabs):
prov-ab12-AAA111... X / Login https://x.com/i/flow/login
prov-ab12-BBB222... Sign in - Google [popup] https://accounts.google.com/signin
ddm tab_id=prov-ab12-BBB222...
cdp_click x=742 y=508 tab_id=prov-ab12-BBB222...
Notes:
list_connected_agentsfinds bridge/profile agents.list_provisioned_tabsfinds tabs inside a provisioned Chrome instance.ddm --tabsnow includes popup windows and marks them with[popup].- Auto tab selection still prefers normal page tabs. Use an explicit
prov-...tab_idwhen you need the popup itself.
Multi-Profile Support
You can connect multiple Chrome profiles simultaneously under the same API key.
Each profile gets its own agent on the relay, and you target it by passing the
profile name in the agent_id parameter of any MCP tool.
Start a second bridge with a named profile
# Terminal 1 — default profile (already running)
cd ~/unchained-agent && ./start.sh --daemon
# Terminal 2 — "facebook" profile on a separate CDP port
UNCHAINED_RELAY_URL=wss://api.unchainedsky.com/tunnel \
UNCHAINED_API_KEY=<your_uc_live_key> \
uv run python chrome_bridge.py start --no-headless \
--profile facebook --port 9223
Each profile gets its own Chrome data directory (~/.unchained/chrome_<name>/)
with separate cookies, sessions, and extensions.
Discover connected profiles
Use the list_connected_agents MCP tool to see all connected agents:
Connected agents:
claude-abc12345 (profile: default)
claude-abc12345-facebook (profile: facebook)
Target a specific profile
Pass the profile name in the agent_id parameter of any tool:
cdp_navigate url=https://facebook.com agent_id=facebook
ddm agent_id=facebook
When agent_id is empty (the default), tools target the default profile.
Provisioned Chrome (OAuth / Authenticated Browsing)
Use provisioned Chrome when you need to sign into a site using a real Chrome profile (with saved passwords, cookies, 2FA state) through the MCP tools.
Workflow
- List the local Chrome profiles you can copy:
list_chrome_profiles
Response:
Chrome profiles available to copy (pass path to cdp_provision_launch):
Profile 5 (you@example.com)
path: /Users/you/Library/Application Support/Google/Chrome/Profile 5
The original profile is not modified; Chrome runs on a copy.
Only profiles signed into a Google account are listed, matching the web app's profile picker. Skip this step if you already know the profile's absolute path.
- Launch a temporary Chrome with the user's profile:
cdp_provision_launch profile_path="/Users/you/Library/Application Support/Google/Chrome/Profile 5"
Response:
Provisioned Chrome launched.
Slot: a1b2
Tab ID: prov-a1b2-AABB11CC22DD33EE44FF55667788990A
Debug port: 9600
- Use the returned
tab_idwith any MCP tool:
cdp_navigate url=https://x.com tab_id=prov-a1b2-AABB11CC22DD33EE44FF55667788990A
- Discover new tabs (e.g., OAuth popups) with
list_provisioned_tabs:
Slot a1b2 (profile: Profile 5, 2 tabs):
prov-a1b2-AABB11CC22DD33EE Log in to X / X https://x.com/i/flow/login
prov-a1b2-E914E9D4B944AABB Sign in - Google https://accounts.google.com/...
- Switch to the popup tab using its prov-prefixed ID:
ddm tab_id=prov-a1b2-E914E9D4B944AABB
cdp_click x=780 y=377 tab_id=prov-a1b2-E914E9D4B944AABB
- Clean up when done:
cdp_provision_cleanup slot=a1b2 # specific slot
cdp_provision_cleanup # all slots
Provisioning Tools
| Tool | Purpose |
|---|---|
list_chrome_profiles |
List local Chrome profiles (with Google sign-in) and their paths |
cdp_provision_launch |
Launch temp Chrome with a profile. Returns slot + prov-prefixed tab ID |
list_provisioned_tabs |
List all tabs across provisioned Chrome instances |
cdp_provision_cleanup |
Kill provisioned Chrome(s) and clean up temp dirs |
Notes
- Provisioned Chrome runs as a separate process with a copy of the profile
- The original Chrome profile is not modified
list_chrome_profilesreads the same inventory as the web app: profiles signed into a Google account- OAuth connectors may list profiles and launch their own provisioned Chromes; they only see slots their grant launched, and never another caller's. Connectors target
auto, a concrete tab id, or one of their ownprov-ids; tab aliases are not available to them. - Connectors approved before profile access existed must reconnect: the updated consent adds the
mcp:provisionscope, and older grants are told to re-approve - Tab IDs use
prov-{slot}-{chrome_id}format — pass these to any MCP tool'stab_idparameter ddm --tabswith a prov-prefixedtab_idauto-prefixes tab IDs in the output
Agent Prompt Snippet (AGENTS.md / CLAUDE.md)
Use this subsection in your agent instruction file so tool behavior stays consistent:
### Unchained MCP Tool Use
- MCP endpoint: `https://api.unchainedsky.com/mcp`
- `agent_id` is auto-detected from your API key — you do not need to pass it.
- To target a specific Chrome profile, pass the profile name in `agent_id` (e.g. `agent_id=facebook`).
- Use `list_connected_agents` to discover all connected profiles.
- Use `list_chrome_profiles` to find the local profile paths `cdp_provision_launch` can copy.
- Use `cdp_provision_launch` to launch a temp Chrome with a user profile for OAuth flows.
- Use `list_provisioned_tabs` to discover tabs (including popups) in provisioned Chrome.
- Use `cdp_provision_cleanup` to clean up provisioned Chrome instances when done.
#### DDM-First Methodology
Every browsing task follows this pipeline:
1. Step 1: ORIENT — `navigate` and `click` already return DDM page layout in their output. Read that. Do not call `ddm` separately after them. Only call `ddm` separately after `type`, or for `--text`, `--at x,y`, `--find`, `--js`.
2. Step 2: IDENTIFY — `ddm --at x,y` on targets from Step 1. It returns href, class, text, and aria attributes for elements you want to interact with.
3. Step 3: CLASSIFY — `intel --probe` on unknown SPAs. This fingerprints the page and ranks extraction strategies. It reveals framework, data stores, and shadow DOM.
4. Step 4: ACT — Use coordinates from DDM to click, or navigate to URLs from `--at`. For SPA widgets, use `js` with `.click()` on the element.
5. Step 5: VERIFY — After `navigate` or `click`, check the `"=== Page Layout ==="` section in their output. After `type` or other actions, run `ddm` to verify.
6. Step 6: EXTRACT — Choose method based on page type:
- Simple text: `ddm --text --max 5000`
- Shadow DOM: `intel --extract` with `host_attrs`
- SPA with data store: `intel --stores` -> `intel --find-paths` -> `js`
- Structured data: `js` with `querySelectorAll`
- data-testid rich pages: `intel --extract` with `data_testid`
#### Guardrails
- Use `cdp_navigate`, `cdp_click`, `cdp_type` for actions.
- Use `js_eval` for deterministic reads (title, URLs, structured DOM data).
- Use `cdp_set_file` to upload files to `<input type="file">` elements without the OS picker.
- Use `cdp_screenshot` only for visual-only states (CAPTCHA, image verification).
- If you get `Agent ... not connected`, stop and ask user to start/restart the local bridge.
This keeps instruction quality high without duplicating private-core internals.
Raw MCP Smoke Test (No SDK)
Use this when debugging handshake/tool issues:
python - <<'PY'
import json, urllib.request
URL = "https://api.unchainedsky.com/mcp"
API_KEY = "uc_live_..." # your API key
def post(payload, sid=None):
headers = {
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream",
"Authorization": f"Bearer {API_KEY}",
}
if sid:
headers["mcp-session-id"] = sid
req = urllib.request.Request(
URL, data=json.dumps(payload).encode(), method="POST", headers=headers
)
with urllib.request.urlopen(req, timeout=45) as r:
return r.status, r.headers, r.read().decode("utf-8", "replace")
init = {
"jsonrpc": "2.0",
"id": "1",
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": {"name": "manual-smoke", "version": "0.1"},
},
}
status, headers, _ = post(init)
sid = headers.get("Mcp-Session-Id") or headers.get("mcp-session-id")
print("initialize:", status, "session:", sid)
post({"jsonrpc": "2.0", "method": "notifications/initialized", "params": {}}, sid)
nav = {
"jsonrpc": "2.0",
"id": "2",
"method": "tools/call",
"params": {
"name": "cdp_navigate",
"arguments": {"url": "https://example.com"},
},
}
status, _, body = post(nav, sid)
print("navigate:", status)
print(body[:500])
PY
Why This Is Better (For Product Usage) Than a Playwright Skill
For Unchained's main user flow, MCP + local bridge is the better default:
- Auth reliability: uses the user's already-authenticated browser session
- Less setup drift: one MCP server endpoint, no per-skill wrapper maintenance
- Cross-client reuse: same MCP tools work with multiple MCP hosts/agents
- Lower operational overhead: no separate browser sandbox lifecycle to manage
- Better alignment with Unchained moat: "your browser, your identity, your IP"
Playwright skill still has valid use cases:
- deterministic CI test automation in isolated environments
- DOM/visual assertions against a disposable browser context
- scripted QA flows where local user identity is not required
Troubleshooting
404on/mcp: confirm deploy includes Caddy route for exact/mcp4004 Agent ... not connected: bridge is not running or wrongagent_id401 Missing Authorization headeron/api/agents: add Bearer API key- Bridge reconnect loop: verify relay URL and API key are valid