使用说明
子组MCP服务器
用于抓取和分析Substack通讯的模型上下文协议(MCP)服务器。使LLM能够从任何公共Substack发布中获取帖子。
特性
- 获取帖子:从任何Substack获取最近或最热门的帖子
- 获取帖子内容:检索单个帖子的全文
- 搜索文章:在时事通讯中搜索
- 批量提取:同时删除多份时事通讯
- 时事通讯信息:获取作者和推荐数据
安装
pip install -r requirements.txt
或手动:
pip install mcp substack-api pydantic httpx
用法
运行服务器
python server.py
MCP客户端配置
对于Claude Desktop或类似的MCP客户端,请在配置中添加:
{
"mcpServers": {
"substack": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}
工具
substack_getposts
从时事通讯中获取帖子。
{
"publication_url": "lenny", # or "https://lenny.substack.com"
"limit": 20,
"sorting": "top", # or "new"
"response_format": "markdown" # or "json"
}
substack_get-post_content
获取特定帖子的完整内容(仅限免费帖子)。
{
"post_url": "https://example.substack.com/p/post-slug",
"response_format": "markdown"
}
子跟踪搜索帖子
在时事通讯中搜索帖子。
{
"publication_url": "stratechery",
"query": "AI",
"limit": 10
}
subback_batch_get_posts
一次从多个时事通讯中获取。
{
"publication_urls": ["lenny", "stratechery", "platformer"],
"posts_per_publication": 5,
"sorting": "top"
}
substack_getnewsletter_info
获取时事通讯元数据和建议。
{
"publication_url": "lenny"
}
局限性
- 付费内容:未经身份验证,无法访问仅限订阅者的帖子
- 速率限制:子组可能会对请求进行速率限制;包括批量操作的0.5秒延迟
- 非官方API:使用可能发生变化的反向发动机API
- 网络限制:某些环境(公司代理、某些云平台)可能会阻止Substack API请求
学分
建立在 子堆栈api Python库。