Substack MCP Server

Substack MCP Server

site icon
2025.03.20 0
PythonSubstack内容检索AI助手中间件内容生成
Substack MCP Server 是一个模型上下文协议(MCP)服务器,旨在使Claude和其他AI助手能够与Substack的新闻通讯、文章和用户资料进行交互。该服务器通过将Substack API库转换为Anthropic MCP服务器,实现了多种功能,包括检索新闻通讯文章、播客和推荐内容,获取用户资料信息和订阅内容,搜索文章内容及元数据,以及跨多个Substack新闻通讯进行搜索和发现热门新闻通讯等。
View on GitHub

Overview

基本能力

产品定位

Substack MCP Server 是一个专为AI助手设计的中间件,用于与Substack平台进行交互,提供内容检索和搜索功能。

核心功能

  • 检索新闻通讯文章、播客和推荐内容
  • 获取用户资料信息和订阅内容
  • 搜索文章内容及元数据
  • 跨多个Substack新闻通讯进行搜索
  • 发现按类别分类的热门Substack新闻通讯

适用场景

  • AI助手需要访问和检索Substack内容
  • 用户希望通过AI助手搜索特定主题的Substack文章
  • 开发者需要集成Substack内容到AI应用中

工具列表

工具 描述
get_newsletter_posts 从Substack新闻通讯检索最近的文章
get_post_content 获取特定Substack文章的完整内容
search_newsletter 在新闻通讯内搜索文章
search_across_substacks 跨多个Substack新闻通讯搜索内容
discover_popular_substacks 按类别发现热门Substack新闻通讯
get_author_info 检索Substack作者的信息
get_newsletter_recommendations 获取出版物的推荐新闻通讯
get_newsletter_authors 列出Substack新闻通讯的作者

常见问题解答

  1. 如何查看Claude的日志? ```bash # MacOS tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

# Windows type %APPDATA%\Claude\Logs\mcp.log 2. **如何确保服务器运行无误?**bash python substack_mcp.py ``` 3. 如何验证Claude for Desktop中的配置文件路径?* 确保配置文件中指定的路径与服务器实际路径一致。

使用教程

使用依赖

安装教程

# 克隆仓库
git clone https://github.com/Greg-Swiftomatic/substack-mcp-server.git
cd substack-mcp-server

# 设置虚拟环境
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# 安装依赖
pip install -r requirements.txt

或者使用uv

# 使用uv进行更快的安装
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

调试方式

  1. 运行服务器: bash python substack_mcp.py
  2. 配置Claude for Desktop:
  3. 打开配置文件(MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json,Windows: %APPDATA%\Claude\claude_desktop_config.json
  4. 添加服务器配置: json { "mcpServers": { "substack": { "command": "python", "args": [ "/ABSOLUTE/PATH/TO/substack-mcp-server/substack_mcp.py" ] } } }
  5. 重启Claude for Desktop
  6. 使用Claude进行查询:
  7. "Show me recent posts from https://stratechery.com/"
  8. "What's the content of this post: https://stratechery.com/2023/the-ai-unbundling/"
  9. "Search for 'AI' on https://stratechery.com/"
  10. "Search for 'AI ethics' across multiple Substack newsletters"
  11. "What are popular technology newsletters on Substack?"
  12. "Who are the authors of https://stratechery.com/?"

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。