社交参与MCP服务器

AI Growth OS是一个基于活动的社交参与MCP服务器,旨在通过真实互动构建开发者社区存在感,并跟踪所有活动。

  • by SonAIengine
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 SonAIengine/gwanjong-mcp

使用说明

光中议员

AI Growth OS——活动驱动的社交参与MCP服务器。

真实地与开发人员社区互动。按活动跟踪所有内容。

英语 · 韩语


快速开始

# 1. Install
pip install "gwanjong-mcp[all]"

# 2. Configure at least one platform
mkdir -p ~/.gwanjong
cat > ~/.gwanjong/.env << 'EOF'
DEVTO_API_KEY=your_key_here
EOF

# 3. Verify setup
gwanjong-mcp  # starts MCP server (use with Claude Code, Cursor, etc.)

使用克劳德代码:

claude mcp add gwanjong-mcp -- gwanjong-mcp
claude
> "Find interesting MCP discussions and leave a helpful comment"

自主模式(无需LLM客户端):

pip install "gwanjong-mcp[all,autonomous]"
gwanjong-daemon --topics "MCP,LLM" --dry-run --max-cycles 1

看 .env.example 对于所有配置选项。


哲学

两种模式,一个目标:在开发者社区中建立真正的存在感。

模式 行动 目标
评论 回复他人的帖子 通过乐于助人、真诚的参与赢得声誉。 没有自我推销。
发布 发布原创内容 分享您的项目、文章和公告。这就是晋升的地方。

评论为 给予价值 --回答问题、分享见解、加入讨论。当有人真正乐于助人时,社区会注意到。帖子为 展示你的作品 --项目启动、技术深度探索、经验教训。

为什么存在

典型的MCP服务器公开CRUD工具,让LLM编排一切。留下一条评论需要9+次工具调用、9+次LLM往返,每次都需要重新发送完整的工具描述列表。

Traditional MCP (14 tools, 9+ round trips):
LLM → list → LLM → trending → LLM → search → LLM → analyze → LLM → get_post
→ LLM → get_comments → LLM → preview → LLM → write → LLM

gwanjong-mcp (5 tools, 3 round trips):
LLM → scout → LLM → draft → LLM (generates content) → strike → done

设计原则

  1. 最少的工具 --总共5个。每个系统提示中都包含工具描述,因此更少=更便宜+更准确。
  2. 服务器端状态 --侦察结果缓存在服务器上。LLM不在工具之间中继数据。
  3. 服务器作为小脑 --获取、过滤、评分和分析发生在服务器内部。LLM只处理判断和内容生成。
  4. 压缩返回 --永远不要丢弃20个未经处理的帖子。服务器得分并返回前N个作为摘要。

MCP工具

工具 角色 内部发生了什么
gwanjong_setup 登机 检查平台状态→ API密钥设置指南→ 保存+测试连接
gwanjong_scout 侦察 趋势+搜索+分析+评分→ 返回前N个机会
gwanjong_draft 上下文收集 获取目标帖子+评论树+语气分析→ 返回上下文摘要
gwanjong_strike 执行 发布评论/文章/交叉发布→ 返回结果URL
_status 管道状态 显示状态字段+可用/已阻止的工具(由mcp管道自动生成)

管道流量

scout(topic, platforms)
  │  stores → opportunities
  │  Server internally: fetch trending + search + score + filter
  │  Returns: top N scored opportunities (~200 tokens)
  ▼
draft(opportunity_id)
  │  requires → opportunities
  │  stores → contexts
  │  Server internally: fetch post + comments + analyze tone
  │  Returns: context summary + suggested approach (~300 tokens)
  ▼
  LLM generates content based on context
  ▼
strike(opportunity_id, action, content)
     requires → contexts
     Server internally: write via platform API + record history
     Returns: { url, status }

示例:评论(参与)

User: "Find interesting MCP discussions and join in"

[1] scout(topic="MCP server", platforms=["devto", "reddit"])
    → Server scans trending + search across platforms → scores → returns top 3
    {
      "opportunities": [
        {"id": "opp_0", "platform": "devto",
         "title": "Best MCP servers for productivity?",
         "relevance": 0.91, "comments": 42,
         "reason": "Active discussion, directly relevant"}
      ]
    }

[2] draft(opportunity_id="opp_0")
    → Server fetches full post + comment tree + tone
    {
      "title": "Best MCP servers for productivity?",
      "body_summary": "...",
      "top_comments": ["...", "..."],
      "tone": "technical, recommendation-seeking",
      "suggested_approach": "Share genuine experience, no self-promo"
    }
    → LLM crafts a helpful, authentic reply

