Agent Reach
Install and configure upstream tools for 13+ platforms. After setup, call them directly — no wrapper layer.
⚠️ Workspace Rules
Never create files, clone repos, or write output in the agent workspace. Use these directories instead:
| Purpose | Directory |
|---|
| Temporary output (subtitles, downloads) | INLINECODE0 |
| Upstream tool repos |
~/.agent-reach/tools/ |
| Config & tokens |
~/.agent-reach/ |
Violating this will pollute the user's workspace and degrade their agent experience over time.
Setup
CODEBLOCK0
INLINECODE3 auto-detects your environment and installs core dependencies (Node.js, mcporter, xreach CLI, gh CLI, yt-dlp, feedparser). Run doctor to see what's active.
Management
CODEBLOCK1
Configure channels
CODEBLOCK2
Configuring a channel ("帮我配 XXX")
When a user asks to configure/enable any channel:
- 1. Run INLINECODE5
- Find the channel — it shows status (✅/⚠️/⬜) and what to do next
- Execute what you can automatically (install packages, start services)
- For human-required steps (paste cookies), tell the user what to do
- Run
agent-reach doctor again to verify
Do NOT memorize per-channel steps. Always rely on doctor output.
Cookie 导入(所有需要登录的平台通用)
⚠️ 重要提醒: 使用 Cookie 登录的平台存在封号风险,请提醒用户务必使用专用小号。
所有需要 Cookie 的平台(Twitter、小红书等),优先使用 Cookie-Editor 导入:
- 1. 用户在自己的浏览器登录对应平台
- 安装 Cookie-Editor Chrome 插件
- 点击插件 → Export → Header String
- 把导出的字符串发给 Agent
本地电脑用户也可以用 agent-reach configure --from-browser chrome 一键自动提取。
扫码登录是备选方案(仅限本地有浏览器的情况),Cookie-Editor 更简单可靠。
Other human actions
- - Proxy: Reddit/Bilibili/XiaoHongShu may block server IPs — suggest a residential proxy if on a server
Using Upstream Tools Directly
After agent-reach install, call the upstream tools directly.
Note: agent-reach is an installer and config tool — it does NOT have read, search, or content-fetching commands. Use the upstream tools below instead.
Twitter/X (xreach CLI)
CODEBLOCK3
YouTube (yt-dlp)
⚠️ yt-dlp 需要 JS runtime 才能下载 YouTube。agent-reach install 会自动配置 Node.js 作为 runtime。
如果遇到 "Sign in to confirm you're not a bot",是 IP 被 YouTube 反爬,换代理或加 cookies。
CODEBLOCK4
Bilibili (yt-dlp)
⚠️ 服务器 IP 可能被 Bilibili 拦截(412 错误)。建议通过代理访问,或加 --cookies-from-browser chrome。
CODEBLOCK5
Reddit (JSON API)
CODEBLOCK6
Note: On servers, Reddit may block your IP. Use proxy or search via Exa instead.
小红书 / XiaoHongShu (mcporter + xiaohongshu-mcp)
⚠️ 需要登录。使用 Cookie-Editor 导入 cookies 或扫码登录。
CODEBLOCK7
其他功能(点赞、收藏、评论、用户主页等): INLINECODE15
抖音 / Douyin (mcporter + douyin-mcp-server)
CODEBLOCK8
无需登录即可解析视频。支持抖音分享链接和直接链接。
GitHub (gh CLI)
CODEBLOCK9
Web — Any URL (Jina Reader)
CODEBLOCK10
Exa Search (mcporter + exa MCP)
CODEBLOCK11
LinkedIn (mcporter + linkedin-scraper-mcp)
CODEBLOCK12
Fallback: INLINECODE16
Boss直聘 (mcporter + mcp-bosszp)
CODEBLOCK13
Fallback: INLINECODE17
微信公众号 (wechat-article-for-ai + miku_ai)
Search (miku_ai — Sogou WeChat search):
CODEBLOCK14
Read (Camoufox — stealth Firefox, bypasses WeChat anti-bot):
CODEBLOCK15
Typical agent workflow: search → get URLs → immediately read full content.
Note: WeChat articles require a real browser to render. Jina Reader and curl cannot read them.
RSS (feedparser)
CODEBLOCK16
Troubleshooting
Twitter "fetch failed"
xreach CLI uses Node.js undici, which doesn't respect HTTP_PROXY. Solutions:
- 1. Ensure
undici is installed: INLINECODE21 - Configure proxy: INLINECODE22
- If still failing, use transparent proxy (Clash TUN, Proxifier)
Channel broken?
Run agent-reach doctor — it shows what's wrong and how to fix it.
Agent Reach
为 13+ 平台安装和配置上游工具。配置完成后,可直接调用这些工具——无需封装层。
⚠️ 工作区规则
切勿在 Agent 工作区内创建文件、克隆仓库或写入输出内容。 请使用以下目录:
| 用途 | 目录 |
|---|
| 临时输出(字幕、下载文件) | /tmp/ |
| 上游工具仓库 |
~/.agent-reach/tools/ |
| 配置和令牌 | ~/.agent-reach/ |
违反此规则会污染用户的工作区,并逐渐降低 Agent 的使用体验。
安装
bash
pip install https://github.com/Panniantong/agent-reach/archive/main.zip
agent-reach install --env=auto
agent-reach doctor
install 会自动检测你的环境并安装核心依赖(Node.js、mcporter、xreach CLI、gh CLI、yt-dlp、feedparser)。运行 doctor 查看已激活的组件。
管理
bash
agent-reach doctor # 渠道状态概览
agent-reach watch # 快速健康检查 + 更新检查
agent-reach check-update # 检查新版本
配置渠道
bash
agent-reach configure twitter-cookies auth_token=xxx; ct0=yyy
agent-reach configure proxy http://user:pass@ip:port
agent-reach configure --from-browser chrome # 从本地浏览器自动提取 Cookie
配置渠道(帮我配 XXX)
当用户要求配置/启用某个渠道时:
- 1. 运行 agent-reach doctor
- 找到该渠道——它会显示状态(✅/⚠️/⬜)以及下一步操作
- 自动执行你能完成的操作(安装包、启动服务)
- 对于需要人工操作的步骤(粘贴 Cookie),告知用户具体操作
- 再次运行 agent-reach doctor 进行验证
不要记忆每个渠道的具体步骤。 始终依赖 doctor 的输出。
Cookie 导入(所有需要登录的平台通用)
⚠️ 重要提醒: 使用 Cookie 登录的平台存在封号风险,请提醒用户务必使用专用小号。
所有需要 Cookie 的平台(Twitter、小红书等),优先使用 Cookie-Editor 导入:
- 1. 用户在自己的浏览器登录对应平台
- 安装 Cookie-Editor Chrome 插件
- 点击插件 → Export → Header String
- 把导出的字符串发给 Agent
本地电脑用户也可以用 agent-reach configure --from-browser chrome 一键自动提取。
扫码登录是备选方案(仅限本地有浏览器的情况),Cookie-Editor 更简单可靠。
其他人工操作
- - 代理: Reddit/Bilibili/小红书可能会屏蔽服务器 IP——如果在服务器上运行,建议使用住宅代理
直接使用上游工具
agent-reach install 完成后,可直接调用上游工具。
注意: agent-reach 是安装和配置工具——它没有 read、search 或内容获取命令。请使用下面的上游工具。
Twitter/X(xreach CLI)
bash
搜索推文
xreach search query --json -n 10
读取特定推文
xreach tweet https://x.com/user/status/123 --json
读取用户时间线
xreach tweets @username --json -n 20
YouTube(yt-dlp)
⚠️ yt-dlp 需要 JS runtime 才能下载 YouTube。agent-reach install 会自动配置 Node.js 作为 runtime。
如果遇到 Sign in to confirm youre not a bot,是 IP 被 YouTube 反爬,换代理或加 cookies。
bash
获取视频元数据
yt-dlp --dump-json https://www.youtube.com/watch?v=xxx
仅下载字幕
yt-dlp --write-sub --write-auto-sub --sub-lang zh-Hans,zh,en --skip-download -o /tmp/%(id)s URL
然后读取 .vtt 文件
搜索(yt-dlp ytsearch)
yt-dlp --dump-json ytsearch5:query
如果出现 no JS runtime 警告:确保已安装 Node.js,然后运行:
mkdir -p ~/.config/yt-dlp && echo --js-runtimes node >> ~/.config/yt-dlp/config
Bilibili(yt-dlp)
⚠️ 服务器 IP 可能被 Bilibili 拦截(412 错误)。建议通过代理访问,或加 --cookies-from-browser chrome。
bash
获取视频元数据
yt-dlp --dump-json https://www.bilibili.com/video/BVxxx
下载字幕
yt-dlp --write-sub --write-auto-sub --sub-lang zh-Hans,zh,en --convert-subs vtt --skip-download -o /tmp/%(id)s URL
如果被拦截(412 / 需要登录):
yt-dlp --cookies-from-browser chrome --dump-json URL
Reddit(JSON API)
bash
读取子版块
curl -s https://www.reddit.com/r/python/hot.json?limit=10 -H User-Agent: agent-reach/1.0
读取带评论的帖子
curl -s https://www.reddit.com/r/python/comments/POST_ID.json -H User-Agent: agent-reach/1.0
搜索
curl -s https://www.reddit.com/search.json?q=query&limit=10 -H User-Agent: agent-reach/1.0
注意:在服务器上,Reddit 可能会屏蔽你的 IP。请使用代理或通过 Exa 搜索。
小红书 / XiaoHongShu(mcporter + xiaohongshu-mcp)
⚠️ 需要登录。使用 Cookie-Editor 导入 cookies 或扫码登录。
bash
搜索笔记
mcporter call xiaohongshu.search_feeds(keyword: query)
获取笔记详情(含评论)
mcporter call xiaohongshu.get
feeddetail(feed
id: xxx, xsectoken: yyy)
获取全部评论
mcporter call xiaohongshu.get
feeddetail(feed
id: xxx, xsectoken: yyy, load
allcomments: true)
发布图文笔记
mcporter call xiaohongshu.publish_content(title: 标题, content: 正文, images: [/path/to/img.jpg], tags: [美食])
发布视频笔记
mcporter call xiaohongshu.publish
withvideo(title: 标题, content: 正文, video: /path/to/video.mp4, tags: [vlog])
其他功能(点赞、收藏、评论、用户主页等):npx mcporter list xiaohongshu
抖音 / Douyin(mcporter + douyin-mcp-server)
bash
解析抖音视频信息(分享链接 → 标题、作者、无水印视频URL等)
mcporter call douyin.parse
douyinvideo
info(sharelink: https://v.douyin.com/xxx/)
获取无水印视频下载链接
mcporter call douyin.get
douyindownload
link(sharelink: https://v.douyin.com/xxx/)
AI 提取视频语音文案(需要配置硅基流动 API Key)
mcporter call douyin.extract
douyintext(share_link: https://v.douyin.com/xxx/)
无需登录即可解析视频。支持抖音分享链接和直接链接。
GitHub(gh CLI)
bash
搜索仓库
gh search repos query --sort stars --limit 10
查看仓库
gh repo view owner/repo
搜索代码
gh search code query --language python
列出 Issue
gh issue list -R owner/repo --state open
查看特定 Issue/PR
gh issue view 123 -R owner/repo
网页——任意 URL(Jina Reader)
bash
以 Markdown 格式读取任意网页
curl -s https://r.jina.ai/URL -H Accept: text/markdown
搜索网页
curl -s https://s.jina.ai/query -H Accept: text/markdown
Exa 搜索(mcporter + exa MCP)
bash
网页搜索
mcporter call exa.web
searchexa(query: query, numResults: 5