feat: add Weibo as default-install channel via Panniantong fork (#118)
- Weibo now auto-installs during 'agent-reach install' (no login needed) - Uses Panniantong/mcp-server-weibo fork with visitor passport auth fix - Works from overseas servers without proxy or cookies - Updated README (CN/EN), install.md, and channel check to point to fork - 10 tools: trending, search content/users/topics, profile, feeds, comments Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
@@ -23,9 +23,9 @@ class WeiboChannel(Channel):
|
||||
return "off", (
|
||||
"需要 mcporter + mcp-server-weibo。安装步骤:\n"
|
||||
" 1. npm install -g mcporter\n"
|
||||
" 2. uvx mcp-server-weibo(或 pip install mcp-server-weibo)\n"
|
||||
" 3. mcporter config add weibo --command 'uvx mcp-server-weibo'\n"
|
||||
" 详见 https://github.com/qinyuanpei/mcp-server-weibo"
|
||||
" 2. pip install git+https://github.com/Panniantong/mcp-server-weibo.git\n"
|
||||
" 3. mcporter config add weibo --command 'mcp-server-weibo'\n"
|
||||
" 详见 https://github.com/Panniantong/mcp-server-weibo"
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
@@ -35,10 +35,8 @@ class WeiboChannel(Channel):
|
||||
if "weibo" not in r.stdout:
|
||||
return "off", (
|
||||
"mcporter 已装但微博 MCP 未配置。运行:\n"
|
||||
" uvx mcp-server-weibo # 或 pip install mcp-server-weibo\n"
|
||||
" mcporter config add weibo --command 'uvx mcp-server-weibo'\n"
|
||||
" # 海外服务器需配置 WEIBO_COOKIE 环境变量,\n"
|
||||
" # 详见 SKILL.md 微博章节"
|
||||
" pip install git+https://github.com/Panniantong/mcp-server-weibo.git\n"
|
||||
" mcporter config add weibo --command 'mcp-server-weibo'"
|
||||
)
|
||||
except Exception:
|
||||
return "off", "mcporter 连接异常"
|
||||
|
||||
@@ -447,10 +447,59 @@ def _install_system_deps():
|
||||
except Exception:
|
||||
print(" -- Could not configure yt-dlp JS runtime (YouTube may not work)")
|
||||
|
||||
# ── Weibo (mcp-server-weibo fork with visitor passport fix) ──
|
||||
_install_weibo_deps()
|
||||
|
||||
# ── WeChat Articles (miku_ai + camoufox + wechat-article-for-ai) ──
|
||||
_install_wechat_deps()
|
||||
|
||||
|
||||
def _install_weibo_deps():
|
||||
"""Install Weibo MCP server (Panniantong fork with visitor passport auth)."""
|
||||
import subprocess
|
||||
|
||||
print("Setting up Weibo MCP server...")
|
||||
|
||||
# Check if already installed and working
|
||||
mcporter = shutil.which("mcporter")
|
||||
if mcporter:
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "config", "list"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=5
|
||||
)
|
||||
if "weibo" in r.stdout:
|
||||
print(" ✅ Weibo MCP already configured")
|
||||
return
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Install from our fork (has visitor passport auth fix)
|
||||
try:
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "pip", "install", "-q",
|
||||
"git+https://github.com/Panniantong/mcp-server-weibo.git"],
|
||||
check=True, timeout=120
|
||||
)
|
||||
print(" ✅ mcp-server-weibo installed (Panniantong fork)")
|
||||
except Exception as e:
|
||||
print(f" [!] mcp-server-weibo install failed: {e}")
|
||||
return
|
||||
|
||||
# Register with mcporter
|
||||
if mcporter:
|
||||
try:
|
||||
subprocess.run(
|
||||
[mcporter, "config", "add", "weibo", "--command", "mcp-server-weibo"],
|
||||
check=True, capture_output=True, timeout=10
|
||||
)
|
||||
print(" ✅ Weibo MCP registered with mcporter")
|
||||
except Exception:
|
||||
print(" [!] mcporter config add failed. Run manually: mcporter config add weibo --command 'mcp-server-weibo'")
|
||||
else:
|
||||
print(" -- mcporter not found, skipping MCP registration. Install mcporter first, then run: mcporter config add weibo --command 'mcp-server-weibo'")
|
||||
|
||||
|
||||
def _install_wechat_deps():
|
||||
"""Install WeChat article reading and search dependencies."""
|
||||
import subprocess
|
||||
|
||||
Reference in New Issue
Block a user