mcp server
social-agent
๐ค AI-powered social media operations framework โ automated content creation, cross-platform publishing, trending monitor & analytics for Chinese social platforms
Set up
Runs on your computer. Pick your agent and operating system.
Before you start
- uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
{
"mcpServers": {
"social-agent": {
"command": "uvx",
"args": [
"social-agent"
]
}
}
}same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12
Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs
README
synced Oct 21, 2026Social Agent
AI-Powered Social Media Operations Framework
Monitor, create, distribute, and analyze social media content across platforms โ all powered by AI.
English | ไธญๆ
What is Social Agent?
Social Agent is an open-source AI framework that automates social media operations across Chinese social platforms. It integrates LLM-powered content generation, multi-platform publishing, trending monitoring, and performance analytics into one unified framework.
Core idea: Write once, publish everywhere. Let AI handle the heavy lifting.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Social Agent โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โ
โ โ Monitor โ โ Generate โ โ Analyze โ โ
โ โ Trending โโโโ Content โโโโ Performance โ โ
โ โโโโโโฌโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโ โ
โ โ Plugin System โ โ
โ โ โโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโ โโโโโโโโโโโโโ โ โ
โ โ โ Weibo โ โ Xiaohu โ โDouyin โ โ Bilibili โ โ โ
โ โ โ ๅพฎๅ โ โ ๅฐ็บขไนฆ โ โ ๆ้ณ โ โ B็ซ โ โ โ
โ โ โโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโ โโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LLM Layer: OpenAI | Claude | Qwen | GLM | Ollamaโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Features
- ๐ฅ Trending Monitor โ Real-time trending topics from Weibo, Xiaohongshu, Douyin, Bilibili
- โ๏ธ AI Content Generation โ Generate platform-specific content with style adaptation
- ๐ค Multi-Platform Publishing โ Create once, publish to multiple platforms
- ๐ Content Search โ Search across platforms in one unified interface
- ๐ Performance Analytics โ Track and analyze your social media performance
- โฐ Scheduled Workflows โ Cron-based task scheduling for automated operations
- ๐ Plugin System โ Extensible architecture, community plugins welcome
- ๐ค Multi-LLM Support โ OpenAI, Claude, Qwen, GLM, Ollama, and more
Quick Start
Installation
# Clone the repo
git clone https://github.com/zouyongfu/social-agent.git
cd social-agent
# Install with Weibo support (default)
pip install -e .
# Install with specific platform support
pip install -e ".[weibo]" # Weibo
pip install -e ".[xiaohongshu]" # Xiaohongshu
pip install -e ".[bilibili]" # Bilibili
pip install -e ".[all]" # All platforms
# For development
pip install -e ".[dev]"
Configuration
Copy the example env file and fill in your credentials:
cp .env.example .env
Edit .env:
# LLM Provider (openai / claude / dashscope / zhipu / ollama)
LLM_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here
# Or use free Chinese alternatives:
# LLM_PROVIDER=dashscope
# DASHSCOPE_API_KEY=sk-your-key-here
# Weibo cookie (required for reading trending + publishing)
WEIBO_COOKIE=your_weibo_cookie_here
Basic Usage
CLI Commands:
# Check status
social-agent status
# Get trending topics
social-agent trending
social-agent trending --platform weibo --limit 20
# Generate content
social-agent generate --topic "AI tools for productivity" --platform weibo --style casual
# Generate for multiple platforms
social-agent generate -t "Today's tech news" -p weibo -p xiaohongshu
# Search across platforms
social-agent search --keyword "ไบบๅทฅๆบ่ฝ" --platform weibo
# Publish content
social-agent publish --topic "My thoughts on AI" --platform weibo
social-agent publish -t "AI review" -p weibo -p xiaohongshu --dry-run
Python API:
import asyncio
from social_agent import SocialAgent, Settings
async def main():
# Initialize agent
settings = Settings.load()
agent = SocialAgent(settings)
await agent.initialize()
# Monitor trending
trending = await agent.get_trending(platform="weibo", limit=10)
for topic in trending:
print(f"๐ฅ {topic.title} (score: {topic.hot_score})")
# Generate content for multiple platforms
contents = await agent.create_content(
topic="AI makes coding 10x faster",
platforms=["weibo", "xiaohongshu"],
style="casual",
keywords=["AI", "ๆ็", "็ผ็จ"],
)
# Publish to all platforms
for content in contents:
result = await agent.publish(
platform=content.platform,
text=content.text,
hashtags=content.hashtags,
)
print(f"{'โ
' if result.success else 'โ'} {content.platform}")
await agent.shutdown()
asyncio.run(main())
Cross-Platform Content Adaptation
# Adapt content from one platform style to another
adapted = await agent.content_engine.adapt(
content="Original Weibo post text here...",
from_platform="weibo",
to_platform="xiaohongshu",
)
print(adapted.text) # Now in Xiaohongshu style
Scheduled Automated Workflows
# Daily post at 9 AM
agent.schedule_daily_post(
task_id="morning_post",
topic="ๆฏๆฅ็งๆ่ต่ฎฏ",
platforms=["weibo"],
hour=9,
minute=0,
)
# Monitor trending every 30 minutes
agent.schedule_trending_monitor(
task_id="trending_alert",
keywords=["AI", "ๅคงๆจกๅ", "GPT"],
interval_minutes=30,
)
# Start the scheduler loop
await agent.scheduler.start()
Architecture
social-agent/
โโโ src/social_agent/
โ โโโ __init__.py # Package init
โ โโโ agent.py # Core Agent orchestrator
โ โโโ config.py # Configuration management
โ โโโ content.py # Content generation engine
โ โโโ llm.py # LLM adapter layer
โ โโโ plugin.py # Plugin system
โ โโโ scheduler.py # Task scheduler
โ โโโ cli.py # Command-line interface
โ โโโ plugins/
โ โโโ weibo/ # Weibo platform plugin
โ โโโ xiaohongshu/ # Xiaohongshu platform plugin
โโโ examples/ # Usage examples
โโโ tests/ # Test suite
โโโ pyproject.toml # Project config
โโโ .env.example # Environment template
Key Design Decisions
| Design | Rationale |
|---|---|
| Plugin-based | Each platform is a self-contained plugin, easy to add/remove |
| Async-first | Built on asyncio for efficient concurrent operations |
| Multi-LLM | Not locked to any single provider, works with OpenAI/Claude/Qwen/GLM/Ollama |
| No browser dependency | Core reads via HTTP API, browser automation optional for publishing |
Supported Platforms
| Platform | Read (Trending/Search) | Write (Publish) | Status |
|---|---|---|---|
| ๅพฎๅ Weibo | โ | โ | Full support |
| ๅฐ็บขไนฆ Xiaohongshu | โ | ๐ | Read ready, publish via companion |
| ๆ้ณ Douyin | ๐ | ๐ | Planned |
| B็ซ Bilibili | ๐ | ๐ | Planned |
| ็ฅไน Zhihu | ๐ | ๐ | Planned |
LLM Providers
| Provider | Models | Setup |
|---|---|---|
| OpenAI | GPT-4o, GPT-4o-mini | Set OPENAI_API_KEY |
| Anthropic Claude | Claude 3.5 Sonnet | Set CLAUDE_API_KEY |
| DashScope (Qwen) | Qwen-Plus, Qwen-Max | Set DASHSCOPE_API_KEY, free tier available |
| Zhipu (GLM) | GLM-4-Flash, GLM-4 | Set ZHIPU_API_KEY, free tier available |
| Ollama (Local) | Any local model | Set OLLAMA_BASE_URL, fully offline |
๐ก For Chinese users, DashScope (Qwen) or Zhipu (GLM) offer free tiers and work great out of the box.
Create Your Own Plugin
from social_agent.plugin import BasePlatformPlugin, PluginMeta, PluginType, ActionScope
class DouyinPlugin(BasePlatformPlugin):
meta = PluginMeta(
name="douyin",
version="0.1.0",
description="Douyin (TikTok China) platform integration",
plugin_type=PluginType.PLATFORM,
supported_actions=[ActionScope.READ, ActionScope.WRITE],
tags=["douyin", "tiktok", "china"],
)
async def verify_auth(self) -> bool:
# Your auth check logic
return True
async def get_trending(self, limit: int = 10):
# Your trending fetch logic
return [{"title": "...", "hot_score": 1000}]
async def search(self, keyword: str, limit: int = 20):
# Your search logic
return []
async def publish(self, text: str, **kwargs):
# Your publish logic
return {"id": "...", "url": "..."}
Roadmap
- v0.2 โ Douyin plugin, Bilibili plugin
- v0.3 โ MCP Server integration (use with Claude/Cursor)
- v0.4 โ Web dashboard for monitoring and analytics
- v0.5 โ Community plugin marketplace
- v1.0 โ Stable release with full multi-platform support
Contributing
Contributions are welcome! Here's how you can help:
- New Platform Plugins โ Add support for Douyin, Bilibili, Zhihu, etc.
- Content Templates โ Share platform-specific content templates
- Analyzer Plugins โ Build analytics and reporting tools
- Documentation โ Improve guides, add tutorials
- Bug Reports โ Found a bug? Open an issue!
Development Setup
pip install -e ".[dev]"
pytest tests/ -v
License
MIT โ Free for personal and commercial use.
Made with โค๏ธ by zouyongfu
If you find this project useful, please give it a โญ!
ไธญๆไป็ป
Social Agent ๆฏไปไน๏ผ
Social Agent ๆฏไธไธชๅผๆบ็ AI ็คพไบคๅชไฝ่ฟ่ฅๆกๆถ๏ผๆฏๆไธ้ฎ็ๆง็ญ็นใAI ็ๆๅ ๅฎนใๅคๅนณๅฐๅๅใๆฐๆฎๅๆใ
ๆ ธๅฟ็ๅฟต๏ผๅไธๆฌก๏ผๅๅฐๅคใ่ฎฉ AI ๅธฎไฝ ๆๅฎ็คพไบคๅชไฝ่ฟ่ฅใ
ๆ ธๅฟๅ่ฝ
- ๐ฅ ็ญ็น็ๆง โ ๅฎๆถ่ทๅๅพฎๅใๅฐ็บขไนฆใๆ้ณใB็ซ็ญๆ
- โ๏ธ AI ๅ ๅฎน็ๆ โ ๆ นๆฎไธป้ข่ชๅจ็ๆๅนณๅฐ้้ ็ๅ ๅฎน
- ๐ค ๅคๅนณๅฐๅๅธ โ ไธๆกๅ ๅฎน๏ผ่ชๅจ้้ ๅคไธชๅนณๅฐ้ฃๆ ผๅนถๅๅธ
- ๐ ่ทจๅนณๅฐๆ็ดข โ ็ปไธๆ็ดขๆฅๅฃ๏ผไธๆฌกๆ็ดข่ฆ็ๆๆๅนณๅฐ
- ๐ ๆฐๆฎๅๆ โ ่ฟฝ่ธชๅๅนณๅฐ่ฟ่ฅๆฐๆฎ๏ผAI ็ๆไผๅๅปบ่ฎฎ
- โฐ ๅฎๆถไปปๅก โ ๅฎๆถๅๅใๅฎๆถ็ๆง็ญๆ
- ๐ ๆไปถๅๆถๆ โ ๆฏไธชๅนณๅฐ้ฝๆฏ็ฌ็ซๆไปถ๏ผ็คพๅบๅฏๆฉๅฑ
- ๐ค ๅคๆจกๅๆฏๆ โ ๆฏๆ GPTใClaudeใ้ไนๅ้ฎใๆบ่ฐฑGLMใOllama
ๅฟซ้ไธๆ
git clone https://github.com/zouyongfu/social-agent.git
cd social-agent
pip install -e ".[weibo]"
cp .env.example .env
# ็ผ่พ .env ๅกซๅ
ฅไฝ ็ API Key ๅ Cookie
social-agent status
social-agent trending
ไฝฟ็จๅบๆฏ
- ่ชๅชไฝ่ฟ่ฅ โ AI ่ชๅจ็ๆๅ ๅฎน๏ผๅฎๆถๅๅธๅฐๅคไธชๅนณๅฐ
- ๅ็่ฅ้ โ ็ๆงๅ็็ธๅ ณ็ญๆ๏ผๅฟซ้ๅๅบ
- ็ซๅๅๆ โ ่ฟฝ่ธช็ซๅๅจๆ๏ผๅๆ่ฟ่ฅ็ญ็ฅ
- ไธชไบบๅ็ โ ไธ้ฎๅๅ๏ผๆฉๅคงๅฝฑๅๅ
- ๅ ๅฎนๅไฝ โ AI ่พ ๅฉๅไฝ๏ผๆ้ซไบงๅบๆ็