Agent-Reach/agent_reach/channels/__init__.py
AICodeLion db20c5d5d3
feat: add Weibo channel via mcp-server-weibo (#107)
Adds WeiboChannel integrating qinyuanpei/mcp-server-weibo (34+ stars,
MIT, 10 tools) via mcporter. Addresses #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

Co-authored-by: AICodeLion <AICodeLion@users.noreply.github.com>
2026-03-08 21:54:35 +08:00

62 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
"""
Channel registry — lists all supported platforms for doctor checks.
"""
from typing import List, Optional
from .base import Channel
# Import all channels
from .web import WebChannel
from .github import GitHubChannel
from .twitter import TwitterChannel
from .youtube import YouTubeChannel
from .reddit import RedditChannel
from .rss import RSSChannel
from .bilibili import BilibiliChannel
from .exa_search import ExaSearchChannel
from .xiaohongshu import XiaoHongShuChannel
from .douyin import DouyinChannel
from .linkedin import LinkedInChannel
from .bosszhipin import BossZhipinChannel
from .wechat import WeChatChannel
from .weibo import WeiboChannel
# Channel registry
ALL_CHANNELS: List[Channel] = [
GitHubChannel(),
TwitterChannel(),
YouTubeChannel(),
RedditChannel(),
BilibiliChannel(),
XiaoHongShuChannel(),
DouyinChannel(),
LinkedInChannel(),
BossZhipinChannel(),
WeChatChannel(),
WeiboChannel(),
RSSChannel(),
ExaSearchChannel(),
WebChannel(),
]
def get_channel(name: str) -> Optional[Channel]:
"""Get a channel by name."""
for ch in ALL_CHANNELS:
if ch.name == name:
return ch
return None
def get_all_channels() -> List[Channel]:
"""Get all registered channels."""
return ALL_CHANNELS
__all__ = [
"Channel",
"ALL_CHANNELS",
"get_channel", "get_all_channels",
]