@gecho-ai/gecho-bridge 1.1.5 → 1.1.7

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.
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@gecho-ai/gecho-bridge",
3
+ "version": "1.1.7",
4
+ "description": "TikTok Search Tool for OpenClaw"
5
+ }
package/.mcp.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "gecho-tiktok-search": {
4
+ "command": "node",
5
+ "args": ["./mcp-client.js"],
6
+ "timeout": 600000,
7
+ "retries": 0
8
+ }
9
+ }
10
+ }
package/README.en.md ADDED
@@ -0,0 +1,158 @@
1
+ # Gecho Bridge 🚀
2
+
3
+ 🌐 **Gecho Bridge** is a universal MCP (Model Context Protocol) tool designed to bridge your large language model (LLM) and your local browser.
4
+ After installation, whether you use **OpenClaw**, **Hermes**, or **Trae**, your AI assistant can directly control the browser to automate TikTok search, data scraping, and deep opportunity insights.
5
+
6
+ ---
7
+
8
+ ## ✨ Who Is It For
9
+
10
+ - 📊 **Competitor analysis**: Input a keyword and quickly get engagement data from top TikTok posts.
11
+ - 💡 **Finding winning products**: Use deep insight tools to analyze trends in specific niches (for example, "portable blender") and discover underserved opportunities.
12
+ - 🤖 **Automated operations**: Let your AI model control the browser, scroll automatically, scrape results, and generate reports without manual counting.
13
+
14
+ ## 🚀 What It Can Do
15
+
16
+ - Launch Chrome automatically, search TikTok with a target keyword, and simulate natural human-like scrolling.
17
+ - Collect large-scale structured data (video ID, title, likes, video link, and more) and safely save it as JSON files.
18
+ - Run **asynchronous deep insights** powered by large-scale retrieval to summarize trends and potential business opportunities.
19
+
20
+ ## 🔗 Links
21
+
22
+ - **Official Website**: [https://gecho.ai/](https://gecho.ai/)
23
+ - **ClawHub Plugin Page**: [https://clawhub.ai/plugins/gecho-bridge](https://clawhub.ai/plugins/gecho-bridge)
24
+ - **Chrome Extension**: [Install from Chrome Web Store](https://chromewebstore.google.com/detail/pjkaeenpekolahdbccjfenjcmanemlbj?utm_source=item-share-cb)
25
+
26
+ ---
27
+
28
+ ## 📦 Installation & Setup
29
+
30
+ This project follows the standard MCP protocol and can be integrated with any MCP-compatible AI client (such as OpenClaw, Hermes, and Trae).
31
+
32
+ ### 0. Prerequisites
33
+ 1. **Node.js**: >= 18 (with `npm` / `npx` support).
34
+ 2. **Browser extension**: [Install the Gecho Chrome Extension first](https://chromewebstore.google.com/detail/pjkaeenpekolahdbccjfenjcmanemlbj?utm_source=item-share-cb).
35
+ 3. **Network and account state**: Ensure stable access to TikTok, keep your TikTok account logged in, and keep the extension online.
36
+
37
+ ### Option 1: One-Click Setup in OpenClaw (ClawHub)
38
+ ClawHub provides two installation paths: `Skill` and `Plugin`.
39
+
40
+ #### Path A: Skill Install (MCP Required First)
41
+ Skill installation executes through MCP, so you must configure MCP first:
42
+ ```bash
43
+ openclaw mcp set gecho-bridge '{"command":"npx","args":["-y","@gecho-ai/gecho-bridge@latest"]}'
44
+ openclaw gateway restart
45
+ ```
46
+ *After configuration, run `openclaw mcp list` to verify status.*
47
+ *Then return to ClawHub and install the Skill.*
48
+
49
+ #### Path B: Plugin Install (Recommended)
50
+ ```bash
51
+ openclaw plugins install @gecho-ai/gecho-bridge
52
+ openclaw gateway restart
53
+ ```
54
+ *To upgrade later, run `openclaw plugins update @gecho-ai/gecho-bridge`.*
55
+
56
+ ### Option 2: One-Click Setup in Hermes (Hermes Skill Hub)
57
+ Use the following commands to add the service in Hermes and restart:
58
+ ```bash
59
+ hermes mcp add gecho-bridge --command npx --args="-y" --args="@gecho-ai/gecho-bridge@latest"
60
+ hermes restart
61
+ ```
62
+ *After restart, run `hermes mcp list` to verify installation status.*
63
+
64
+ ### Option 3: Manual Setup for Trae / Claude Desktop and Other MCP Clients
65
+ In clients that support manual MCP configuration, open `mcp.json` or `claude_desktop_config.json` and add:
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "gecho-bridge": {
70
+ "command": "npx",
71
+ "args": ["-y", "@gecho-ai/gecho-bridge@latest"]
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## 🏁 Quick Start & Common Workflows
80
+
81
+ After setup is complete and your AI client has restarted, you can directly use natural language commands.
82
+
83
+ ### 🔍 Basic Search (`tiktok_search`)
84
+ Best for quick retrieval and collection of video data.
85
+ **Example prompts:**
86
+ - *"Search TikTok for 'portable blender' and return the top 10 by likes."*
87
+ - *"Search 'cat toy' and save full results to /Users/yourname/gecho-data."*
88
+
89
+ **Execution flow:**
90
+ 1. AI triggers the local Gecho browser extension to search and auto-scroll.
91
+ 2. After scraping, large-scale results are automatically saved locally.
92
+ 3. AI summarizes the top 20 high-like results in your chat.
93
+
94
+ ### 📈 Deep Insight (`tiktok_insight`)
95
+ Best for category research and trend analysis.
96
+ **Example prompts:**
97
+ - *"Run tiktok_insight for 'outdoor picnic mat'."*
98
+ - *"Compare hot video styles and engagement between 'desk setup' and 'minimal desk'."*
99
+
100
+ **Execution flow:**
101
+ 1. The plugin starts an asynchronous insight job and immediately returns a `jobId`.
102
+ 2. **⚠️ Important**: Deep insights involve heavy scraping and AI analysis, and usually take **more than 5 minutes**. During execution, **do not close the browser extension or related TikTok pages**.
103
+ 3. After waiting, ask AI: *"Use check_insight_status to query the previous job status"* to get the final report.
104
+
105
+ ---
106
+
107
+ ## ⚙️ Storage Configuration
108
+
109
+ To better manage your data assets, scraped results should be persisted to disk. The plugin supports the following priority order:
110
+
111
+ 1. **Session-level (highest priority)**: In chat, ask AI to set `save_dir` directly (must be an absolute path).
112
+ 2. **Global-level**: Set the environment variable `GECHO_DATA_DIR` as the default save directory.
113
+ 3. **Fallback default**: If not specified, data is saved to the built-in `./data` directory.
114
+
115
+ *(Note: All output filenames are automatically sanitized to avoid write failures from invalid characters.)*
116
+
117
+ ---
118
+
119
+ ## 🛠️ Troubleshooting
120
+
121
+ ### 1. How do I confirm the plugin is loaded? (OpenClaw example)
122
+ Run:
123
+ ```bash
124
+ openclaw plugins info @gecho-ai/gecho-bridge
125
+ ```
126
+ If installation succeeds, you should see `Status: loaded` and `MCP servers: gecho-tiktok-search`.
127
+
128
+ ### 2. Error: Extension not connected
129
+ - Check whether the Gecho Chrome extension is enabled.
130
+ - Make sure your TikTok account is logged in, and the TikTok page is not crashed or unresponsive.
131
+
132
+ ### 3. Error: Request timeout
133
+ - Check whether TikTok displays a CAPTCHA challenge; if so, solve it manually first.
134
+ - If results are too sparse for the keyword or network is unstable, try a more specific keyword and retry.
135
+
136
+ ### 4. Error: Failed to save results
137
+ - Check whether `save_dir` provided to AI is a valid absolute path.
138
+ - Confirm your current system user has write permissions for the target directory.
139
+
140
+ ---
141
+
142
+ ## 🧑‍💻 Local Development
143
+
144
+ For developers who want to build on top of this project:
145
+ ```bash
146
+ git clone https://github.com/gecho-ai/bridge.git
147
+ cd bridge
148
+ npm install
149
+ npm run server
150
+ ```
151
+
152
+ **Two-layer architecture:**
153
+ - **Client layer** (`mcp-client.js`): Standard MCP STDIO integration for communication with OpenClaw/Hermes/Trae and tool schema declarations.
154
+ - **Service layer** (`server.js`): Local resident service that communicates with the browser extension over WebSocket and executes scraping plus persistence. (Supports lazy start and only launches when needed.)
155
+
156
+ ## License
157
+
158
+ MIT
package/README.md CHANGED
@@ -1,29 +1,68 @@
1
1
  # Gecho Bridge 🚀
2
2
 
3
- Gecho Bridge is an MCP (Model Context Protocol) server that connects AI Agents (like Claude Desktop, Cursor, or OpenClaw) to TikTok via a Chrome extension. It allows your AI models to search and retrieve TikTok video metadata directly from the browser.
3
+ 🌐 **Gecho Bridge** 是一款通用的 MCPModel Context Protocol)工具,旨在为你的大语言模型(LLM)与本地浏览器之间搭建一座桥梁。
4
+ 安装后,无论是使用 **OpenClaw**、**Hermes** 还是 **Trae**,你的 AI 助手都能直接控制浏览器,自动化完成 TikTok 搜索、数据抓取与深度商机洞察。
4
5
 
5
- ## Features
6
+ ---
6
7
 
7
- - **Automated Search**: Search TikTok with keywords and auto-scroll to fetch results.
8
- - **Data Retrieval**: Get video IDs, titles, like counts, and play URLs.
9
- - **Dual-Layer Architecture**: A lightweight MCP Client that automatically manages a persistent Service Layer.
10
- - **Lazy Start**: The bridge automatically starts the background service when needed.
8
+ ## 适合谁用
11
9
 
12
- ## Installation
10
+ - 📊 **分析竞品**:输入关键词,快速获取 TikTok 前排高赞视频的各项互动数据。
11
+ - 💡 **寻找爆款**:使用深度洞察工具分析特定品类(如 "portable blender")的流行趋势,捕捉未被满足的市场蓝海。
12
+ - 🤖 **自动化运营**:让大模型直接指挥浏览器,自动翻页抓取并生成数据报表,免去繁琐的手动统计。
13
13
 
14
- ### 1. Install via npm
14
+ ## 🚀 能做什么
15
+
16
+ - 自动唤起 Chrome 并在 TikTok 搜索指定关键词,模拟真人自然滚动加载。
17
+ - 抓取海量结构化数据(视频 ID、标题、点赞量、播放链接等)并自动安全落盘为 JSON 文件。
18
+ - 执行基于大数据检索的**异步深度洞察**,智能提炼爆款趋势与潜在商机。
19
+
20
+ ## 🔗 相关链接
21
+
22
+ - **官网**:[https://gecho.ai/](https://gecho.ai/)
23
+ - **ClawHub 插件页**:[https://clawhub.ai/plugins/gecho-bridge](https://clawhub.ai/plugins/gecho-bridge)
24
+ - **Chrome 浏览器扩展**:[前往 Chrome 网上应用店下载](https://chromewebstore.google.com/detail/pjkaeenpekolahdbccjfenjcmanemlbj?utm_source=item-share-cb)
25
+
26
+ ---
27
+
28
+ ## 📦 安装与配置
29
+
30
+ 本项目基于标准 MCP 协议开发,可以无缝接入任何支持 MCP 的 AI 客户端(如 OpenClaw、Hermes、Trae 等)。
31
+
32
+ ### 0. 前置环境要求
33
+ 1. **Node.js**:>= 18(需支持 `npm` / `npx`)。
34
+ 2. **浏览器扩展**:请先[点击此处安装 Gecho 浏览器扩展](https://chromewebstore.google.com/detail/pjkaeenpekolahdbccjfenjcmanemlbj?utm_source=item-share-cb)。
35
+ 3. **网络与状态**:确保本地网络可稳定访问 TikTok,并在浏览器中登录账号,保持扩展在线。
36
+
37
+ ### 方式一:在 OpenClaw 中一键安装 (ClawHub)
38
+ ClawHub 中有两种安装方式:`Skill` 与 `Plugin`。
39
+
40
+ #### 方案 A:Skill 安装(需先配置 MCP)
41
+ Skill 安装后会通过 MCP 调用执行,因此需要先完成以下 MCP 配置:
15
42
  ```bash
16
- npm install -g @gecho-ai/gecho-bridge
43
+ openclaw mcp set gecho-bridge '{"command":"npx","args":["-y","@gecho-ai/gecho-bridge@latest"]}'
44
+ openclaw gateway restart
17
45
  ```
46
+ *配置后,可通过 `openclaw mcp list` 检查状态。*
47
+ *完成 MCP 配置后,再回到 ClawHub 选择 Skill 安装即可。*
18
48
 
19
- ### 2. Install Chrome Extension
20
- Ensure you have the Gecho TikTok Extension installed and active in your Chrome browser. The bridge communicates with this extension via WebSocket.
21
-
22
- ## Configuration
49
+ #### 方案 B:Plugin 安装(推荐)
50
+ ```bash
51
+ openclaw plugins install @gecho-ai/gecho-bridge
52
+ openclaw gateway restart
53
+ ```
54
+ *如需升级已安装的版本,使用 `openclaw plugins update @gecho-ai/gecho-bridge` 即可。*
23
55
 
24
- ### Claude Desktop
25
- Add the following to your `claude_desktop_config.json`:
56
+ ### 方式二:在 Hermes 中一键配置 (Hermes Skill Hub)
57
+ 你可以通过以下命令将服务快捷添加到 Hermes 并重启:
58
+ ```bash
59
+ hermes mcp add gecho-bridge --command npx --args="-y" --args="@gecho-ai/gecho-bridge@latest"
60
+ hermes restart
61
+ ```
62
+ *重启后,可通过 `hermes mcp list` 检查安装状态。*
26
63
 
64
+ ### 方式三:在 Trae / Claude Desktop 等通用客户端配置
65
+ 在支持手动配置的 MCP 客户端中,打开对应的 `mcp.json` 或 `claude_desktop_config.json` 文件,添加如下节点:
27
66
  ```json
28
67
  {
29
68
  "mcpServers": {
@@ -35,75 +74,84 @@ Add the following to your `claude_desktop_config.json`:
35
74
  }
36
75
  ```
37
76
 
38
- ### Cursor
39
- Go to Settings -> MCP.
40
- Add a new MCP server:
41
- - **Name**: gecho-bridge
42
- - **Type**: command
43
- - **Command**: `npx -y @gecho-ai/gecho-bridge@latest`
77
+ ---
44
78
 
45
- ### Save Path Configuration
46
- Search results are persisted to a JSON file. You can control the save directory in two ways:
79
+ ## 🏁 快速开始与常见流程
47
80
 
48
- 1. Pass `save_dir` in the MCP tool call arguments.
49
- 2. Set environment variable `GECHO_DATA_DIR` for the MCP process.
81
+ 环境配置完毕并重启 AI 客户端后,你可以直接通过自然语言向 AI 下达指令。
50
82
 
51
- Priority order used by the service:
83
+ ### 🔍 基础搜索 (`tiktok_search`)
84
+ 适用于快速检索和收集视频数据。
85
+ **你可以这样说:**
86
+ - *"帮我搜索 TikTok 关键词 'portable blender',返回点赞最高的前 10 条"*
87
+ - *"搜索 'cat toy',并把完整结果保存到 /Users/yourname/gecho-data"*
52
88
 
53
- 1. `save_dir` from request arguments
54
- 2. `GECHO_DATA_DIR` environment variable
55
- 3. Default `data` directory (`path.join(__dirname, "..", "data")`)
89
+ **执行流程:**
90
+ 1. AI 唤起本地浏览器的 Gecho 扩展进行搜索和自动滚动。
91
+ 2. 抓取完成后,海量数据会自动落盘到本地。
92
+ 3. AI 会在会话中为你精简总结前 20 条高赞结果。
56
93
 
57
- File naming:
94
+ ### 📈 深度洞察 (`tiktok_insight`)
95
+ 适用于品类调研和趋势分析。
96
+ **你可以这样说:**
97
+ - *"请对 'outdoor picnic mat' 做 tiktok_insight 分析"*
98
+ - *"对比 'desk setup' 和 'minimal desk' 的热视频风格与互动量"*
58
99
 
59
- - Result file pattern: `<query>_search_results.json`
60
- - Query text is sanitized to a safe file name before writing.
100
+ **执行流程:**
101
+ 1. 插件会下发异步洞察任务,并立即返回一个 `jobId`。
102
+ 2. **⚠️ 高危注意**:洞察分析涉及深度抓取和 AI 运算,耗时通常会**超过 5 分钟**。在执行期间,**请务必不要关闭浏览器插件或相关的 TikTok 页面**。
103
+ 3. 等待一段时间后,对 AI 说:*“用 check_insight_status 查询刚才任务的执行状态”* 来获取最终的分析报告。
61
104
 
62
- Example (Claude Desktop with `GECHO_DATA_DIR`):
105
+ ---
63
106
 
64
- ```json
65
- {
66
- "mcpServers": {
67
- "gecho-bridge": {
68
- "command": "npx",
69
- "args": ["-y", "@gecho-ai/gecho-bridge@latest"],
70
- "env": {
71
- "GECHO_DATA_DIR": "/Users/yourname/gecho-data"
72
- }
73
- }
74
- }
75
- }
76
- ```
107
+ ## ⚙️ 存储配置
108
+
109
+ 为了更好地管理数据资产,抓取的海量结果需要落盘保存。插件支持以下优先级配置方式:
110
+
111
+ 1. **会话级(最高优先级)**:直接在对话时让 AI 指定 `save_dir`(必须为绝对路径)。
112
+ 2. **全局级**:配置环境变量 `GECHO_DATA_DIR` 来指定默认的数据保存目录。
113
+ 3. **默认回退**:若未指定,默认保存在工具自带的 `./data` 目录下。
77
114
 
78
- Example (Cursor command with env):
115
+ *(注:所有保存的文件名均会自动进行安全化处理,避免非法字符导致写入失败。)*
79
116
 
117
+ ---
118
+
119
+ ## 🛠️ 排障指南
120
+
121
+ ### 1. 如何确认插件已加载?(以 OpenClaw 为例)
122
+ 执行:
80
123
  ```bash
81
- GECHO_DATA_DIR=/Users/yourname/gecho-data npx -y @gecho-ai/gecho-bridge@latest
124
+ openclaw plugins info @gecho-ai/gecho-bridge
82
125
  ```
126
+ 如果安装成功,你应看到 `Status: loaded` 以及 `MCP servers: gecho-tiktok-search`。
83
127
 
84
- ## Usage
128
+ ### 2. 报错:提示扩展未连接
129
+ - 检查 Chrome 浏览器中的 Gecho 扩展是否已开启。
130
+ - 确认当前浏览器环境中已登录 TikTok 账号,且 TikTok 页面未处于崩溃或无响应状态。
85
131
 
86
- Once configured, you can ask your AI:
132
+ ### 3. 报错:请求超时
133
+ - 检查 TikTok 页面是否弹出了人机验证码(CAPTCHA),如果是,请手动滑动解决。
134
+ - 若目标关键词本身结果极少或网络卡顿,可尝试更换更具体的关键词后重试。
87
135
 
88
- - "Search TikTok for 'cooking recipes'"
89
- - "Find trending TikTok videos about AI agents"
90
- - "Search TikTok for 'computer' and save to `/Users/yourname/data` (`save_dir`)"
136
+ ### 4. 报错:无法保存结果
137
+ - 检查你让 AI 指定的 `save_dir` 是否为合法的绝对路径。
138
+ - 确认当前系统用户是否具有该目标目录的写入权限。
91
139
 
92
- ## Development
140
+ ---
93
141
 
94
- If you want to run the bridge locally from source:
142
+ ## 🧑‍💻 本地开发
95
143
 
144
+ 对于希望基于本工具进行二次开发的开发者:
96
145
  ```bash
97
146
  git clone https://github.com/gecho-ai/bridge.git
98
147
  cd bridge
99
148
  npm install
100
- node mcp-client.js
149
+ npm run server
101
150
  ```
102
151
 
103
- ## Architecture
104
-
105
- - **Service Layer (server.js)**: Maintains the WebSocket connection with the Chrome extension (Port 18792) and exposes an HTTP API (Port 18793).
106
- - **Client Layer (mcp-client.js)**: Implements the MCP Stdio protocol and forwards requests to the Service Layer.
152
+ **双层架构说明:**
153
+ - **Client 层** (`mcp-client.js`):标准 MCP STDIO 接入层,负责与 OpenClaw/Hermes/Trae 等客户端通信,并声明 Tools 规范。
154
+ - **Service 层** (`server.js`):本地常驻服务层,负责与浏览器扩展通过 WebSocket 通信,执行实际抓取与落盘。(支持 Lazy Start 机制,仅在需要时自动拉起)。
107
155
 
108
156
  ## License
109
157