feat: add Weibo channel via mcp-server-weibo (addresses #75)#107
Merged
Panniantong merged 1 commit intoPanniantong:mainfrom Mar 8, 2026
Merged
feat: add Weibo channel via mcp-server-weibo (addresses #75)#107Panniantong merged 1 commit intoPanniantong:mainfrom
Panniantong merged 1 commit intoPanniantong:mainfrom
Conversation
Adds WeiboChannel integrating qinyuanpei/mcp-server-weibo (34+ stars, MIT, 10 tools) via mcporter. Addresses Panniantong#75. Files changed (3 files, +57 lines): - agent_reach/channels/weibo.py — new channel (54 lines) - agent_reach/channels/__init__.py — register WeiboChannel - tests/test_channel_contracts.py — add weibo URL sample
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Weibo (微博) channel that integrates qinyuanpei/mcp-server-weibo (34+ ⭐, MIT license, 10 tools) via mcporter.
This addresses #75 — a user requested Weibo support for monitoring bloggers' new posts.
Why a dedicated channel?
Weibo's mobile API (
m.weibo.cn) is not accessible via curl or Jina Reader:genvisitor2→crossdomain→ set 9 cookies)SUBcookie obtained through this flow is valid for 1 yearThe upstream MCP server (
mcp-server-weibo) wraps this complexity and provides 10 structured tools.Changes
3 files, +57 lines:
agent_reach/channels/weibo.pyagent_reach/channels/__init__.pytests/test_channel_contracts.pyChannel design
can_handle(): matchesweibo.comandweibo.cn(including subdomains likem.weibo.cn,s.weibo.com)check(): two-layer detection:mcporter config list— verify MCP server is configuredmcporter list weibo— verify tools load correctly (lightweight, no live API call)tier=1: requires installingmcp-server-weibobut no paid API key"domain" in dmatching as other channels, samesubprocess.run+mcporterpattern as XiaoHongShu/Douyin/BossZhipin)Upstream MCP server capabilities
mcp-server-weibov1.0.7 provides 10 tools:search_usersget_profileget_feedsget_hot_feedsget_trendingssearch_contentsearch_topicsget_commentsget_followersget_fansInstall:
uvx mcp-server-weiboorpip install mcp-server-weiboTest results
Unit tests: 9/9 passed
E2E tool tests: 10/10 passed
All 10 MCP tools verified with live Weibo API:
Stability test: 8/8 consecutive calls, avg 1.9s/call
Edge cases tested
User flow verified
Known issues in upstream MCP server
These are bugs in
mcp-server-weibo, not in this PR:search_users()has debugprint(result)on line 156 that corrupts MCP stdio transport — causes mcporter to hang. Workaround: remove the print statement. (Will file upstream issue.)get_comments()omitslike_countfield — the raw API returns it but the data mapping drops it. Hot comments require thehotflowendpoint which isn't exposed.KeyError: 'userInfo'instead of returning empty.Cookie notes for overseas users
The MCP server supports
WEIBO_COOKIEenv var. For servers outside mainland China:visitor.passport.weibo.cnflowSUBcookie alone is sufficient and valid for 1 year