@predotdev/mcp 0.0.0-stage → 2.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pre.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,383 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <a href="https://pre.dev/browser-agents">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="assets/predev-logo-white.png">
5
+ <img alt="pre.dev" src="assets/predev-logo-dark.png" width="240">
6
+ </picture>
7
+ </a>
8
+ </p>
2
9
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
10
+ <h1 align="center">pre.dev MCP</h1>
11
+
12
+ <p align="center">
13
+ <b>pre.dev in every coding agent.</b><br>
14
+ Browser agents in the Chrome you already have open and in the cloud, plus specs and plans. One command to set up. Free and open source.
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-black"></a>
19
+ <a href="https://www.npmjs.com/package/@predotdev/mcp"><img alt="npm" src="https://img.shields.io/npm/v/@predotdev/mcp?color=black"></a>
20
+ <img alt="Node 22+" src="https://img.shields.io/badge/node-22%2B-black">
21
+ <img alt="macOS" src="https://img.shields.io/badge/macOS-supported-black">
22
+ <img alt="Zero dependencies" src="https://img.shields.io/badge/dependencies-0-black">
23
+ <a href="https://pre.dev"><img alt="pre.dev" src="https://img.shields.io/badge/made%20by-pre.dev-black"></a>
24
+ </p>
25
+
26
+ ---
27
+
28
+ One MCP server gives your coding agent everything pre.dev does:
29
+
30
+ - **Browser Agents Local: your own Chrome.** Open a tab in your work profile, read a dashboard you are already logged into, fill in a form, click through a flow and screenshot the result, all in the Chrome you use every day. No second browser, nothing to log into again, no cookies copied anywhere.
31
+ - **Browser Agents in the cloud.** Send a URL and a task to pre.dev's browsers and get structured data back, many runs in parallel.
32
+ - **Specs and plans.** Plan an app or feature before building it: architecture, tech stack, milestones and user stories.
33
+
34
+ It works with **any coding agent that runs MCP servers locally**: Claude Code, Codex, Cursor, Windsurf, VS Code, Gemini CLI, OpenCode, Claude Desktop and more. Run as many agents as you like at the same time. They all share one connection to Chrome, so Chrome only asks you to allow it once.
35
+
36
+ Built with the [pre.dev CLI](https://docs.pre.dev/cli/overview).
37
+
38
+ ## Quick start
39
+
40
+ You need **macOS**, **Google Chrome** and **Node.js 22 or newer** (check with `node --version`). Run one command:
41
+
42
+ ```bash
43
+ npx -y @predotdev/mcp setup
44
+ ```
45
+
46
+ It walks you through everything:
47
+
48
+ 1. **Signs you in to pre.dev** in your browser (or creates a free account). Approve, and your key is saved for every agent. Nothing to copy.
49
+ 2. **Adds it to every coding agent on your Mac**: Claude Code, Codex, Cursor, Windsurf, VS Code, Gemini CLI, OpenCode and Claude Desktop. Already using the hosted pre.dev MCP? This one includes all of its tools, so setup replaces it.
50
+ 3. **Connects to Chrome.** The first time, it asks you to turn on remote debugging at `chrome://inspect/#remote-debugging` (it copies the address for you), and Chrome asks **"Allow remote debugging?"**: click **Allow**.
51
+
52
+ Then restart your agent and try:
53
+
54
+ > List my Chrome profiles and the tabs I have open.
55
+
56
+ > [!TIP]
57
+ > **Or let your agent do it.** Paste this into Claude Code (or any coding agent):
58
+ > *Run `npx -y @predotdev/mcp setup` with a 10 minute timeout and tell me what to click.*
59
+
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
+
62
+ ## Local or cloud?
63
+
64
+ Both editions of pre.dev Browser Agents are in this server, and your agent picks per task.
65
+
66
+ | | **Local** (`chrome_*` tools) | **[Cloud](https://docs.pre.dev/browser-agents/overview)** (`browser_agent`) |
67
+ | --- | --- | --- |
68
+ | Runs in | Your own Chrome | pre.dev's browsers |
69
+ | Logged in as | You, in every profile you use | Nobody (public pages) |
70
+ | Driven by | Your coding agent, step by step | One API call with a URL and a task |
71
+ | Best for | Dashboards, internal tools, admin panels, anything behind your login | Structured data from public sites, many runs in parallel |
72
+ | Also available | Only here | The REST API and SDKs |
73
+
74
+ ## What your agent can do
75
+
76
+ **In your own Chrome** (run on your Mac):
77
+
78
+ | Tool | What it does |
79
+ | --- | --- |
80
+ | `chrome_profiles` | List your Chrome profiles (name, Google account) and how many tabs each has open |
81
+ | `chrome_tabs` | List open tabs grouped by profile |
82
+ | `chrome_open` | Open a URL in a specific profile, in the background by default so you are not interrupted |
83
+ | `chrome_navigate` | Load a URL in a tab, or go back, forward or reload |
84
+ | `chrome_snapshot` | List the clickable and typeable elements on a page as short refs (`[e1]`, `[e2]`, ...) |
85
+ | `chrome_click` | Click by ref, CSS selector, visible text or coordinates, with real mouse events |
86
+ | `chrome_type` | Type into inputs, text areas, rich editors and dropdowns |
87
+ | `chrome_act` | Click or type into an element described in plain words, in one call ([plain-words actions](#plain-words-actions)) |
88
+ | `chrome_press` | Press keys and shortcuts (`Enter`, `Tab`, `cmd+a`, `shift+Tab`) |
89
+ | `chrome_scroll` | Scroll the page or bring an element into view |
90
+ | `chrome_read` | Read a page's text, paged for long pages |
91
+ | `chrome_screenshot` | Screenshot the visible area or the full page |
92
+ | `chrome_wait` | Wait for text, a selector, a URL change, or a plain-words condition |
93
+ | `chrome_eval` | Run JavaScript in the page and return the result |
94
+ | `chrome_upload` | Attach local files to an upload button or file input |
95
+ | `chrome_show` | Bring a tab to the front so you can see it or take over |
96
+ | `chrome_close` | Close a tab |
97
+
98
+ **In pre.dev's cloud** (need a pre.dev plan; on the free plan your agent sees them and can open the subscribe page for you):
99
+
100
+ | Tool | What it does |
101
+ | --- | --- |
102
+ | `browser_agent` | Run one or more tasks in pre.dev's cloud browsers: a URL plus an instruction or a JSON Schema for the output; returns each task's data |
103
+ | `browser_agent_list` / `browser_agent_get` | Earlier cloud runs, and one run with its step-by-step events |
104
+ | `fast_spec` / `deep_spec` | Plan an app or feature: architecture, tech stack, milestones and user stories (`deep_spec` adds subtasks) |
105
+ | `get_spec` / `list_specs` | A spec's status and result, and the specs you have made |
106
+ | `get_plan` | The verified plan of a project you own |
107
+
108
+ This is what your agent sees when it takes a snapshot:
109
+
110
+ ```
111
+ Tab A137CF · Work <you@company.com> · Create your account
112
+ https://example.com/signup
113
+ Headings: "Create your account"
114
+ Scroll: 0/640px
115
+ [e1] textbox "Full name"
116
+ [e2] textbox "Email" value="you@company.com"
117
+ [e3] select "Plan" selected="Free"
118
+ [e4] checkbox "I agree to the terms" [unchecked]
119
+ [e5] button "Create account"
120
+ ```
121
+
122
+ Every tab is labeled with the profile it belongs to, so the agent always knows which account it is acting as.
123
+
124
+ ## Plain-words actions
125
+
126
+ Once you are signed in to pre.dev (`setup` or `login` does it, or set `PREDEV_API_KEY`), two things turn on:
127
+
128
+ - `chrome_act`: click or type into an element described in plain words, like *"the Create button in the dialog"*, in under a second with no snapshot needed. If it isn't sure, it lists the likely matches instead of guessing.
129
+ - `chrome_wait` with `condition`: wait until a plain-words statement about the page is true, like *"the export has finished"*.
130
+
131
+ **Pricing.** The MCP server is free and open source, and the Chrome tools run free on your Mac. Plain-words actions and the cloud tools use pre.dev credits, the same credits as the rest of pre.dev ([pricing](https://pre.dev/pricing)). Each action costs a small fraction of one credit, and the free trial's credits cover more than a thousand actions. They show up in your usage as `browser-agents-local`, and `check` shows your plan. If the free plan's allowance or your credits run out, your agent tells you and offers to open the [billing page](https://pre.dev/billing) in your Chrome; everything else keeps working. Every other tool runs entirely on your machine and never calls pre.dev.
132
+
133
+ ## Setup for every agent
134
+
135
+ `setup` does this for you. To add it by hand instead (for example to an agent `setup` doesn't know), every agent runs the same command. Sign in once with `npx -y @predotdev/mcp login` and leave the key out, or put your key from [Integrations → Built-in](https://pre.dev/projects/integrations) in the agent's environment:
136
+
137
+ ```
138
+ npx -y @predotdev/mcp env: PREDEV_API_KEY=your_key (optional after login)
139
+ ```
140
+
141
+ <details>
142
+ <summary><b>Claude Code</b></summary>
143
+
144
+ ```bash
145
+ claude mcp add --scope user predev -e PREDEV_API_KEY=your_key -- npx -y @predotdev/mcp
146
+ ```
147
+
148
+ </details>
149
+
150
+ <details>
151
+ <summary><b>Codex</b></summary>
152
+
153
+ ```bash
154
+ codex mcp add predev --env PREDEV_API_KEY=your_key -- npx -y @predotdev/mcp
155
+ ```
156
+
157
+ Or add this to `~/.codex/config.toml`. The longer timeout gives specs and cloud runs time to finish:
158
+
159
+ ```toml
160
+ [mcp_servers.predev]
161
+ command = "npx"
162
+ args = ["-y", "@predotdev/mcp"]
163
+ env = { PREDEV_API_KEY = "your_key" }
164
+ tool_timeout_sec = 900
165
+ ```
166
+
167
+ </details>
168
+
169
+ <details>
170
+ <summary><b>Cursor</b></summary>
171
+
172
+ Add to `~/.cursor/mcp.json`, then restart Cursor:
173
+
174
+ ```json
175
+ {
176
+ "mcpServers": {
177
+ "predev": {
178
+ "command": "npx",
179
+ "args": ["-y", "@predotdev/mcp"],
180
+ "env": { "PREDEV_API_KEY": "your_key" }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ </details>
187
+
188
+ <details>
189
+ <summary><b>Windsurf</b></summary>
190
+
191
+ Add to `~/.codeium/windsurf/mcp_config.json`, then restart Windsurf:
192
+
193
+ ```json
194
+ {
195
+ "mcpServers": {
196
+ "predev": {
197
+ "command": "npx",
198
+ "args": ["-y", "@predotdev/mcp"],
199
+ "env": { "PREDEV_API_KEY": "your_key" }
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ </details>
206
+
207
+ <details>
208
+ <summary><b>VS Code (Copilot agent mode)</b></summary>
209
+
210
+ Add to `.vscode/mcp.json` in your project, or run **MCP: Open User Configuration** to add it for every project:
211
+
212
+ ```json
213
+ {
214
+ "servers": {
215
+ "predev": {
216
+ "type": "stdio",
217
+ "command": "npx",
218
+ "args": ["-y", "@predotdev/mcp"],
219
+ "env": { "PREDEV_API_KEY": "your_key" }
220
+ }
221
+ }
222
+ }
223
+ ```
224
+
225
+ </details>
226
+
227
+ <details>
228
+ <summary><b>Gemini CLI</b></summary>
229
+
230
+ Add to `~/.gemini/settings.json`:
231
+
232
+ ```json
233
+ {
234
+ "mcpServers": {
235
+ "predev": {
236
+ "command": "npx",
237
+ "args": ["-y", "@predotdev/mcp"],
238
+ "env": { "PREDEV_API_KEY": "your_key" }
239
+ }
240
+ }
241
+ }
242
+ ```
243
+
244
+ </details>
245
+
246
+ <details>
247
+ <summary><b>OpenCode</b></summary>
248
+
249
+ Add to `~/.config/opencode/opencode.json`:
250
+
251
+ ```json
252
+ {
253
+ "mcp": {
254
+ "predev": {
255
+ "type": "local",
256
+ "command": ["npx", "-y", "@predotdev/mcp"],
257
+ "environment": { "PREDEV_API_KEY": "your_key" },
258
+ "enabled": true
259
+ }
260
+ }
261
+ }
262
+ ```
263
+
264
+ </details>
265
+
266
+ <details>
267
+ <summary><b>Claude Desktop</b></summary>
268
+
269
+ Desktop apps don't load your shell's `PATH`, so give them full paths. Install once:
270
+
271
+ ```bash
272
+ npm install -g @predotdev/mcp
273
+ ```
274
+
275
+ Then print the exact entry to paste:
276
+
277
+ ```bash
278
+ echo "\"predev\": {\"command\": \"$(which node)\", \"args\": [\"$(npm root -g)/@predotdev/mcp/src/bridge.mjs\"], \"env\": {\"PREDEV_API_KEY\": \"your_key\"}}"
279
+ ```
280
+
281
+ Put that entry inside `"mcpServers"` in `~/Library/Application Support/Claude/claude_desktop_config.json`, replace `your_key`, then restart Claude Desktop. The same trick works for any app that says it can't find `npx` or `node`.
282
+
283
+ </details>
284
+
285
+ <details>
286
+ <summary><b>Any other MCP client</b></summary>
287
+
288
+ Add a local (stdio) server with command `npx`, arguments `-y @predotdev/mcp`, and the environment variable `PREDEV_API_KEY`. If the client can't find `npx`, use the full-path setup from the Claude Desktop section.
289
+
290
+ </details>
291
+
292
+ ## How it works
293
+
294
+ ```mermaid
295
+ flowchart LR
296
+ A["Claude Code"] --> D
297
+ B["Codex"] --> D
298
+ C["Cursor"] --> D
299
+ D["pre.dev MCP background process<br/>(one per Chrome)"] -- "one approved connection" --> E["Your Chrome<br/>(every profile)"]
300
+ D -. "plain-words actions and cloud tools" .-> F["pre.dev API"]
301
+ ```
302
+
303
+ - Chrome asks you to approve each debugging connection. Instead of every agent opening its own connection (and its own prompt), the first agent starts a small background process that holds **one** connection, and every agent talks to it. You click Allow once each time Chrome starts.
304
+ - Each agent uses its own pre.dev API key, even though they share the connection.
305
+ - The cloud tools are pre.dev's hosted MCP tools, passed through on the same key, so they stay current without updating this package.
306
+ - Tabs open in the background by default and are kept responsive while an agent works in them, so you can keep using Chrome.
307
+ - Snapshots reach into shadow DOM and same-origin iframes, and clicks are real mouse events, so modern web apps behave the way they do for you.
308
+ - It has no dependencies: plain Node.js talking to Chrome's DevTools Protocol.
309
+
310
+ ## Safety
311
+
312
+ This tool drives your real, logged-in Chrome. Read this before you turn it on.
313
+
314
+ - **Anything you can do in a tab, the agent can do.** Only connect agents you trust, and keep an eye on what they do on sensitive sites. `chrome_eval` runs JavaScript in the page.
315
+ - **Passwords stay with you.** It refuses to type into password fields (except on `localhost` and `.test` dev sites) and masks password values in snapshots. The agent is told never to enter passwords, payment details or government ID numbers.
316
+ - **It only listens on your machine.** The background process binds to `127.0.0.1` only and rejects requests without a random per-run token, which is stored in a file only you can read. It also rejects any request that comes from a web page.
317
+ - **What leaves your machine.** Plain-words actions send pre.dev the page's interactive elements and visible text for that one action, and the cloud tools send what you ask them to do. The other Chrome tools run locally.
318
+ - **Off switch.** Run `npx -y @predotdev/mcp stop` to stop the background process, or turn remote debugging off at `chrome://inspect/#remote-debugging`.
319
+
320
+ ## Configuration
321
+
322
+ Set these in your agent's MCP config (`env`).
323
+
324
+ | Variable | What it does |
325
+ | --- | --- |
326
+ | `PREDEV_API_KEY` | Your pre.dev API key. Overrides the key saved by `login`. |
327
+ | `PREDEV_API_URL` | The pre.dev API to call. Default `https://api.pre.dev`. |
328
+ | `CHROME_MCP_USER_DATA_DIR` | Use a different Chrome data folder, for example Chrome Beta or a separate Chrome you started yourself. Each folder gets its own background process. |
329
+
330
+ State, logs, the stable copy `setup` installs and the key saved by `login` (readable only by you) are kept in `~/.predev/mcp/`.
331
+
332
+ ## Commands
333
+
334
+ ```bash
335
+ npx -y @predotdev/mcp setup # sign in, add to every agent, connect to Chrome (also updates)
336
+ npx -y @predotdev/mcp check # check your setup, list your Chrome profiles, check your key
337
+ npx -y @predotdev/mcp login # sign in to pre.dev again
338
+ npx -y @predotdev/mcp logout # forget the saved key
339
+ npx -y @predotdev/mcp stop # stop the background process (it restarts on the next tool call)
340
+ npx -y @predotdev/mcp uninstall # remove it from every agent and delete its files
341
+ ```
342
+
343
+ ## Troubleshooting
344
+
345
+ | You see | Do this |
346
+ | --- | --- |
347
+ | `Chrome remote debugging is off` | Open `chrome://inspect/#remote-debugging` in Chrome and turn it on. |
348
+ | `Chrome is asking "Allow remote debugging?"` | Click **Allow** in Chrome, then ask your agent to try again. |
349
+ | Chrome asks to allow again | Normal after Chrome restarts, or after this tool updates to a new version. |
350
+ | `Plain-words actions need a pre.dev account` | Run `npx -y @predotdev/mcp login`. No restart needed. |
351
+ | `pre.dev rejected the saved key` | Run `npx -y @predotdev/mcp login` again. |
352
+ | A message about credits or subscribing | Your workspace is out of trial credits. Subscribe or top up at [pre.dev/billing](https://pre.dev/billing). |
353
+ | Another server is already named `predev` | `setup` leaves it alone and registers this one as `pre-dev`. |
354
+ | You had the hosted pre.dev MCP or an older `chrome` install | `setup` replaced it; this server has all of its tools. |
355
+ | The agent can't start the server, or `npx`/`node` not found | Run `setup`: it registers full paths that work in desktop apps. |
356
+ | Codex says a tool call timed out | Set `tool_timeout_sec = 900` (see the Codex setup). |
357
+ | Anything else | Run `npx -y @predotdev/mcp check`, and look at `~/.predev/mcp/predev-mcp.log`. |
358
+
359
+ ## Platform support
360
+
361
+ **macOS** is supported and tested. **Linux** and **Windows** are not tested yet. The code looks for Chrome's data in the standard places (`~/.config/google-chrome` and `%LOCALAPPDATA%\Google\Chrome\User Data`), and on those systems a profile needs an open Chrome window before the agent can use it. Reports and pull requests are welcome.
362
+
363
+ ## Development
364
+
365
+ ```bash
366
+ git clone https://github.com/predotdev/mcp
367
+ cd mcp
368
+ node src/bridge.mjs check
369
+ ```
370
+
371
+ Point your agent at `node /path/to/mcp/src/bridge.mjs`. Edits to `src/tools.mjs` reload automatically without dropping Chrome's approved connection. Edits to `src/bridge.mjs` restart the background process, so Chrome asks you to allow again.
372
+
373
+ ## About
374
+
375
+ Free and open source from [pre.dev](https://pre.dev), built with the pre.dev CLI. Try it on your own project:
376
+
377
+ ```bash
378
+ curl -fsSL https://pre.dev/install | bash
379
+ ```
380
+
381
+ Want the same browser agents from your own code? Use the [REST API and SDKs](https://docs.pre.dev/browser-agents/overview).
382
+
383
+ MIT licensed. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@predotdev/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.1",
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
+ "type": "module",
6
+ "bin": {
7
+ "predev-mcp": "src/bridge.mjs"
8
+ },
9
+ "files": [
10
+ "src",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "engines": {
15
+ "node": ">=22"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "model-context-protocol",
20
+ "chrome",
21
+ "browser",
22
+ "browser-automation",
23
+ "browser-agents",
24
+ "coding-agent",
25
+ "claude-code",
26
+ "codex",
27
+ "cursor",
28
+ "pre.dev",
29
+ "predev",
30
+ "specs",
31
+ "cloud-browser"
32
+ ],
33
+ "homepage": "https://github.com/predotdev/mcp#readme",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/predotdev/mcp.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/predotdev/mcp/issues"
40
+ },
41
+ "author": "pre.dev (https://pre.dev)",
42
+ "license": "MIT",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }