browser-console-mcp 1.0.0 → 1.0.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.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/package.json +2 -3
- package/readme.md +110 -196
- package/bin/cli.js +0 -65
- package/mcp.json +0 -15
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-console-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MCP client for browser console and server for Cursor",
|
|
5
5
|
"main": "dist/server/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"browser-console-mcp": "./bin/
|
|
9
|
-
"browser-mcp-server": "./bin/browser-mcp-server.js"
|
|
8
|
+
"browser-console-mcp": "./bin/browser-mcp-server.js"
|
|
10
9
|
},
|
|
11
10
|
"keywords": [
|
|
12
11
|
"mcp",
|
package/readme.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Browser console MCP client and Cursor MCP server. Let your AI assistant control the browser!
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
<summary>English (Default)</summary>
|
|
5
|
+
**Language**: [English](#english) | [中文](#中文) | [日本語](#日本語) | [한국어](#한국어)
|
|
7
6
|
|
|
8
|
-
##
|
|
7
|
+
## English
|
|
8
|
+
|
|
9
|
+
### Introduction
|
|
9
10
|
|
|
10
11
|
Browser Console MCP is a tool that allows Cursor's Claude AI assistant to interact with the browser through the MCP (Model Context Protocol) protocol. It provides a browser client and an MCP server, enabling the AI assistant to perform the following operations:
|
|
11
12
|
|
|
@@ -17,44 +18,40 @@ Browser Console MCP is a tool that allows Cursor's Claude AI assistant to intera
|
|
|
17
18
|
- Click page elements
|
|
18
19
|
- Input text into form fields
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Global Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add -g browser-console-mcp
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Local Installation
|
|
21
|
+
### Usage
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
pnpm add browser-console-mcp
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Usage
|
|
35
|
-
|
|
36
|
-
### Start MCP Server
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# If installed globally
|
|
40
|
-
browser-console-mcp start
|
|
41
|
-
|
|
42
|
-
# If installed locally
|
|
43
|
-
pnpx browser-console-mcp start
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Inject MCP Client in Browser
|
|
23
|
+
#### Inject MCP Client in Browser
|
|
47
24
|
|
|
48
25
|
Execute the following code in your browser console:
|
|
49
26
|
|
|
50
27
|
```javascript
|
|
51
|
-
// Inject MCP server
|
|
28
|
+
// ======== IMPORTANT: Inject MCP server ========
|
|
52
29
|
var s = document.createElement('script');
|
|
53
30
|
s.src = 'http://localhost:7898/browser-inject.js';
|
|
54
31
|
document.head.appendChild(s);
|
|
32
|
+
// ==============================================
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### MCP Configuration
|
|
36
|
+
|
|
37
|
+
Create a `.cursor/mcp.json` file in your home directory:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"browser-mcp": {
|
|
43
|
+
"command": "pnpx",
|
|
44
|
+
"enable": true,
|
|
45
|
+
"args": ["-y", "browser-console-mcp"],
|
|
46
|
+
"env": {
|
|
47
|
+
"PORT": "7898"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
55
52
|
```
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
#### Using in Cursor
|
|
58
55
|
|
|
59
56
|
In Cursor, your AI assistant can now use the following tools:
|
|
60
57
|
|
|
@@ -67,32 +64,13 @@ In Cursor, your AI assistant can now use the following tools:
|
|
|
67
64
|
- `mcp_browser-mcp_clickElement`: Click page elements
|
|
68
65
|
- `mcp_browser-mcp_inputText`: Input text into form fields
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Install dependencies
|
|
74
|
-
pnpm install
|
|
75
|
-
|
|
76
|
-
# Build project
|
|
77
|
-
pnpm build:all
|
|
78
|
-
|
|
79
|
-
# Start development mode
|
|
80
|
-
pnpm dev
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## License
|
|
67
|
+
### License
|
|
84
68
|
|
|
85
69
|
MIT
|
|
86
|
-
</details>
|
|
87
70
|
|
|
88
|
-
|
|
89
|
-
<summary>中文</summary>
|
|
90
|
-
|
|
91
|
-
# Browser Console MCP
|
|
71
|
+
## 中文
|
|
92
72
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## 简介
|
|
73
|
+
### 简介
|
|
96
74
|
|
|
97
75
|
Browser Console MCP 是一个工具,允许 Cursor 的 Claude AI 助手通过 MCP(Model Context Protocol)协议与浏览器进行交互。它提供了一个浏览器客户端和一个 MCP 服务器,使 AI 助手能够执行以下操作:
|
|
98
76
|
|
|
@@ -104,44 +82,40 @@ Browser Console MCP 是一个工具,允许 Cursor 的 Claude AI 助手通过 M
|
|
|
104
82
|
- 点击页面元素
|
|
105
83
|
- 向输入框填入文本
|
|
106
84
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### 全局安装
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
pnpm add -g browser-console-mcp
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### 本地安装
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
pnpm add browser-console-mcp
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## 使用方法
|
|
122
|
-
|
|
123
|
-
### 启动 MCP 服务器
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
# 全局安装的情况
|
|
127
|
-
browser-console-mcp start
|
|
85
|
+
### 使用方法
|
|
128
86
|
|
|
129
|
-
|
|
130
|
-
pnpx browser-console-mcp start
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 在浏览器中注入 MCP 客户端
|
|
87
|
+
#### 在浏览器中注入 MCP 客户端
|
|
134
88
|
|
|
135
89
|
在浏览器控制台中执行以下代码:
|
|
136
90
|
|
|
137
91
|
```javascript
|
|
138
|
-
// 注入MCP服务器
|
|
92
|
+
// ======== 重要: 注入MCP服务器 ========
|
|
139
93
|
var s = document.createElement('script');
|
|
140
94
|
s.src = 'http://localhost:7898/browser-inject.js';
|
|
141
95
|
document.head.appendChild(s);
|
|
96
|
+
// ====================================
|
|
142
97
|
```
|
|
143
98
|
|
|
144
|
-
|
|
99
|
+
#### MCP 配置
|
|
100
|
+
|
|
101
|
+
在您的主目录中创建 `.cursor/mcp.json` 文件:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"mcpServers": {
|
|
106
|
+
"browser-mcp": {
|
|
107
|
+
"command": "pnpx",
|
|
108
|
+
"enable": true,
|
|
109
|
+
"args": ["-y", "browser-console-mcp"],
|
|
110
|
+
"env": {
|
|
111
|
+
"PORT": "7898"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### 在 Cursor 中使用
|
|
145
119
|
|
|
146
120
|
在 Cursor 中,你的 AI 助手现在可以使用以下工具:
|
|
147
121
|
|
|
@@ -154,32 +128,13 @@ document.head.appendChild(s);
|
|
|
154
128
|
- `mcp_browser-mcp_clickElement`: 点击页面元素
|
|
155
129
|
- `mcp_browser-mcp_inputText`: 向输入框填入文本
|
|
156
130
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
# 安装依赖
|
|
161
|
-
pnpm install
|
|
162
|
-
|
|
163
|
-
# 构建项目
|
|
164
|
-
pnpm build:all
|
|
165
|
-
|
|
166
|
-
# 启动开发模式
|
|
167
|
-
pnpm dev
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## 许可证
|
|
131
|
+
### 许可证
|
|
171
132
|
|
|
172
133
|
MIT
|
|
173
|
-
</details>
|
|
174
|
-
|
|
175
|
-
<details>
|
|
176
|
-
<summary>日本語</summary>
|
|
177
134
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
ブラウザコンソールのMCPクライアントとCursorのMCPサーバー。AIアシスタントにブラウザを制御させましょう!
|
|
135
|
+
## 日本語
|
|
181
136
|
|
|
182
|
-
|
|
137
|
+
### はじめに
|
|
183
138
|
|
|
184
139
|
Browser Console MCPは、CursorのClaude AIアシスタントがMCP(Model Context Protocol)プロトコルを通じてブラウザと対話できるようにするツールです。ブラウザクライアントとMCPサーバーを提供し、AIアシスタントが以下の操作を実行できるようにします:
|
|
185
140
|
|
|
@@ -191,44 +146,40 @@ Browser Console MCPは、CursorのClaude AIアシスタントがMCP(Model Cont
|
|
|
191
146
|
- ページ要素のクリック
|
|
192
147
|
- 入力フィールドへのテキスト入力
|
|
193
148
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### グローバルインストール
|
|
149
|
+
### 使用方法
|
|
197
150
|
|
|
198
|
-
|
|
199
|
-
pnpm add -g browser-console-mcp
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### ローカルインストール
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
pnpm add browser-console-mcp
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## 使用方法
|
|
209
|
-
|
|
210
|
-
### MCPサーバーの起動
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# グローバルインストールの場合
|
|
214
|
-
browser-console-mcp start
|
|
215
|
-
|
|
216
|
-
# ローカルインストールの場合
|
|
217
|
-
pnpx browser-console-mcp start
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### ブラウザにMCPクライアントを注入
|
|
151
|
+
#### ブラウザにMCPクライアントを注入
|
|
221
152
|
|
|
222
153
|
ブラウザのコンソールで以下のコードを実行します:
|
|
223
154
|
|
|
224
155
|
```javascript
|
|
225
|
-
// MCPサーバーを注入
|
|
156
|
+
// ======== 重要: MCPサーバーを注入 ========
|
|
226
157
|
var s = document.createElement('script');
|
|
227
158
|
s.src = 'http://localhost:7898/browser-inject.js';
|
|
228
159
|
document.head.appendChild(s);
|
|
160
|
+
// ========================================
|
|
229
161
|
```
|
|
230
162
|
|
|
231
|
-
|
|
163
|
+
#### MCP設定
|
|
164
|
+
|
|
165
|
+
ホームディレクトリに `.cursor/mcp.json` ファイルを作成します:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"browser-mcp": {
|
|
171
|
+
"command": "pnpx",
|
|
172
|
+
"enable": true,
|
|
173
|
+
"args": ["-y", "browser-console-mcp"],
|
|
174
|
+
"env": {
|
|
175
|
+
"PORT": "7898"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### Cursorでの使用
|
|
232
183
|
|
|
233
184
|
Cursorでは、AIアシスタントが以下のツールを使用できるようになります:
|
|
234
185
|
|
|
@@ -241,32 +192,13 @@ Cursorでは、AIアシスタントが以下のツールを使用できるよう
|
|
|
241
192
|
- `mcp_browser-mcp_clickElement`: ページ要素をクリック
|
|
242
193
|
- `mcp_browser-mcp_inputText`: 入力フィールドにテキストを入力
|
|
243
194
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
# 依存関係のインストール
|
|
248
|
-
pnpm install
|
|
249
|
-
|
|
250
|
-
# プロジェクトのビルド
|
|
251
|
-
pnpm build:all
|
|
252
|
-
|
|
253
|
-
# 開発モードの起動
|
|
254
|
-
pnpm dev
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## ライセンス
|
|
195
|
+
### ライセンス
|
|
258
196
|
|
|
259
197
|
MIT
|
|
260
|
-
</details>
|
|
261
198
|
|
|
262
|
-
|
|
263
|
-
<summary>한국어</summary>
|
|
199
|
+
## 한국어
|
|
264
200
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
브라우저 콘솔용 MCP 클라이언트와 Cursor용 MCP 서버. AI 어시스턴트가 브라우저를 제어할 수 있게 해보세요!
|
|
268
|
-
|
|
269
|
-
## 소개
|
|
201
|
+
### 소개
|
|
270
202
|
|
|
271
203
|
Browser Console MCP는 Cursor의 Claude AI 어시스턴트가 MCP(Model Context Protocol) 프로토콜을 통해 브라우저와 상호작용할 수 있게 해주는 도구입니다. 브라우저 클라이언트와 MCP 서버를 제공하여 AI 어시스턴트가 다음 작업을 수행할 수 있도록 합니다:
|
|
272
204
|
|
|
@@ -278,44 +210,40 @@ Browser Console MCP는 Cursor의 Claude AI 어시스턴트가 MCP(Model Context
|
|
|
278
210
|
- 페이지 요소 클릭하기
|
|
279
211
|
- 입력 필드에 텍스트 입력하기
|
|
280
212
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
### 전역 설치
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
pnpm add -g browser-console-mcp
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
### 로컬 설치
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
pnpm add browser-console-mcp
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
## 사용 방법
|
|
296
|
-
|
|
297
|
-
### MCP 서버 시작하기
|
|
213
|
+
### 사용 방법
|
|
298
214
|
|
|
299
|
-
|
|
300
|
-
# 전역 설치한 경우
|
|
301
|
-
browser-console-mcp start
|
|
302
|
-
|
|
303
|
-
# 로컬 설치한 경우
|
|
304
|
-
pnpx browser-console-mcp start
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### 브라우저에 MCP 클라이언트 주입하기
|
|
215
|
+
#### 브라우저에 MCP 클라이언트 주입하기
|
|
308
216
|
|
|
309
217
|
브라우저 콘솔에서 다음 코드를 실행하세요:
|
|
310
218
|
|
|
311
219
|
```javascript
|
|
312
|
-
// MCP 서버 주입
|
|
220
|
+
// ======== 중요: MCP 서버 주입 ========
|
|
313
221
|
var s = document.createElement('script');
|
|
314
222
|
s.src = 'http://localhost:7898/browser-inject.js';
|
|
315
223
|
document.head.appendChild(s);
|
|
224
|
+
// ===================================
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### MCP 구성
|
|
228
|
+
|
|
229
|
+
홈 디렉토리에 `.cursor/mcp.json` 파일을 생성하세요:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"mcpServers": {
|
|
234
|
+
"browser-mcp": {
|
|
235
|
+
"command": "pnpx",
|
|
236
|
+
"enable": true,
|
|
237
|
+
"args": ["-y", "browser-console-mcp"],
|
|
238
|
+
"env": {
|
|
239
|
+
"PORT": "7898"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
316
244
|
```
|
|
317
245
|
|
|
318
|
-
|
|
246
|
+
#### Cursor에서 사용하기
|
|
319
247
|
|
|
320
248
|
Cursor에서 AI 어시스턴트는 이제 다음 도구들을 사용할 수 있습니다:
|
|
321
249
|
|
|
@@ -328,20 +256,6 @@ Cursor에서 AI 어시스턴트는 이제 다음 도구들을 사용할 수 있
|
|
|
328
256
|
- `mcp_browser-mcp_clickElement`: 페이지 요소 클릭하기
|
|
329
257
|
- `mcp_browser-mcp_inputText`: 입력 필드에 텍스트 입력하기
|
|
330
258
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
# 의존성 설치
|
|
335
|
-
pnpm install
|
|
336
|
-
|
|
337
|
-
# 프로젝트 빌드
|
|
338
|
-
pnpm build:all
|
|
339
|
-
|
|
340
|
-
# 개발 모드 시작
|
|
341
|
-
pnpm dev
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
## 라이선스
|
|
259
|
+
### 라이선스
|
|
345
260
|
|
|
346
261
|
MIT
|
|
347
|
-
</details>
|
package/bin/cli.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Browser Console MCP CLI
|
|
5
|
-
*
|
|
6
|
-
* Command line entry point for starting the MCP server
|
|
7
|
-
* Supports running directly through npx or after global installation
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* - Global installation: browser-console-mcp start
|
|
11
|
-
* - npx: npx browser-console-mcp start
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { spawn } from "node:child_process";
|
|
15
|
-
import { dirname, join } from "node:path";
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
17
|
-
|
|
18
|
-
// Get current file directory
|
|
19
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
-
const __dirname = dirname(__filename);
|
|
21
|
-
const rootDir = join(__dirname, "..");
|
|
22
|
-
|
|
23
|
-
// Command line arguments
|
|
24
|
-
const args = process.argv.slice(2);
|
|
25
|
-
const command = args[0] || "help";
|
|
26
|
-
|
|
27
|
-
// Process command
|
|
28
|
-
switch (command) {
|
|
29
|
-
case "start":
|
|
30
|
-
// Start server-side MCP server
|
|
31
|
-
console.log("Starting Browser Console MCP server...");
|
|
32
|
-
spawn("node", [join(rootDir, "dist/server/index.js")], {
|
|
33
|
-
stdio: "inherit",
|
|
34
|
-
});
|
|
35
|
-
break;
|
|
36
|
-
|
|
37
|
-
case "start:browser":
|
|
38
|
-
// Start browser MCP server
|
|
39
|
-
console.log("Starting Browser MCP server...");
|
|
40
|
-
spawn("node", [join(rootDir, "dist/browser/index.js")], {
|
|
41
|
-
stdio: "inherit",
|
|
42
|
-
});
|
|
43
|
-
break;
|
|
44
|
-
|
|
45
|
-
default:
|
|
46
|
-
console.log(`
|
|
47
|
-
Browser Console MCP CLI
|
|
48
|
-
|
|
49
|
-
Usage:
|
|
50
|
-
browser-console-mcp <command> [options]
|
|
51
|
-
npx browser-console-mcp <command> [options]
|
|
52
|
-
|
|
53
|
-
Commands:
|
|
54
|
-
start Start server-side MCP server
|
|
55
|
-
start:browser Start browser MCP server
|
|
56
|
-
help Display help information
|
|
57
|
-
|
|
58
|
-
Examples:
|
|
59
|
-
browser-console-mcp start
|
|
60
|
-
npx browser-console-mcp start
|
|
61
|
-
browser-console-mcp start:browser
|
|
62
|
-
npx browser-console-mcp start:browser
|
|
63
|
-
`);
|
|
64
|
-
break;
|
|
65
|
-
}
|