mcp-server-wechat

dinggithub/mcp-server-wechat

3.2

If you are the rightful owner of mcp-server-wechat and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A FastMCP-based server for parsing WeChat articles, bypassing anti-crawling mechanisms and providing key information extraction and content analysis.

Tools
3
Resources
0
Prompts
0

微信公众号文章解析 MCP 服务器

基于 FastMCP 框架的微信公众号文章解析服务,能够绕过反爬机制获取文章内容,并提供关键信息提取和内容分析功能。

功能特点

  • 反爬机制绕过:使用 Selenium/Playwright 模拟真实浏览器行为
  • 文章解析:提取标题、作者、发布日期、正文内容和图片
  • 关键信息提取:提取关键词和生成摘要
  • 内容分析:情感分析、文章分类和可读性评估

安装

前置条件

  • Python 3.10+
  • FastMCP 2.0+
  • Selenium 或 Playwright

安装步骤

  1. 克隆仓库:
git clone https://github.com/yourusername/mcp-server-wechat.git
cd mcp-server-wechat
  1. 安装依赖:
pip install -e .
  1. 安装浏览器驱动(如果使用 Selenium):
# Chrome
webdriver-manager install chrome

# Firefox
webdriver-manager install firefox

使用方法

使用 fastmcp dev 进行调试

# 启动 MCP Inspector
fastmcp dev src/mcp_server_wechat/server.py

# 或指定服务器对象
fastmcp dev src/mcp_server_wechat/server.py:mcp

安装到客户端

# 安装到 Claude Desktop
fastmcp install src/mcp_server_wechat/server.py --name wechat-article-parser

传输协议配置

默认使用 stdio 传输协议,适用于本地/Claude Desktop。如需使用 HTTP 传输协议(用于远程访问/多客户端),修改 server.py 中的运行方式:

# 使用 HTTP 传输协议
mcp.run(transport="http", host="127.0.0.1", port=8000)

工具说明

parse_article

解析微信公众号文章内容。

parse_article(
    url="https://mp.weixin.qq.com/s/vHVR1ldibtD1KSoKfra6vw",
    format="json",
    detail="concise",
    use_proxy=False
)

extract_key_info

从文章内容中提取关键信息。

extract_key_info(
    content="文章内容...",
    extract_keywords=True,
    extract_summary=True,
    keywords_count=10,
    summary_length=200,
    format="json"
)

analyze_content

分析文章内容。

analyze_content(
    content="文章内容...",
    analysis_type=["sentiment", "category", "readability"],
    format="json"
)

调试技巧

  1. 使用 fastmcp dev 启动 MCP Inspector,可视化调试工具调用
  2. 检查浏览器驱动是否正确安装
  3. 调整反爬策略参数,如等待时间、模拟行为等
  4. 使用代理 IP 轮换,避免 IP 被封禁

注意事项

  • 请合理使用,避免频繁请求导致 IP 被封
  • 遵守微信公众平台的使用条款
  • 仅用于学习和研究目的,不得用于商业用途

许可证

MIT