Add bundled Chrome extension and document extension/stdio MCP setup
This commit is contained in:
@@ -12,6 +12,50 @@
|
||||
|
||||
网关内部 spawn 一个 browser-mcp stdio 进程作为上游(自动重连),对外在同一端口暴露两类接口,所有接口均需 Bearer 认证(也支持 `?token=` 查询参数)。
|
||||
|
||||
## 配套组件
|
||||
|
||||
本项目网关依赖 browser-mcp 的两半:**Chrome 扩展**(驱动浏览器)和 **stdio MCP server**(与扩展配对)。本项目仓库已自带扩展,无需再装 npm 包来获取扩展。
|
||||
|
||||
### 1. 安装 Chrome 扩展(项目自带 `extension/`)
|
||||
|
||||
1. 打开 Chrome,地址栏输入 `chrome://extensions/`
|
||||
2. 右上角打开 **开发者模式**
|
||||
3. 点击 **加载已解压的扩展程序**,选择本项目下的 `extension/` 目录
|
||||
4. 点击工具栏扩展图标(Agent360 Browser MCP),确认与本地 server 配对连接(扩展会连接 `127.0.0.1:9876`)
|
||||
|
||||
> `extension/` 来自 npm 包 `@agent360/browser-mcp@1.30.0` 自带的未打包扩展(Manifest V3),升级时可从新版 npm 包重新拷贝。
|
||||
|
||||
### 2. 安装 stdio 版本 MCP server(本机使用)
|
||||
|
||||
```bash
|
||||
npm install -g @agent360/browser-mcp
|
||||
```
|
||||
|
||||
在 MCP client 的配置中加入(以 Kimi Code 的 `~/.kimi-code/mcp.json` 为例):
|
||||
|
||||
```json
|
||||
"browser-mcp": {
|
||||
"command": "node",
|
||||
"args": ["C:\\Users\\<用户名>\\AppData\\Roaming\\npm\\node_modules\\@agent360\\browser-mcp\\bin\\cli.js"]
|
||||
}
|
||||
```
|
||||
|
||||
Linux / macOS 全局安装后一般为:
|
||||
|
||||
```json
|
||||
"browser-mcp": {
|
||||
"command": "node",
|
||||
"args": ["/usr/local/lib/node_modules/@agent360/browser-mcp/bin/cli.js"]
|
||||
}
|
||||
```
|
||||
|
||||
> 网关(`gateway.js`)内部就是以上述 stdio 方式启动同一个 `cli.js` 作为上游,再由网关桥接到局域网。
|
||||
|
||||
### 来源与官网
|
||||
|
||||
- **本项目使用的分叉**:Agent360 Browser MCP —— GitHub: <https://github.com/Agent360dk/browser-mcp> ,npm: `@agent360/browser-mcp`
|
||||
- **原版 BrowserMCP**:官网 <https://browsermcp.io> ,GitHub: <https://github.com/browsermcp/mcp>
|
||||
|
||||
## 接口
|
||||
|
||||
| 路径 | 说明 |
|
||||
@@ -90,6 +134,7 @@ claude mcp add --transport http browser-remote http://10.1.1.6:9109/mcp \
|
||||
```
|
||||
gateway.js # 网关主程序:HTTP 服务 + 认证 + stdio 上游管理 + MCP 代理
|
||||
pages.js # /、/docs、/docs.json 三个页面的 HTML/JSON 渲染
|
||||
extension/ # 配套 Chrome 扩展(Agent360 Browser MCP,未打包)
|
||||
package.json # 仅依赖 @modelcontextprotocol/sdk
|
||||
token.txt # Bearer token(gitignore)
|
||||
start-gateway.bat # Windows 启动脚本
|
||||
|
||||
Reference in New Issue
Block a user