neuron-inspector 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +123 -95
  2. package/dist/server.js +1 -1
  3. package/package.json +18 -5
package/README.md CHANGED
@@ -1,30 +1,32 @@
1
1
  # neuron-inspector
2
2
 
3
- **51 browser tools for AI agents.** Turn Chrome into an MCP-powered DevOps platform inspect DOM, automate clicks, audit security, mock APIs, extract data, record demos — all from Claude Code, Cursor, Windsurf, or any MCP client.
3
+ **51 browser tools for AI agents.** Your AI can't see your browser. This fixes that.
4
4
 
5
- ```bash
6
- npx neuron-inspector
7
- ```
5
+ Inspect DOM, automate clicks, run JavaScript, search network traffic, audit security, check accessibility, scan SEO, mock APIs, extract structured data, record demos — all from Claude Code, Cursor, Windsurf, or any MCP client.
8
6
 
9
- ## What this does
7
+ No API keys. No cloud. Runs on localhost.
10
8
 
11
- Your AI agent can't see your browser. neuron-inspector fixes that.
9
+ [![npm](https://img.shields.io/npm/v/neuron-inspector)](https://www.npmjs.com/package/neuron-inspector)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
12
11
 
13
- It bridges a Chrome extension to your AI coding tool via MCP (Model Context Protocol). Once connected, your agent gets 51 tools that let it read the DOM, click buttons, run JS, search network traffic, audit accessibility, scan for security leaks, mock API responses, extract structured data from any page, and more.
12
+ ```bash
13
+ npx neuron-inspector
14
+ ```
14
15
 
15
- No API keys. No cloud. Runs entirely on localhost.
16
+ ---
16
17
 
17
- ## Setup (2 minutes)
18
+ ## Get started
18
19
 
19
20
  ### 1. Install the Chrome extension
20
21
 
21
- Download from [neuron.ng/extension](https://neuron.ng/extension) and sideload it:
22
+ Download from **[neuron.ng/extension](https://neuron.ng/extension)** and sideload:
22
23
 
23
- 1. Extract the zip
24
- 2. Open `chrome://extensions`, enable Developer Mode
25
- 3. Click "Load unpacked" and select the folder
24
+ 1. Download and extract the zip
25
+ 2. Open `chrome://extensions` and enable **Developer Mode**
26
+ 3. Click **Load unpacked** and select the extracted folder
27
+ 4. The extension icon appears in your toolbar
26
28
 
27
- ### 2. Register the MCP server
29
+ ### 2. Connect to your AI tool
28
30
 
29
31
  **Claude Code:**
30
32
  ```bash
@@ -55,9 +57,75 @@ claude mcp add neuron-inspector -- npx neuron-inspector
55
57
  }
56
58
  ```
57
59
 
58
- That's it. The extension auto-connects to the bridge on `ws://localhost:7377`.
60
+ ### 3. Use it
61
+
62
+ Open any page in Chrome. Ask your AI agent to interact with it. Done.
63
+
64
+ ---
65
+
66
+ ## What you can do
67
+
68
+ ### Ask your agent to debug a page
69
+
70
+ > "Why is this page slow?"
71
+
72
+ The agent calls `neuron_perf_snapshot` and gets back Core Web Vitals, render-blocking scripts, memory usage, and the heaviest resources.
73
+
74
+ > "Check this page for security issues"
75
+
76
+ `neuron_security_scan` finds leaked API keys in inline scripts, missing CSP headers, mixed content, insecure forms, exposed source maps.
77
+
78
+ > "Is this page accessible?"
79
+
80
+ `neuron_a11y_audit` runs a WCAG audit — color contrast failures, missing alt text, broken heading hierarchy, unlabeled form fields.
81
+
82
+ ### Ask your agent to explore traffic
83
+
84
+ > "What APIs is this SPA calling?"
85
+
86
+ `neuron_discover_apis` maps every endpoint from observed traffic — call counts, status codes, auth patterns, response shapes.
87
+
88
+ > "Search all network responses for 'user_id'"
89
+
90
+ `neuron_search_traffic` does full-text search across every captured response body.
91
+
92
+ > "Show me the network waterfall"
93
+
94
+ `neuron_waterfall` gives DNS, TCP, TLS, TTFB timing per resource — the same view as DevTools Network, but in your agent's context.
95
+
96
+ ### Ask your agent to interact with the page
97
+
98
+ > "Click the Sign Up button"
99
+
100
+ `neuron_click` finds it by CSS selector or visible text and clicks it.
101
+
102
+ > "Fill in the email field with test@example.com"
103
+
104
+ `neuron_type` targets the input and types into it.
105
+
106
+ > "Scroll down and extract all the product listings"
107
+
108
+ `neuron_scroll` + `neuron_extract_data` — scrolls the page and pulls structured data from repeating patterns (cards, tables, feeds).
109
+
110
+ ### Ask your agent to test edge cases
59
111
 
60
- ## The 51 tools
112
+ > "Mock the payments API to return a 500 error"
113
+
114
+ `neuron_set_mock` intercepts matching requests and returns your custom response. Test error states without touching the real backend.
115
+
116
+ > "Take a snapshot, click submit, then tell me what changed"
117
+
118
+ `neuron_snapshot_state` before, action, `neuron_diff_states` after — detects DOM changes, added/removed elements, URL changes.
119
+
120
+ ### Ask your agent to record and replay
121
+
122
+ > "Record what I'm doing as a workflow"
123
+
124
+ `neuron_start_recording` captures clicks, typing, and navigation. `neuron_start_demo` replays it as a polished video with chapter markers and cursor overlay.
125
+
126
+ ---
127
+
128
+ ## All 51 tools
61
129
 
62
130
  ### Inspect & Debug
63
131
  | Tool | What it does |
@@ -67,141 +135,101 @@ That's it. The extension auto-connects to the bridge on `ws://localhost:7377`.
67
135
  | `neuron_evaluate_js` | Run JavaScript in page context |
68
136
  | `neuron_get_logs` | Console logs filtered by level, tab, search |
69
137
  | `neuron_screenshot` | PNG screenshot of the visible area |
70
- | `neuron_diagnose` | Connection health extension connected? Tabs open? |
138
+ | `neuron_diagnose` | Connection health check |
71
139
  | `neuron_list_tabs` | Open tabs with platform detection |
72
140
 
73
141
  ### Browse & Automate
74
142
  | Tool | What it does |
75
143
  |------|-------------|
76
- | `neuron_click` | Click an element by selector or text |
144
+ | `neuron_click` | Click by selector or text |
77
145
  | `neuron_type` | Type into inputs and contenteditable |
78
- | `neuron_scroll` | Scroll by pixels or scroll an element into view |
79
- | `neuron_navigate` | Navigate a tab to a URL |
146
+ | `neuron_scroll` | Scroll by pixels or into view |
147
+ | `neuron_navigate` | Navigate to a URL |
80
148
  | `neuron_open_tab` | Open a new tab |
81
149
  | `neuron_reload` | Reload a tab |
82
- | `neuron_run_sequence` | Execute a multi-step sequence (click, type, wait, eval) |
150
+ | `neuron_run_sequence` | Multi-step automation (click, type, wait, eval) |
83
151
 
84
152
  ### Network Intelligence
85
153
  | Tool | What it does |
86
154
  |------|-------------|
87
- | `neuron_get_requests` | Query captured HTTP requests by tab, method, status, URL |
88
- | `neuron_get_errors` | Recent 4xx/5xx responses and console errors |
155
+ | `neuron_get_requests` | Query HTTP requests by tab, method, status, URL |
156
+ | `neuron_get_errors` | Recent 4xx/5xx and console errors |
89
157
  | `neuron_get_ws_frames` | WebSocket and SSE frame history |
90
- | `neuron_export_har` | Export traffic as HAR 1.2 |
91
- | `neuron_search_traffic` | Full-text search across all captured response bodies |
92
- | `neuron_discover_apis` | Auto-map API endpoints from observed traffic |
93
- | `neuron_replay_request` | Re-fire an HTTP request with the browser's live session |
94
- | `neuron_waterfall` | Network timing breakdown — DNS, TLS, TTFB per resource |
158
+ | `neuron_export_har` | Export as HAR 1.2 |
159
+ | `neuron_search_traffic` | Full-text search across response bodies |
160
+ | `neuron_discover_apis` | Auto-map API endpoints from traffic |
161
+ | `neuron_replay_request` | Re-fire a request with the browser's live session |
162
+ | `neuron_waterfall` | DNS/TLS/TTFB timing per resource |
95
163
 
96
- ### Security Scan
164
+ ### Security
97
165
  | Tool | What it does |
98
166
  |------|-------------|
99
- | `neuron_security_scan` | Scan for leaked secrets, missing headers, CORS issues, mixed content |
100
- | `neuron_check_auth` | Verify platform credentials are still valid |
167
+ | `neuron_security_scan` | Leaked secrets, missing headers, CORS, mixed content |
168
+ | `neuron_check_auth` | Verify platform credentials |
101
169
  | `neuron_detect_blocker` | Detect rate limits, captchas, login walls |
102
170
 
103
- ### Quality Audits
171
+ ### Quality
104
172
  | Tool | What it does |
105
173
  |------|-------------|
106
- | `neuron_a11y_audit` | WCAG accessibility audit — contrast, labels, headings, tabindex |
107
- | `neuron_perf_snapshot` | Core Web Vitals, resource breakdown, memory, long tasks |
108
- | `neuron_seo_audit` | Title, meta, OG, headings, structured data, link ratio |
174
+ | `neuron_a11y_audit` | WCAG audit — contrast, labels, headings, tabindex |
175
+ | `neuron_perf_snapshot` | Core Web Vitals, resource breakdown, memory |
176
+ | `neuron_seo_audit` | Meta, OG, headings, structured data, links |
109
177
 
110
178
  ### Network Mocking
111
179
  | Tool | What it does |
112
180
  |------|-------------|
113
- | `neuron_set_mock` | Intercept requests and return custom responses |
181
+ | `neuron_set_mock` | Intercept requests, return custom responses |
114
182
  | `neuron_get_mocks` | List active mock rules |
115
183
  | `neuron_clear_mocks` | Remove all mocks |
116
184
 
117
185
  ### Cookies & Storage
118
186
  | Tool | What it does |
119
187
  |------|-------------|
120
- | `neuron_get_cookies` | Read all cookies for a URL |
188
+ | `neuron_get_cookies` | Read cookies for a URL |
121
189
  | `neuron_set_cookie` | Set a cookie |
122
190
  | `neuron_delete_cookie` | Delete a cookie |
123
- | `neuron_get_storage` | Read localStorage or sessionStorage |
191
+ | `neuron_get_storage` | Read localStorage / sessionStorage |
124
192
  | `neuron_clear_storage` | Clear storage |
125
193
 
126
194
  ### Page Monitoring
127
195
  | Tool | What it does |
128
196
  |------|-------------|
129
- | `neuron_snapshot_state` | Capture page state (DOM, visibility, text) for later diff |
130
- | `neuron_diff_states` | Compare two snapshots — detect what changed |
131
- | `neuron_watch_element` | Watch a selector for changes over time |
197
+ | `neuron_snapshot_state` | Capture page state for later diff |
198
+ | `neuron_diff_states` | Compare two snapshots |
199
+ | `neuron_watch_element` | Watch a selector for changes |
132
200
  | `neuron_get_watches` | Check accumulated changes |
133
201
  | `neuron_stop_watch` | Stop watching |
134
- | `neuron_extract_data` | Extract structured data from repeating patterns (feeds, tables, listings) |
202
+ | `neuron_extract_data` | Extract structured data from feeds, tables, listings |
135
203
 
136
204
  ### Demo Recording
137
205
  | Tool | What it does |
138
206
  |------|-------------|
139
- | `neuron_start_recording` | Record user interactions as a replayable workflow |
207
+ | `neuron_start_recording` | Record interactions as a workflow |
140
208
  | `neuron_stop_recording` | Save the recording |
141
209
  | `neuron_list_workflows` | List saved workflows |
142
210
  | `neuron_start_replay` | Replay a workflow |
143
211
  | `neuron_stop_replay` | Stop replay |
144
- | `neuron_start_demo` | Record a demo video with chapters, captions, cursor overlay |
145
- | `neuron_workflow_status` | Current engine state |
212
+ | `neuron_start_demo` | Record a demo video with chapters + cursor |
213
+ | `neuron_workflow_status` | Engine state |
146
214
 
147
215
  ### Other
148
216
  | Tool | What it does |
149
217
  |------|-------------|
150
- | `neuron_trigger_post` | Trigger the IG post runner |
151
- | `neuron_session_diagnostics` | Agent session health — capture rate, stalls, auth, buffers |
218
+ | `neuron_trigger_post` | Trigger the post runner |
219
+ | `neuron_session_diagnostics` | Agent session health |
152
220
 
153
- ## Examples
154
-
155
- **"Why is this page slow?"**
156
- ```
157
- → neuron_perf_snapshot { tabId: 123 }
158
- ← LCP: 3.2s, CLS: 0.04, 14 render-blocking scripts, heaviest: analytics.js (890KB)
159
- ```
160
-
161
- **"Check this page for security issues"**
162
- ```
163
- → neuron_security_scan { tabId: 123 }
164
- ← 3 findings: API key leaked in inline script, missing CSP header, autocomplete on password field
165
- ```
166
-
167
- **"What APIs is this SPA calling?"**
168
- ```
169
- → neuron_discover_apis {}
170
- ← 12 endpoints: GET /api/users/{id} (called 8x), POST /api/auth/refresh (2x), ...
171
- ```
172
-
173
- **"Extract all product listings from this page"**
174
- ```
175
- → neuron_extract_data { tabId: 123 }
176
- ← 47 items: [{ text: "Nike Air Max", link: "/product/123", image: "...", price: "$129" }, ...]
177
- ```
178
-
179
- **"Mock the payments API to return a 500"**
180
- ```
181
- → neuron_set_mock { urlPattern: "*/api/payments*", responseStatus: 500, responseBody: "{\"error\":\"service down\"}" }
182
- ← Mock rule active. All matching requests will return 500.
183
- ```
184
-
185
- ## How it works
186
-
187
- ```
188
- ┌─────────────┐ WebSocket ┌──────────────────┐ stdio/MCP ┌──────────────┐
189
- │ Chrome + │ ←──────────────→ │ neuron-inspector │ ←──────────────→ │ Claude Code │
190
- │ Extension │ localhost:7377 │ (this pkg) │ │ / Cursor │
191
- └─────────────┘ └──────────────────┘ └──────────────┘
192
- ```
193
-
194
- 1. The Chrome extension captures network traffic, DOM state, and console logs in real time
195
- 2. `neuron-inspector` runs as a local bridge — WebSocket server on port 7377 (extension connects here) + MCP server on stdio (your AI tool connects here)
196
- 3. Your AI agent calls tools via MCP → the bridge forwards them to the extension → the extension executes in Chrome → results flow back
197
-
198
- Everything runs on localhost. No data leaves your machine.
221
+ ---
199
222
 
200
223
  ## Requirements
201
224
 
202
225
  - Node.js 18+
203
- - Chrome (or Chromium-based browser)
204
- - [Neuron extension](https://neuron.ng/extension) installed
226
+ - Chrome or any Chromium browser
227
+ - [Neuron extension](https://neuron.ng/extension)
228
+
229
+ ## Links
230
+
231
+ - **Extension download:** [neuron.ng/extension](https://neuron.ng/extension)
232
+ - **npm:** [npmjs.com/package/neuron-inspector](https://www.npmjs.com/package/neuron-inspector)
205
233
 
206
234
  ## License
207
235
 
package/dist/server.js CHANGED
@@ -38,7 +38,7 @@ console.error(`[bridge] WebSocket server listening on 127.0.0.1:${PORT}`);
38
38
  // ── MCP server (Claude Code / Cursor connects via stdio) ────
39
39
  const mcp = new McpServer({
40
40
  name: "neuron-inspector",
41
- version: "0.1.0",
41
+ version: "0.1.2",
42
42
  });
43
43
  // Register all tools
44
44
  for (const tool of TOOLS) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neuron-inspector",
3
- "version": "0.1.1",
4
- "description": "MCP server exposing Neuron extension browser state as queryable tools",
3
+ "version": "0.1.2",
4
+ "description": "51 browser tools for AI agents. Turn Chrome into an MCP server inspect DOM, automate clicks, audit security, mock APIs, extract data, record demos.",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",
7
7
  "bin": {
@@ -21,16 +21,29 @@
21
21
  "homepage": "https://neuron.ng/extension",
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "https://github.com/conquext/neuron.git",
25
- "directory": "packages/extension/bridge"
24
+ "url": "https://github.com/conquext/neuron-inspector.git"
26
25
  },
27
26
  "keywords": [
28
27
  "neuron",
29
28
  "mcp",
29
+ "mcp-server",
30
+ "model-context-protocol",
30
31
  "chrome-extension",
31
32
  "browser-tools",
33
+ "browser-automation",
32
34
  "inspector",
33
- "devtools"
35
+ "devtools",
36
+ "ai-agents",
37
+ "claude-code",
38
+ "cursor",
39
+ "windsurf",
40
+ "dom-inspector",
41
+ "security-audit",
42
+ "accessibility",
43
+ "seo-audit",
44
+ "network-mocking",
45
+ "web-scraping",
46
+ "browser-devtools"
34
47
  ],
35
48
  "dependencies": {
36
49
  "@modelcontextprotocol/sdk": "^1.0.0",