@bsbofmusic/agent-reach-mcp 0.3.1 → 0.4.0
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/README.md +122 -86
- package/index.js +112 -65
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
# Agent-Reach MCP
|
|
2
2
|
|
|
3
|
-
MCP
|
|
3
|
+
> ✅ 导入 MCP 即用 | ✅ 完整能力(exec) | ✅ 自发现(list) | ✅ 自动更新(latest) | ✅ 可诊断(doctor)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
MCP (stdio) server that provides full access to [Agent-Reach](https://github.com/Panniantong/Agent-Reach) for OpenCode / CC-Switch.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
### Quick Start (CC-Switch / OpenCode)
|
|
7
|
+
## 一键启用
|
|
12
8
|
|
|
13
9
|
```json
|
|
14
10
|
{
|
|
@@ -18,58 +14,71 @@ Agent-Reach gives your AI agent eyes to see the entire internet. Read & search T
|
|
|
18
14
|
}
|
|
19
15
|
```
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
## 是什么
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
Agent-Reach 让你的 AI Agent 拥有"互联网之眼"。读取和搜索 Twitter、Reddit、YouTube、GitHub、Bilibili、小红书 — 一个 CLI,零 API 费用。
|
|
20
|
+
|
|
21
|
+
| 平台 | 功能 |
|
|
22
|
+
|------|------|
|
|
23
|
+
| 🌐 网页 | Jina Reader 读取任意网页 |
|
|
24
|
+
| 📺 YouTube | 字幕提取 + 视频搜索 |
|
|
25
|
+
| 🐦 Twitter/X | 读取推文、搜索 |
|
|
26
|
+
| 📖 Reddit | 搜索、读取帖子评论 |
|
|
27
|
+
| 📦 GitHub | 读取公开仓库、搜索 |
|
|
28
|
+
| 📺 Bilibili | 字幕提取 + 搜索 |
|
|
29
|
+
| 📕 小红书 | 搜索、阅读 |
|
|
30
|
+
| 🔍 全网搜索 | Exa AI 语义搜索 |
|
|
27
31
|
|
|
28
|
-
##
|
|
32
|
+
## 5 个核心工具(必须实现)
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
| 工具 | 说明 |
|
|
35
|
+
|------|------|
|
|
36
|
+
| `reach_ensure` | ✅ 准备环境 + 升级到最新 |
|
|
37
|
+
| `reach_doctor` | ✅ 诊断所有平台渠道状态 |
|
|
38
|
+
| `reach_exec` | ✅ 万能入口 - 完美复刻所有功能 |
|
|
39
|
+
| `reach_list_commands` | ✅ 能力自发现 - 列出所有子命令 |
|
|
40
|
+
| `reach_version` | ✅ 输出版本信息 |
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|------|-------------|
|
|
34
|
-
| `reach_ensure` | Ensure venv exists and upgrade Agent-Reach to latest |
|
|
35
|
-
| `reach_doctor` | Diagnose all platform channels status |
|
|
36
|
-
| `reach_version` | Show installed Agent-Reach version |
|
|
37
|
-
| `reach_check_update` | Check if newer version available |
|
|
38
|
-
| `reach_watch` | Quick health check + update check |
|
|
39
|
-
| `reach_list_commands` | List all available subcommands |
|
|
42
|
+
## 完整工具列表
|
|
40
43
|
|
|
41
|
-
###
|
|
44
|
+
### 核心
|
|
42
45
|
|
|
43
|
-
|
|
|
44
|
-
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
46
|
+
| 工具 | 说明 |
|
|
47
|
+
|------|------|
|
|
48
|
+
| `reach_ensure` | 确保 venv 存在并升级到最新 Agent-Reach |
|
|
49
|
+
| `reach_doctor` | 诊断所有平台渠道状态 |
|
|
50
|
+
| `reach_version` | 显示 MCP + Agent-Reach 版本 |
|
|
51
|
+
| `reach_check_update` | 检查 GitHub 是否有新版本 |
|
|
52
|
+
| `reach_watch` | 快速健康检查(适合定时任务) |
|
|
53
|
+
| `reach_list_commands` | 列出所有可用子命令 |
|
|
48
54
|
|
|
49
|
-
###
|
|
55
|
+
### 安装与配置
|
|
50
56
|
|
|
51
|
-
|
|
|
52
|
-
|
|
53
|
-
| `
|
|
57
|
+
| 工具 | 说明 |
|
|
58
|
+
|------|------|
|
|
59
|
+
| `reach_install` | 安装系统依赖(gh CLI, Node.js, bird, mcporter) |
|
|
60
|
+
| `reach_configure` | 设置配置(proxy, token, cookies) |
|
|
61
|
+
| `reach_setup` | 交互式配置向导 |
|
|
54
62
|
|
|
55
|
-
###
|
|
63
|
+
### 读取与搜索
|
|
56
64
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
65
|
+
| 工具 | 说明 |
|
|
66
|
+
|------|------|
|
|
67
|
+
| `reach_read` | 读取任意 URL |
|
|
68
|
+
| `reach_search_twitter` | 搜索 Twitter |
|
|
69
|
+
| `reach_search_xhs` | 搜索小红书 |
|
|
70
|
+
| `reach_search_web` | 全网搜索(Exa) |
|
|
71
|
+
| `reach_search_github` | 搜索 GitHub |
|
|
63
72
|
|
|
64
|
-
###
|
|
73
|
+
### 高级
|
|
65
74
|
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
| `reach_exec` |
|
|
75
|
+
| 工具 | 说明 |
|
|
76
|
+
|------|------|
|
|
77
|
+
| `reach_exec` | 🔧 万能入口 - 执行任意子命令 |
|
|
69
78
|
|
|
70
|
-
##
|
|
79
|
+
## 使用示例
|
|
71
80
|
|
|
72
|
-
###
|
|
81
|
+
### 首次安装
|
|
73
82
|
|
|
74
83
|
```json
|
|
75
84
|
{
|
|
@@ -78,7 +87,7 @@ node index.js
|
|
|
78
87
|
}
|
|
79
88
|
```
|
|
80
89
|
|
|
81
|
-
###
|
|
90
|
+
### 配置 Twitter Cookie
|
|
82
91
|
|
|
83
92
|
```json
|
|
84
93
|
{
|
|
@@ -90,7 +99,7 @@ node index.js
|
|
|
90
99
|
}
|
|
91
100
|
```
|
|
92
101
|
|
|
93
|
-
###
|
|
102
|
+
### 配置代理
|
|
94
103
|
|
|
95
104
|
```json
|
|
96
105
|
{
|
|
@@ -102,7 +111,7 @@ node index.js
|
|
|
102
111
|
}
|
|
103
112
|
```
|
|
104
113
|
|
|
105
|
-
###
|
|
114
|
+
### 读取网页
|
|
106
115
|
|
|
107
116
|
```json
|
|
108
117
|
{
|
|
@@ -111,7 +120,7 @@ node index.js
|
|
|
111
120
|
}
|
|
112
121
|
```
|
|
113
122
|
|
|
114
|
-
###
|
|
123
|
+
### 搜索 Twitter
|
|
115
124
|
|
|
116
125
|
```json
|
|
117
126
|
{
|
|
@@ -120,73 +129,100 @@ node index.js
|
|
|
120
129
|
}
|
|
121
130
|
```
|
|
122
131
|
|
|
123
|
-
###
|
|
132
|
+
### 搜索 GitHub
|
|
124
133
|
|
|
125
134
|
```json
|
|
126
135
|
{
|
|
127
|
-
"name": "
|
|
128
|
-
"arguments": { "query": "
|
|
136
|
+
"name": "reach_search_github",
|
|
137
|
+
"arguments": { "query": "LLM framework", "limit": 10 }
|
|
129
138
|
}
|
|
130
139
|
```
|
|
131
140
|
|
|
132
|
-
###
|
|
141
|
+
### 使用万能入口
|
|
133
142
|
|
|
134
143
|
```json
|
|
135
144
|
{
|
|
136
|
-
"name": "
|
|
137
|
-
"arguments": {
|
|
145
|
+
"name": "reach_exec",
|
|
146
|
+
"arguments": {
|
|
147
|
+
"subcommand": "doctor"
|
|
148
|
+
}
|
|
138
149
|
}
|
|
139
150
|
```
|
|
140
151
|
|
|
141
|
-
##
|
|
152
|
+
## 自动更新策略
|
|
142
153
|
|
|
143
|
-
|
|
144
|
-
- Python 3.10+ (in PATH)
|
|
145
|
-
- Internet access to GitHub
|
|
154
|
+
每次工具调用前自动执行:
|
|
146
155
|
|
|
147
|
-
|
|
156
|
+
1. 创建/复用 Python venv
|
|
157
|
+
2. 执行 `pip install -U https://github.com/Panniantong/agent-reach/archive/main.zip`
|
|
158
|
+
3. 然后运行目标命令
|
|
148
159
|
|
|
149
|
-
|
|
160
|
+
**版本信息:** `reach_version` 显示当前 MCP 版本、Agent-Reach 版本、更新时间。
|
|
150
161
|
|
|
151
|
-
|
|
152
|
-
2. Run `pip install -U https://github.com/Panniantong/agent-reach/archive/main.zip`
|
|
153
|
-
3. Execute the requested `agent-reach ...` command
|
|
154
|
-
4. Return stdout/stderr to the AI
|
|
162
|
+
## 环境要求
|
|
155
163
|
|
|
156
|
-
|
|
164
|
+
- Node.js >= 18
|
|
165
|
+
- Python 3.10+(在 PATH 中)
|
|
166
|
+
- 能访问 GitHub
|
|
167
|
+
|
|
168
|
+
### Venv 位置
|
|
157
169
|
|
|
158
170
|
- Windows: `%LOCALAPPDATA%\agent-reach-mcp\runtime\venv`
|
|
159
171
|
- macOS: `~/Library/Caches/agent-reach-mcp/runtime/venv`
|
|
160
172
|
- Linux: `~/.cache/agent-reach-mcp/runtime/venv`
|
|
161
173
|
|
|
162
|
-
##
|
|
174
|
+
## 平台要求
|
|
163
175
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
176
|
+
| 平台 | 要求 |
|
|
177
|
+
|------|------|
|
|
178
|
+
| Twitter | bird CLI + twitter-cookies |
|
|
179
|
+
| 小红书 | mcporter + docker xiaohongshu-mcp |
|
|
180
|
+
| Reddit | 代理(服务器 IP 被封) |
|
|
181
|
+
| Bilibili | 代理(服务器 IP 被封) |
|
|
182
|
+
| 全网搜索 | 配置 Exa MCP |
|
|
183
|
+
| GitHub | gh CLI(可选,提高速率限制) |
|
|
169
184
|
|
|
170
|
-
##
|
|
185
|
+
## 推荐工作流
|
|
171
186
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
187
|
+
1. **首次安装**: `reach_install` 安装依赖
|
|
188
|
+
2. **配置**: `reach_configure` 配置 Twitter cookies、代理等
|
|
189
|
+
3. **诊断**: `reach_doctor` 检查渠道状态
|
|
190
|
+
4. **发现**: `reach_list_commands` 查看可用命令
|
|
191
|
+
5. **使用**: 使用搜索/读取工具或 `reach_exec`
|
|
192
|
+
|
|
193
|
+
## 验证计划
|
|
194
|
+
|
|
195
|
+
### A. 一键部署验证
|
|
196
|
+
|
|
197
|
+
- [ ] 清空本地缓存(或换一台机器)
|
|
198
|
+
- [ ] 仅通过 CC-Switch 启用 MCP
|
|
199
|
+
- [ ] 重启 OpenCode
|
|
200
|
+
- [ ] 直接调用 `reach_ensure` 成功
|
|
201
|
+
- [ ] 不需要手动安装任何依赖
|
|
180
202
|
|
|
181
|
-
|
|
203
|
+
### B. 完美复刻验证
|
|
182
204
|
|
|
183
|
-
|
|
205
|
+
- [ ] `reach_exec` 能执行至少 5 个核心功能
|
|
206
|
+
- [ ] `reach_list_commands` 输出与原工具 `--help` 一致
|
|
207
|
+
- [ ] 新增功能无需改 MCP 即可通过 exec 使用
|
|
184
208
|
|
|
185
|
-
|
|
209
|
+
### C. 稳定健全验证
|
|
186
210
|
|
|
187
|
-
|
|
211
|
+
- [ ] `reach_doctor` 能定位常见问题
|
|
212
|
+
- [ ] 调用失败返回清晰错误
|
|
213
|
+
- [ ] 超时机制有效
|
|
188
214
|
|
|
189
|
-
|
|
215
|
+
### D. 自动更新验证
|
|
216
|
+
|
|
217
|
+
- [ ] 每次调用前执行 ensureLatest
|
|
218
|
+
- [ ] `reach_version` 能反映 latest 状态
|
|
219
|
+
|
|
220
|
+
## 本地开发
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npm install
|
|
224
|
+
node index.js
|
|
225
|
+
```
|
|
190
226
|
|
|
191
227
|
## License
|
|
192
228
|
|
package/index.js
CHANGED
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
ListToolsRequestSchema,
|
|
12
12
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
13
|
|
|
14
|
-
const VERSION = "0.
|
|
14
|
+
const VERSION = "0.4.0";
|
|
15
|
+
const UPDATE_TIMESTAMP = new Date().toISOString();
|
|
15
16
|
|
|
16
17
|
function isWindows() {
|
|
17
18
|
return process.platform === "win32";
|
|
@@ -121,41 +122,66 @@ async function createVenvIfMissing(root) {
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
async function
|
|
125
|
+
async function getAgentReachVersion(root) {
|
|
126
|
+
const { pythonExe, agentReachExe } = venvPaths(root);
|
|
127
|
+
|
|
128
|
+
if (!existsSync(pythonExe)) {
|
|
129
|
+
return "not installed";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
const versionRes = existsSync(agentReachExe)
|
|
134
|
+
? await run(agentReachExe, ["version"], { timeoutMs: 30000 })
|
|
135
|
+
: await run(pythonExe, ["-m", "agent_reach", "version"], { timeoutMs: 30000 });
|
|
136
|
+
|
|
137
|
+
const output = versionRes.stdout || versionRes.stderr || "";
|
|
138
|
+
const match = output.match(/v?(\d+\.\d+\.\d+)/);
|
|
139
|
+
return match ? match[1] : "unknown";
|
|
140
|
+
} catch {
|
|
141
|
+
return "unknown";
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function ensureLatestAgentReach(root, skipUpdate = false) {
|
|
125
146
|
await createVenvIfMissing(root);
|
|
126
147
|
const { pythonExe, agentReachExe } = venvPaths(root);
|
|
127
148
|
|
|
128
|
-
|
|
129
|
-
pythonExe,
|
|
130
|
-
["-m", "pip", "install", "-U", "pip", "setuptools", "wheel"],
|
|
131
|
-
{ timeoutMs: 5 * 60 * 1000 }
|
|
132
|
-
);
|
|
149
|
+
let ensureLog = "";
|
|
133
150
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
151
|
+
if (!skipUpdate) {
|
|
152
|
+
await run(
|
|
153
|
+
pythonExe,
|
|
154
|
+
["-m", "pip", "install", "-U", "pip", "setuptools", "wheel"],
|
|
155
|
+
{ timeoutMs: 5 * 60 * 1000 }
|
|
156
|
+
);
|
|
140
157
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
158
|
+
const pkgUrl = "https://github.com/Panniantong/agent-reach/archive/main.zip";
|
|
159
|
+
const installRes = await run(
|
|
160
|
+
pythonExe,
|
|
161
|
+
["-m", "pip", "install", "-U", pkgUrl],
|
|
162
|
+
{ timeoutMs: 10 * 60 * 1000 }
|
|
163
|
+
);
|
|
144
164
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
165
|
+
ensureLog = `pip install -U ${pkgUrl}\nexit=${installRes.code}\n`;
|
|
166
|
+
if (installRes.stdout.trim()) ensureLog += `stdout:\n${installRes.stdout}\n`;
|
|
167
|
+
if (installRes.stderr.trim()) ensureLog += `stderr:\n${installRes.stderr}\n`;
|
|
148
168
|
|
|
149
|
-
|
|
150
|
-
|
|
169
|
+
if (installRes.code !== 0) {
|
|
170
|
+
throw new Error(`Failed to install/upgrade Agent-Reach.\n\n${ensureLog}`);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (!existsSync(agentReachExe)) {
|
|
174
|
+
ensureLog += `warning: agent-reach executable not found at ${agentReachExe}\n`;
|
|
175
|
+
}
|
|
151
176
|
}
|
|
152
177
|
|
|
153
|
-
return { pythonExe, agentReachExe, ensureLog
|
|
178
|
+
return { pythonExe, agentReachExe, ensureLog };
|
|
154
179
|
}
|
|
155
180
|
|
|
156
181
|
async function runAgentReach(root, args, extraOpts = {}) {
|
|
157
182
|
const { pythonExe, agentReachExe, ensureLog } = await ensureLatestAgentReach(
|
|
158
|
-
root
|
|
183
|
+
root,
|
|
184
|
+
extraOpts.skipUpdate
|
|
159
185
|
);
|
|
160
186
|
|
|
161
187
|
const timeoutMs = extraOpts.timeoutMs ?? 10 * 60 * 1000;
|
|
@@ -167,7 +193,10 @@ async function runAgentReach(root, args, extraOpts = {}) {
|
|
|
167
193
|
execRes = await run(pythonExe, ["-m", "agent_reach", ...args], { timeoutMs });
|
|
168
194
|
}
|
|
169
195
|
|
|
170
|
-
let out =
|
|
196
|
+
let out = "";
|
|
197
|
+
if (ensureLog) {
|
|
198
|
+
out += `# ensure_latest\n${ensureLog}\n`;
|
|
199
|
+
}
|
|
171
200
|
out += `# agent-reach ${args.join(" ")}\nexit=${execRes.code}\n`;
|
|
172
201
|
if (execRes.stdout.trim()) out += `stdout:\n${execRes.stdout}\n`;
|
|
173
202
|
if (execRes.stderr.trim()) out += `stderr:\n${execRes.stderr}\n`;
|
|
@@ -217,37 +246,37 @@ async function main() {
|
|
|
217
246
|
{
|
|
218
247
|
name: "reach_ensure",
|
|
219
248
|
description:
|
|
220
|
-
"
|
|
249
|
+
"✅ 准备环境 + 升级到最新 Agent-Reach。幂等操作,返回完整安装日志。",
|
|
221
250
|
inputSchema: { type: "object", properties: {} },
|
|
222
251
|
},
|
|
223
252
|
{
|
|
224
253
|
name: "reach_doctor",
|
|
225
254
|
description:
|
|
226
|
-
"
|
|
255
|
+
"✅ 诊断所有平台渠道状态(Twitter, YouTube, Reddit, GitHub, Bilibili, XiaoHongShu 等)。自动更新后再诊断。",
|
|
227
256
|
inputSchema: { type: "object", properties: {} },
|
|
228
257
|
},
|
|
229
258
|
{
|
|
230
259
|
name: "reach_version",
|
|
231
260
|
description:
|
|
232
|
-
"
|
|
261
|
+
"✅ 输出版本信息:MCP 版本、Agent-Reach 版本、更新时间。",
|
|
233
262
|
inputSchema: { type: "object", properties: {} },
|
|
234
263
|
},
|
|
235
264
|
{
|
|
236
265
|
name: "reach_check_update",
|
|
237
266
|
description:
|
|
238
|
-
"
|
|
267
|
+
"检查 GitHub 是否有新版本可用。",
|
|
239
268
|
inputSchema: { type: "object", properties: {} },
|
|
240
269
|
},
|
|
241
270
|
{
|
|
242
271
|
name: "reach_watch",
|
|
243
272
|
description:
|
|
244
|
-
"
|
|
273
|
+
"快速健康检查 + 更新检查(适合定时任务)。",
|
|
245
274
|
inputSchema: { type: "object", properties: {} },
|
|
246
275
|
},
|
|
247
276
|
{
|
|
248
277
|
name: "reach_install",
|
|
249
278
|
description:
|
|
250
|
-
"
|
|
279
|
+
"安装系统依赖(gh CLI, Node.js, bird, mcporter)。支持 --env, --proxy, --safe, --dry-run。",
|
|
251
280
|
inputSchema: {
|
|
252
281
|
type: "object",
|
|
253
282
|
properties: {
|
|
@@ -255,21 +284,21 @@ async function main() {
|
|
|
255
284
|
type: "string",
|
|
256
285
|
enum: ["auto", "local", "server"],
|
|
257
286
|
default: "auto",
|
|
258
|
-
description: "
|
|
287
|
+
description: "环境类型",
|
|
259
288
|
},
|
|
260
289
|
proxy: {
|
|
261
290
|
type: "string",
|
|
262
|
-
description: "
|
|
291
|
+
description: "Reddit/Bilibili 住宅代理 (http://user:pass@ip:port)",
|
|
263
292
|
},
|
|
264
293
|
safe: {
|
|
265
294
|
type: "boolean",
|
|
266
295
|
default: false,
|
|
267
|
-
description: "
|
|
296
|
+
description: "安全模式:跳过自动系统变更",
|
|
268
297
|
},
|
|
269
298
|
dryRun: {
|
|
270
299
|
type: "boolean",
|
|
271
300
|
default: false,
|
|
272
|
-
description: "
|
|
301
|
+
description: "仅预览将执行的操作,不做实际变更",
|
|
273
302
|
},
|
|
274
303
|
},
|
|
275
304
|
},
|
|
@@ -277,7 +306,7 @@ async function main() {
|
|
|
277
306
|
{
|
|
278
307
|
name: "reach_configure",
|
|
279
308
|
description:
|
|
280
|
-
"
|
|
309
|
+
"设置配置值(proxy, github-token, groq-key, twitter-cookies, youtube-cookies)或从浏览器自动提取 cookie。",
|
|
281
310
|
inputSchema: {
|
|
282
311
|
type: "object",
|
|
283
312
|
properties: {
|
|
@@ -290,16 +319,16 @@ async function main() {
|
|
|
290
319
|
"twitter-cookies",
|
|
291
320
|
"youtube-cookies",
|
|
292
321
|
],
|
|
293
|
-
description: "
|
|
322
|
+
description: "配置键名",
|
|
294
323
|
},
|
|
295
324
|
value: {
|
|
296
325
|
type: "string",
|
|
297
|
-
description: "
|
|
326
|
+
description: "要设置的值(twitter-cookies 使用 cookie 字符串)",
|
|
298
327
|
},
|
|
299
328
|
fromBrowser: {
|
|
300
329
|
type: "string",
|
|
301
330
|
enum: ["chrome", "firefox", "edge", "brave", "opera"],
|
|
302
|
-
description: "
|
|
331
|
+
description: "从浏览器自动提取 cookie",
|
|
303
332
|
},
|
|
304
333
|
},
|
|
305
334
|
},
|
|
@@ -307,20 +336,20 @@ async function main() {
|
|
|
307
336
|
{
|
|
308
337
|
name: "reach_setup",
|
|
309
338
|
description:
|
|
310
|
-
"
|
|
339
|
+
"交互式配置向导(API keys、代理等)。",
|
|
311
340
|
inputSchema: { type: "object", properties: {} },
|
|
312
341
|
},
|
|
313
342
|
{
|
|
314
343
|
name: "reach_read",
|
|
315
344
|
description:
|
|
316
|
-
"
|
|
345
|
+
"读取任意 URL(网页、YouTube、GitHub、Bilibili 等)。自动更新后再执行。",
|
|
317
346
|
inputSchema: {
|
|
318
347
|
type: "object",
|
|
319
348
|
properties: {
|
|
320
349
|
url: {
|
|
321
350
|
type: "string",
|
|
322
351
|
description:
|
|
323
|
-
"URL
|
|
352
|
+
"要读取的 URL (http/https)。支持:网页、YouTube、GitHub、Bilibili 等。",
|
|
324
353
|
},
|
|
325
354
|
},
|
|
326
355
|
required: ["url"],
|
|
@@ -329,15 +358,15 @@ async function main() {
|
|
|
329
358
|
{
|
|
330
359
|
name: "reach_search_twitter",
|
|
331
360
|
description:
|
|
332
|
-
"
|
|
361
|
+
"搜索 Twitter/X(需要通过 reach_configure 配置 twitter-cookies)。",
|
|
333
362
|
inputSchema: {
|
|
334
363
|
type: "object",
|
|
335
364
|
properties: {
|
|
336
|
-
query: { type: "string", description: "
|
|
365
|
+
query: { type: "string", description: "搜索关键词" },
|
|
337
366
|
limit: {
|
|
338
367
|
type: "number",
|
|
339
368
|
default: 10,
|
|
340
|
-
description: "
|
|
369
|
+
description: "结果数量",
|
|
341
370
|
},
|
|
342
371
|
},
|
|
343
372
|
required: ["query"],
|
|
@@ -346,15 +375,15 @@ async function main() {
|
|
|
346
375
|
{
|
|
347
376
|
name: "reach_search_xhs",
|
|
348
377
|
description:
|
|
349
|
-
"
|
|
378
|
+
"搜索小红书(需要 mcporter + xiaohongshu-mcp docker 运行)。",
|
|
350
379
|
inputSchema: {
|
|
351
380
|
type: "object",
|
|
352
381
|
properties: {
|
|
353
|
-
query: { type: "string", description: "
|
|
382
|
+
query: { type: "string", description: "搜索关键词(支持中文)" },
|
|
354
383
|
limit: {
|
|
355
384
|
type: "number",
|
|
356
385
|
default: 10,
|
|
357
|
-
description: "
|
|
386
|
+
description: "结果数量",
|
|
358
387
|
},
|
|
359
388
|
},
|
|
360
389
|
required: ["query"],
|
|
@@ -363,15 +392,15 @@ async function main() {
|
|
|
363
392
|
{
|
|
364
393
|
name: "reach_search_web",
|
|
365
394
|
description:
|
|
366
|
-
"
|
|
395
|
+
"全网搜索(使用 Exa,免费 1000 次/月)。需要配置 Exa MCP。",
|
|
367
396
|
inputSchema: {
|
|
368
397
|
type: "object",
|
|
369
398
|
properties: {
|
|
370
|
-
query: { type: "string", description: "
|
|
399
|
+
query: { type: "string", description: "搜索关键词" },
|
|
371
400
|
limit: {
|
|
372
401
|
type: "number",
|
|
373
402
|
default: 10,
|
|
374
|
-
description: "
|
|
403
|
+
description: "结果数量",
|
|
375
404
|
},
|
|
376
405
|
},
|
|
377
406
|
required: ["query"],
|
|
@@ -380,15 +409,15 @@ async function main() {
|
|
|
380
409
|
{
|
|
381
410
|
name: "reach_search_github",
|
|
382
411
|
description:
|
|
383
|
-
"
|
|
412
|
+
"搜索 GitHub 仓库(使用 gh CLI)。",
|
|
384
413
|
inputSchema: {
|
|
385
414
|
type: "object",
|
|
386
415
|
properties: {
|
|
387
|
-
query: { type: "string", description: "
|
|
416
|
+
query: { type: "string", description: "搜索关键词" },
|
|
388
417
|
limit: {
|
|
389
418
|
type: "number",
|
|
390
419
|
default: 10,
|
|
391
|
-
description: "
|
|
420
|
+
description: "结果数量",
|
|
392
421
|
},
|
|
393
422
|
},
|
|
394
423
|
required: ["query"],
|
|
@@ -397,24 +426,28 @@ async function main() {
|
|
|
397
426
|
{
|
|
398
427
|
name: "reach_exec",
|
|
399
428
|
description:
|
|
400
|
-
"
|
|
429
|
+
"🔧 万能入口 - 执行任意 Agent-Reach 子命令。完美复刻所有功能,继承未来新增命令。",
|
|
401
430
|
inputSchema: {
|
|
402
431
|
type: "object",
|
|
403
432
|
properties: {
|
|
404
433
|
subcommand: {
|
|
405
434
|
type: "string",
|
|
406
435
|
description:
|
|
407
|
-
"Agent-Reach
|
|
436
|
+
"Agent-Reach 子命令名(如:install, configure, doctor, version, check-update, watch, setup, read 等)",
|
|
408
437
|
},
|
|
409
438
|
args: {
|
|
410
439
|
type: "array",
|
|
411
440
|
items: { type: "string" },
|
|
412
|
-
description: "
|
|
441
|
+
description: "传递给子命令的参数",
|
|
413
442
|
},
|
|
414
443
|
timeoutMs: {
|
|
415
444
|
type: "number",
|
|
416
|
-
description:
|
|
417
|
-
|
|
445
|
+
description: "超时时间(毫秒),默认约 10 分钟",
|
|
446
|
+
},
|
|
447
|
+
skipUpdate: {
|
|
448
|
+
type: "boolean",
|
|
449
|
+
default: false,
|
|
450
|
+
description: "跳过自动更新(仅执行命令,不升级)",
|
|
418
451
|
},
|
|
419
452
|
},
|
|
420
453
|
required: ["subcommand"],
|
|
@@ -423,7 +456,7 @@ async function main() {
|
|
|
423
456
|
{
|
|
424
457
|
name: "reach_list_commands",
|
|
425
458
|
description:
|
|
426
|
-
"
|
|
459
|
+
"📋 能力自发现 - 列出所有可用子命令。通过解析 agent-reach --help 实现。自动更新后再执行。",
|
|
427
460
|
inputSchema: { type: "object", properties: {} },
|
|
428
461
|
},
|
|
429
462
|
],
|
|
@@ -446,17 +479,29 @@ async function main() {
|
|
|
446
479
|
}
|
|
447
480
|
|
|
448
481
|
if (name === "reach_version") {
|
|
449
|
-
const
|
|
450
|
-
|
|
482
|
+
const agentVersion = await getAgentReachVersion(runtimeRoot);
|
|
483
|
+
const output = [
|
|
484
|
+
"=== Agent-Reach MCP Version Info ===",
|
|
485
|
+
`MCP Version: ${VERSION}`,
|
|
486
|
+
`Agent-Reach Version: ${agentVersion}`,
|
|
487
|
+
`Last Update Check: ${UPDATE_TIMESTAMP}`,
|
|
488
|
+
`Update Strategy: Always Latest (main branch)`,
|
|
489
|
+
"",
|
|
490
|
+
"Usage:",
|
|
491
|
+
" - reach_ensure: Upgrade to latest",
|
|
492
|
+
" - reach_check_update: Check for newer version",
|
|
493
|
+
" - reach_doctor: Diagnose platform channels",
|
|
494
|
+
].join("\n");
|
|
495
|
+
return { content: text(output) };
|
|
451
496
|
}
|
|
452
497
|
|
|
453
498
|
if (name === "reach_check_update") {
|
|
454
|
-
const { out, code } = await runAgentReach(runtimeRoot, ["check-update"]);
|
|
499
|
+
const { out, code } = await runAgentReach(runtimeRoot, ["check-update"], { skipUpdate: true });
|
|
455
500
|
return { content: text(out), isError: code !== 0 };
|
|
456
501
|
}
|
|
457
502
|
|
|
458
503
|
if (name === "reach_watch") {
|
|
459
|
-
const { out, code } = await runAgentReach(runtimeRoot, ["watch"]);
|
|
504
|
+
const { out, code } = await runAgentReach(runtimeRoot, ["watch"], { skipUpdate: true });
|
|
460
505
|
return { content: text(out), isError: code !== 0 };
|
|
461
506
|
}
|
|
462
507
|
|
|
@@ -556,6 +601,7 @@ async function main() {
|
|
|
556
601
|
typeof input.timeoutMs === "number" && input.timeoutMs > 0
|
|
557
602
|
? Math.floor(input.timeoutMs)
|
|
558
603
|
: 10 * 60 * 1000;
|
|
604
|
+
const skipUpdate = Boolean(input.skipUpdate);
|
|
559
605
|
|
|
560
606
|
if (!subcommand) {
|
|
561
607
|
return {
|
|
@@ -574,7 +620,7 @@ async function main() {
|
|
|
574
620
|
const { out, code } = await runAgentReach(
|
|
575
621
|
runtimeRoot,
|
|
576
622
|
[subcommand, ...args],
|
|
577
|
-
{ timeoutMs }
|
|
623
|
+
{ timeoutMs, skipUpdate }
|
|
578
624
|
);
|
|
579
625
|
return { content: text(out), isError: code !== 0 };
|
|
580
626
|
}
|
|
@@ -588,11 +634,12 @@ async function main() {
|
|
|
588
634
|
const commands = parseCommandsFromHelp(helpText);
|
|
589
635
|
|
|
590
636
|
const payload = [
|
|
591
|
-
"#
|
|
637
|
+
"# Available Commands",
|
|
592
638
|
commands.length
|
|
593
639
|
? commands.join("\n")
|
|
594
640
|
: "(no commands parsed; see help output below)",
|
|
595
641
|
"",
|
|
642
|
+
"--- Full Help Output ---",
|
|
596
643
|
out,
|
|
597
644
|
].join("\n");
|
|
598
645
|
|