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
feat: expand documentation for MCP server setup and integration across frameworks, including installation steps and environment variable configurations
Copy file name to clipboardExpand all lines: README.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@ No production impact. Providers enable this across frameworks by injecting a tin
16
16
17
17
## Quick start
18
18
19
+
#### 1. Install Framework Package
20
+
21
+
First, set up Browser Echo for your framework:
22
+
19
23
| Framework | Quick Setup |
20
24
| --- | --- |
21
25
| TanStack / Vite |[Installation Guide](packages/vite/README.md#tanstack-start)|
@@ -29,6 +33,12 @@ No production impact. Providers enable this across frameworks by injecting a tin
29
33
30
34
> Framework users only install their provider + `@browser-echo/core`. No cross‑framework bloat.
31
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
+
32
42
## What you get
33
43
34
44
- Drop‑in client patch that wraps `console.log/info/warn/error/debug`
@@ -39,7 +49,7 @@ No production impact. Providers enable this across frameworks by injecting a tin
39
49
- Works great with AI assistants reading your terminal
40
50
-**NEW:** MCP (Model Context Protocol) support for enhanced AI assistant integration
41
51
42
-
## MCP Support for AI Assistants
52
+
## Browser Echo MCP Server
43
53
44
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:
45
55
@@ -57,7 +67,20 @@ This integration makes debugging with AI assistants much more powerful - they ca
### 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)
82
+
83
+
## Options
61
84
62
85
Most providers accept these options (names may appear as plugin options or component props):
Copy file name to clipboardExpand all lines: packages/core/README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ Core client-side functionality for streaming browser console logs to your dev te
4
4
5
5
This package provides the `initBrowserEcho` function that patches `console.*` methods and forwards logs to a development server endpoint. It's designed to be used as a dependency by framework-specific providers.
6
6
7
+
## Table of Contents
8
+
9
+
-[Installation](#installation)
10
+
-[Usage](#usage)
11
+
-[Install MCP Server](#install-mcp-server)
12
+
7
13
## Features
8
14
9
15
- Drop-in client patch that wraps `console.log/info/warn/error/debug`
@@ -65,6 +71,21 @@ This core package is typically used through framework-specific providers:
65
71
66
72
See the [main repository](https://github.com/instructa/browser-echo) for complete setup guides.
67
73
74
+
## Install MCP Server
75
+
76
+
For core usage, MCP forwarding depends on your server-side route implementation. The core package only handles browser-side log collection.
77
+
78
+
**📖 [First, set up the MCP server](../mcp/README.md#installation) for your AI assistant, then configure framework options below.**
79
+
80
+
### Environment Variables
81
+
82
+
-`BROWSER_ECHO_MCP_URL=http://127.0.0.1:5179/mcp` — Set in your server environment
83
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=1` — Control terminal output in your route handler
84
+
85
+
### Server Route MCP Integration
86
+
87
+
See the [React MCP Settings](../react/README.md#mcp-settings) for an example server route with MCP forwarding.
@@ -15,53 +15,121 @@ Your AI assistant will automatically use the appropriate MCP tools to fetch and
15
15
16
16
---
17
17
18
-
## Installation for AI Assistants
18
+
## Installation
19
19
20
-
### Cursor IDE
20
+
**⚠️ PREREQUISITE:** Before setting up the MCP server, you **must first install and configure a Browser Echo framework package** (Vite, Next.js, Nuxt, etc.) in your project. The MCP server needs your framework to forward browser logs to it.
21
+
22
+
**📖 [Choose your framework and complete setup first](../README.md#quick-start)**
23
+
24
+
Once your framework is set up and forwarding logs, install the Browser Echo MCP server with your client. Using stdio transport.
claude mcp add browser-echo-mcp npx -y @browser-echo/mcp
67
+
```
68
+
69
+
70
+
<details>
71
+
<summary>Claude Desktop</summary>
72
+
73
+
Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.
74
+
</details>
75
+
76
+
<details>
77
+
<summary>Gemini CLI</summary>
78
+
79
+
Follow the MCP install [guide](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md#configure-the-mcp-server-in-settingsjson), use the standard config above.
80
+
</details>
81
+
82
+
<details>
83
+
<summary>opencode</summary>
84
+
85
+
Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
86
+
87
+
```json
88
+
{
89
+
"$schema": "https://opencode.ai/config.json",
90
+
"mcp": {
91
+
"browser-echo": {
92
+
"type": "local",
93
+
"command": [
94
+
"npx",
95
+
"@browser-echo/mcp"
96
+
],
97
+
"enabled": true
98
+
}
99
+
}
100
+
}
101
+
102
+
```
103
+
</details>
51
104
52
-
## Streamable HTTP Setup
105
+
<details>
106
+
<summary>VS Code</summary>
53
107
54
-
If you prefer HTTP transport over stdio (useful for web-based AI tools):
108
+
#### Click the button to install:
55
109
56
-
### 1. Install the package
110
+
#### Or install manually:
111
+
112
+
Follow the MCP install [guide](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server), use the standard config above. You can also install the Playwright MCP server using the VS Code CLI:
Copy file name to clipboardExpand all lines: packages/next/README.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,14 @@ Next.js App Router integration for streaming browser console logs to your dev te
4
4
5
5
Since Turbopack doesn't use Vite, this package provides a tiny route handler and an early script component to patch `console.*` methods and forward logs to your development server.
6
6
7
+
## Table of Contents
8
+
9
+
-[Installation](#installation)
10
+
-[Quick Setup](#quick-setup-recommended)
11
+
-[Manual Setup](#manual-setup)
12
+
-[Available Options](#available-options)
13
+
-[Install MCP Server](#install-mcp-server)
14
+
7
15
## Features
8
16
9
17
- Next.js App Router compatible
@@ -177,6 +185,46 @@ export default function RootLayout({ children }: { children: ReactNode }) {
177
185
export { POST, runtime, dynamic } from'@browser-echo/next/route';
178
186
```
179
187
188
+
## Install MCP Server
189
+
190
+
Next.js automatically discovers and forwards logs to MCP servers. No configuration needed in most cases!
191
+
192
+
**📖 [First, set up the MCP server](../mcp/README.md#installation) for your AI assistant, then configure framework options below.**
193
+
194
+
### Auto-Discovery (Default)
195
+
196
+
The Next.js route handler automatically detects MCP servers and forwards logs when available. When MCP is detected, terminal output is suppressed by default.
197
+
198
+
### Environment Variables
199
+
200
+
-`BROWSER_ECHO_MCP_URL=http://127.0.0.1:5179/mcp` — Set MCP server URL
201
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=1` — Force suppress terminal output
202
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=0` — Force show terminal output even when MCP is active
Nuxt automatically discovers and forwards logs to MCP servers. No configuration needed in most cases!
103
+
104
+
**📖 [First, set up the MCP server](../mcp/README.md#installation) for your AI assistant, then configure framework options below.**
105
+
106
+
### Auto-Discovery (Default)
107
+
108
+
The Nuxt server handler automatically detects MCP servers and forwards logs when available. When MCP is detected, terminal output is suppressed by default.
109
+
110
+
### Environment Variables
111
+
112
+
-`BROWSER_ECHO_MCP_URL=http://127.0.0.1:5179/mcp` — Set MCP server URL
113
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=1` — Force suppress terminal output
114
+
-`BROWSER_ECHO_SUPPRESS_TERMINAL=0` — Force show terminal output even when MCP is active
115
+
116
+
### Disable MCP Discovery
117
+
118
+
```ts
119
+
// nuxt.config.ts
120
+
exportdefaultdefineNuxtConfig({
121
+
modules: ['@browser-echo/nuxt'],
122
+
123
+
// Disable MCP discovery via environment
124
+
runtimeConfig: {
125
+
browserEcho: {
126
+
disableMcp: true// Custom flag to disable MCP in your handler
127
+
}
128
+
}
129
+
});
130
+
```
131
+
93
132
## How it works
94
133
95
134
1. The module registers a Nitro server route at `/__client-logs` (configurable)
0 commit comments