[3] strike(opportunity_id="opp_0", action="comment", content="...")
    → {"url": "https://dev.to/.../comment/...", "status": "posted"}

示例:发布(促销)

User: "Write a post about mcp-pipeline on Dev.to"

[1] scout(topic="MCP token optimization", platforms=["devto"])
    → Find what's trending to inform angle and timing

[2] draft(opportunity_id="opp_0")
    → Gather context on existing coverage

[3] LLM writes an original article about the project

[4] strike(opportunity_id="opp_0", action="post", content="...")
    → {"url": "https://dev.to/sonaiengine/...", "status": "posted"}

支持的平台

平台 协议 身份验证
Dev.to REST API(httpx) API密钥
蓝天 AT协议 应用密码
推特/X OAuth 1.0a(花呢) API密钥+令牌
红迪 OAuth2(asyncpraw) 客户端ID+密码

只有配置了API密钥的平台才会被激活。其他人则被默默地跳过了。

安装

# All platforms
pip install "gwanjong-mcp[all]"

# Specific platforms
pip install "gwanjong-mcp[devto]"
pip install "gwanjong-mcp[bluesky]"
pip install "gwanjong-mcp[twitter]"
pip install "gwanjong-mcp[reddit]"

# Development
git clone https://github.com/SonAIengine/gwanjong-mcp.git
cd gwanjong-mcp
pip install -e ".[all,dev]"

环境变量

复制 .env.example 到 .env 并填写您使用的平台:

# Dev.to — https://dev.to/settings/extensions
DEVTO_API_KEY=

# Bluesky — https://bsky.app/settings → App Passwords
BLUESKY_HANDLE=your.handle.bsky.social
BLUESKY_APP_PASSWORD=

# Twitter/X — https://developer.x.com/en/portal/dashboard
TWITTER_API_KEY=
TWITTER_API_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_SECRET=

# Reddit — https://www.reddit.com/prefs/apps
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_USERNAME=
REDDIT_PASSWORD=

Claude代码集成

# Register MCP server
claude mcp add gwanjong-mcp -- gwanjong-mcp

# Use with the gwanjong agent (~/.claude/agents/gwanjong.md)
claude agent gwanjong
> "Find interesting AI agent discussions and leave helpful comments"
> "Write a Dev.to post about mcp-pipeline"

审批工作流程

自主模式可以在发布之前停止,并将生成的内容排队进行审查。

# Queue content instead of posting immediately
gwanjong-daemon --require-approval --max-cycles 1

# Review pending items
gwanjong-approval list
gwanjong-approval show 1

# Approve and execute strike immediately
gwanjong-approval approve 1

# Reject without posting
gwanjong-approval reject 2

如果运行仪表板,还可以从UI中看到并操作待处理的审批:

gwanjong-dashboard
# open http://localhost:8585

建筑

gwanjong-mcp/
├── pyproject.toml
├── run.py                         # Direct execution entry point
└── gwanjong_mcp/
    ├── __init__.py
    ├── __main__.py                # python -m gwanjong_mcp
    ├── server.py                  # PipelineMCP + 5 tools + GwanjongState
    ├── setup.py                   # Platform onboarding (guide/save/test)
    └── pipeline.py                # scout/draft/strike pipeline logic

依存结构

┌─────────────────────────────────────────────────┐
│  Claude Agent (gwanjong.md)                     │
│  Persona · Content generation · Final judgment  │
└──────────────┬──────────────────────────────────┘
               │ 5 tools
┌──────────────▼──────────────────────────────────┐
│  gwanjong-mcp (this project)                    │
│  scout/draft/strike pipeline logic              │
│                                                 │
│  Dependencies:                                  │
│  ├── mcp-pipeline  — Stateful MCP framework     │
│  ├── devhub        — Multi-platform social API  │
│  └── graph-tool-call — Content search engine    │
└─────────────────────────────────────────────────┘
包 角色 安装
devhub社交 Dev.to、Bluesky、Twitter、Reddit的统一异步客户端 pip install devhub-social[all]
mcp管道 类型安全状态+声明性 stores/requires 工具链 pip install mcp-pipeline
图形工具调用 BM25+图形扩展+wRRF内容评分 pip install graph-tool-call

发展

./.venv/bin/python -m pytest -q                    # Default test suite (integration 제외)
./.venv/bin/python -m pytest -m integration -q    # Playwright/network integration tests
./.venv/bin/python -m mypy gwanjong_mcp/          # Type check
./.venv/bin/python -m ruff check gwanjong_mcp/    # Lint
./.venv/bin/python run.py                         # Local server

许可证

麻省理工学院