@peekdev/mcp 0.1.0-alpha.4 → 0.1.0-alpha.6
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 +114 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @peekdev/mcp
|
|
2
|
+
|
|
3
|
+
> Your real browser, exposed to your AI coding agent over MCP — capture once, query forever, never leaves your machine.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@peekdev/mcp)
|
|
6
|
+
[](https://www.npmjs.com/package/@peekdev/mcp)
|
|
7
|
+
[](https://github.com/Cubenest/rrweb-stack/blob/main/LICENSE)
|
|
8
|
+
[](https://github.com/Cubenest/rrweb-stack/actions/workflows/ci.yml)
|
|
9
|
+
|
|
10
|
+
`@peekdev/mcp` is **two things in one binary**:
|
|
11
|
+
|
|
12
|
+
1. The **stdio MCP server** that AI coding agents (Claude Code, Cursor, Cline, Windsurf, Continue, Zed) speak to when querying your captured browser sessions.
|
|
13
|
+
2. The **native messaging host** that Chrome's MV3 extension speaks to when writing into `~/.peek/sessions.db`.
|
|
14
|
+
|
|
15
|
+
The same binary handles both roles — chosen by argv. You don't install this package directly in normal use; the [`@peekdev/cli`](https://www.npmjs.com/package/@peekdev/cli) `peek init` wizard wires it into your AI client's MCP config and into Chrome's `NativeMessagingHosts/`.
|
|
16
|
+
|
|
17
|
+
## You probably want `@peekdev/cli` instead
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install -g @peekdev/cli
|
|
21
|
+
peek init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Read on if you're configuring the MCP server manually, building tooling against it, or want the protocol/tool reference.
|
|
25
|
+
|
|
26
|
+
## What this is NOT
|
|
27
|
+
|
|
28
|
+
- Not a remote MCP server. Peek is **local-only**: stdio transport over a child-process pipe. There is no HTTP listener, no SSE endpoint, no remote auth. The MCP transport spec's Streamable HTTP variant is out of scope by design.
|
|
29
|
+
- Not a write-by-default tool. Read tools are unauthenticated; write tools (clicks, inputs, navigation, destructive actions) require explicit per-action authorization, recorded in `~/.peek/audit.log`.
|
|
30
|
+
- Not a wrapper around Chrome DevTools Protocol. The server reads recorded events from SQLite; the extension owns capture. No live `chrome.debugger` access from the MCP server.
|
|
31
|
+
|
|
32
|
+
## Manual MCP-client config
|
|
33
|
+
|
|
34
|
+
If `peek init` doesn't recognize your client, paste this into your client's MCP server registry:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"peek": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@peekdev/mcp"],
|
|
42
|
+
"env": {
|
|
43
|
+
"PEEK_HOME": "~/.peek"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For Claude Code, this goes in `~/.claude/mcp_servers.json` (per-project) or via `claude mcp add`. For Cursor: `~/Library/Application Support/Cursor/User/mcp_servers.json` (macOS). For Continue: in your `~/.continue/config.json` under `experimental.modelContextProtocolServers`.
|
|
51
|
+
|
|
52
|
+
## What the AI agent can do
|
|
53
|
+
|
|
54
|
+
| Tool | Action | Authorization |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `list_sessions` | List recent recording sessions | none |
|
|
57
|
+
| `get_session_metadata` | Get one session's metadata + counts | none |
|
|
58
|
+
| `get_session_console_errors` | Filter console messages by level / time | none |
|
|
59
|
+
| `get_session_network_errors` | Filter failed network requests (status >= 400) | none |
|
|
60
|
+
| `get_session_events` | Return rrweb event slices for a time window | none |
|
|
61
|
+
| `get_dom_snapshot` | Reconstruct the DOM at a given timestamp | none |
|
|
62
|
+
| `search_session` | Free-text search across console + network for a session | none |
|
|
63
|
+
| `generate_playwright_repro` | Emit a Playwright `.spec.ts` reproducing user actions | none |
|
|
64
|
+
| `execute_action` | Click / input / navigate in the live tab | per-action user prompt |
|
|
65
|
+
| `request_authorization` | Ask the user to permit a destructive action | per-action user prompt |
|
|
66
|
+
|
|
67
|
+
The full tool list is exposed via the MCP `tools/list` request (spec 2025-11-25 + back-compat for 2025-03-26). Tool docs ship with the binary via `tools/list` response `description` fields.
|
|
68
|
+
|
|
69
|
+
## Permission model (the five levels)
|
|
70
|
+
|
|
71
|
+
| Level | What it allows | Default |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| 1 — Read | Query the DB, reconstruct DOM, search events | enabled |
|
|
74
|
+
| 2 — Read with confirm | (none currently mapped) | n/a |
|
|
75
|
+
| 3 — Constrained write | Click whitelisted selectors | disabled |
|
|
76
|
+
| 4 — Broad write | Click any selector, type text, navigate | disabled |
|
|
77
|
+
| 5 — Destructive | Submit forms, navigate cross-origin, file uploads | disabled |
|
|
78
|
+
|
|
79
|
+
Levels 3-5 require explicit per-action authorization via `request_authorization`. Every authorized action is appended to `~/.peek/audit.log` (JSONL — `peek audit log --json` prints it). There is a hardcoded destructive-action blocklist (`window.close`, `document.write`, etc.) that cannot be authorized.
|
|
80
|
+
|
|
81
|
+
## Database
|
|
82
|
+
|
|
83
|
+
`~/.peek/sessions.db` — SQLite (better-sqlite3, WAL mode). Schema in `src/db/migrations/`. The CLI opens this DB read-mostly; the native host writes it during extension capture; the MCP server reads it for tool calls.
|
|
84
|
+
|
|
85
|
+
The native host is the **only writer**. The CLI and MCP server only read (except for the audit log, which is append-only JSONL on disk, not in the DB).
|
|
86
|
+
|
|
87
|
+
## Subpath exports
|
|
88
|
+
|
|
89
|
+
For consumers building tooling on top of peek:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { generatePlaywrightRepro } from '@peekdev/mcp/mcp/playwright-repro';
|
|
93
|
+
import { loadSessionEvents } from '@peekdev/mcp/mcp/event-blobs';
|
|
94
|
+
import { openDb } from '@peekdev/mcp/db';
|
|
95
|
+
import { startNativeHost } from '@peekdev/mcp/native-host';
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
These are the subpath exports the `@peekdev/cli` package uses. API surface is small but stable.
|
|
99
|
+
|
|
100
|
+
## Versioning & compatibility
|
|
101
|
+
|
|
102
|
+
Semantic Versioning. Currently `0.1.0-alpha.x` — pre-release; tool schemas are stable in spirit but new tools may land in patch releases. See [SUPPORTED.md](https://github.com/Cubenest/rrweb-stack/blob/main/SUPPORTED.md) for the compatibility matrix (MCP protocol versions, Chrome stable channels, Node versions).
|
|
103
|
+
|
|
104
|
+
## Privacy
|
|
105
|
+
|
|
106
|
+
Local-only. No network destinations. No telemetry. The MCP transport is stdio over a child-process pipe — your AI client launches `peek-mcp`, talks to it over stdin/stdout, and kills it when done. The binary holds no persistent state outside `~/.peek/`.
|
|
107
|
+
|
|
108
|
+
Full data-handling policy: [`docs/peek/PRIVACY_POLICY.md`](https://github.com/Cubenest/rrweb-stack/blob/main/docs/peek/PRIVACY_POLICY.md). Threat model: [`docs/peek/THREATMODEL.md`](https://github.com/Cubenest/rrweb-stack/blob/main/docs/peek/THREATMODEL.md).
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
Apache 2.0. The bundled rrweb engine remains MIT-licensed; see `NOTICE`.
|
|
113
|
+
|
|
114
|
+
Contributions are accepted under the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) — sign your commits with `git commit -s`. See [CONTRIBUTING.md](https://github.com/Cubenest/rrweb-stack/blob/main/CONTRIBUTING.md) + [SECURITY.md](https://github.com/Cubenest/rrweb-stack/blob/main/SECURITY.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peekdev/mcp",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"description": "peek native messaging host + stdio MCP server. Owns ~/.peek/sessions.db (better-sqlite3) and bridges the browser extension, CLI, and AI tools to a single local source of truth (ADR-0007).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
44
|
"better-sqlite3": "^12.10.0",
|
|
45
45
|
"zod": "^3.25.76",
|
|
46
|
-
"@cubenest/rrweb-core": "0.1.0-alpha.
|
|
46
|
+
"@cubenest/rrweb-core": "0.1.0-alpha.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/better-sqlite3": "^7.6.13",
|