You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Framework users only install their provider + `@browser-echo/core`. No cross‑framework bloat.
28
35
36
+
#### 2. Use Browser Echo MCP (Optional)
37
+
38
+
**⚠️ IMPORTANT:** You **must complete step 1** (framework setup) first before MCP will work. The MCP server needs your framework to forward browser logs to it.
39
+
40
+
**📖 [Set up Browser Echo MCP Server](packages/mcp/README.md)** for AI assistant integration
41
+
29
42
## What you get
30
43
31
44
- Drop‑in client patch that wraps `console.log/info/warn/error/debug`
@@ -34,8 +47,40 @@ No production impact. Providers enable this across frameworks by injecting a tin
34
47
- Colorized terminal output
35
48
- Optional file logging (Vite provider only)
36
49
- Works great with AI assistants reading your terminal
50
+
-**NEW:** MCP (Model Context Protocol) support for enhanced AI assistant integration
51
+
52
+
## Browser Echo MCP Server
53
+
54
+
Browser Echo includes built-in MCP (Model Context Protocol) server support, enabling AI assistants like Claude (via Cursor) to interact with your frontend logs using natural language commands:
-**"Show only errors from the last 2 minutes"** - Filters by level and time
58
+
-**"Find hydration mismatch warnings"** - Searches for specific content
59
+
-**"Clear logs and start fresh"** - Clears the buffer for new captures
60
+
-**"Focus on my current tab's logs"** - Filters by session
61
+
62
+
The MCP server exposes two main tools:
63
+
-`get_logs` - Fetch logs with extensive filtering (level, session, time, content)
64
+
-`clear_logs` - Clear logs with soft/hard modes and session-specific clearing
65
+
66
+
This integration makes debugging with AI assistants much more powerful - they can directly query and analyze your frontend logs without you having to copy/paste from the terminal.
### MCP discovery and forwarding (Vite / Next / Nuxt)
71
+
72
+
- By default, when an MCP server is detected, frameworks forward logs to MCP and **suppress local terminal output**. If MCP is not found, they log locally.
73
+
-**Vite now auto‑discovers MCP** (no need to set `mcp.url`). It resolves in this order:
74
+
1. Explicit option/env: Vite plugin `mcp.url` or `BROWSER_ECHO_MCP_URL`
75
+
2. Discovery file written by the MCP server: `.browser-echo-mcp.json` (project root or OS tmp) containing `url` and `routeLogs`
76
+
3. Port scan of common local ports (127.0.0.1 / localhost)
77
+
4. Fallback to local terminal logging
78
+
-**Terminal output control:**
79
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=1` — Force suppress terminal output (even when no MCP)
80
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=0` — Force show terminal output (even when MCP forwarding)
81
+
- Framework-specific options available (see individual framework package READMEs)
37
82
38
-
## Options (shared shape)
83
+
## Options
39
84
40
85
Most providers accept these options (names may appear as plugin options or component props):
0 commit comments