Substack MCP

by Greg-Swiftomatic
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Enables retrieval and search of newsletter posts, podcasts, and recommendations, as well as accessing post content, metadata, user profiles, and subscription information from Substack publications.

子堆栈 MCP

用于 Substack API 与 Claude 和其他 AI 助手集成的 MCP(模型上下文协议)服务器。

概述

该项目实现了一个模型上下文协议 (MCP) 服务器,使像 Claude 这样的 AI 助手能够通过标准化界面与 Substack 的新闻通讯、帖子和作者进行交互。它利用Substack API 库,并通过 MCP 提供其功能。

使用此 MCP 服务器,Claude 可以:

  • 检索新闻稿、播客和推荐
  • 获取帖子内容和元数据
  • 在新闻通讯中搜索帖子
  • 获取用户个人资料信息和订阅

安装

先决条件

设置

  1. 克隆此存储库:
    git clone https://github.com/Greg-Swiftomatic/substack-mcp.git cd substack-mcp
  2. 使用uv设置虚拟环境:
    curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv if not already installed uv init . uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
  3. 安装依赖项:
    uv add "mcp[cli]" substack-api

用法

运行服务器

运行 MCP 服务器:

python substack_mcp.py

为桌面配置 Claude

  1. 打开Claude for Desktop的配置文件:
    • macOS/Linux~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows%APPDATA%\Claude\claude_desktop_config.json
  2. 添加您的服务器配置:
    { "mcpServers": { "substack": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/substack-mcp", "run", "substack_mcp.py" ] } } }
  3. 重新启动 Claude 桌面版。

示例查询

配置完成后,您可以向 Claude 询问以下问题:

可用工具

该服务器提供以下 MCP 工具:

工具描述
get_newsletter_posts从 Substack 新闻通讯中检索最新帖子
get_post_content获取特定 Substack 帖子的完整内容
search_newsletter搜索新闻通讯中的帖子
get_author_info获取有关 Substack 作者的信息
get_newsletter_recommendations获取 Substack 出版物的推荐新闻通讯
get_newsletter_authors获取 Substack 时事通讯的作者

项目结构

  • substack_mcp.py - 主 MCP 服务器实现
  • examples/ - 查询和响应示例
  • docker/ - 用于容器化部署的 Docker 配置

发展

为该项目做出贡献:

  1. 分叉存储库
  2. 创建功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

故障排除

如果您遇到问题:

  1. 检查 Claude 的日志是否存在错误:
    # macOS/Linux tail -n 20 -f ~/Library/Logs/Claude/mcp*.log # Windows type %APPDATA%\Claude\Logs\mcp*.log
  2. 验证您的服务器是否构建并运行,没有错误:
    python substack_mcp.py
  3. 确保您的claude_desktop_config.json文件具有正确的路径和语法。
  4. 尝试完全重启 Claude for Desktop。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢

-
security - not tested
A
license - permissive license
-
quality - not tested

MCP 服务器使 Claude 等 AI 助手能够与 Substack 新闻通讯进行交互,从而允许通过标准化界面进行帖子检索、内容搜索和作者信息访问。

  1. Overview
    1. Installation
      1. Prerequisites
      2. Setup
    2. Usage
      1. Running the Server
      2. Configuring Claude for Desktop
      3. Example Queries
    3. Available Tools
      1. Project Structure
        1. Development
          1. Troubleshooting
            1. License
              1. Acknowledgments
                ID: td4i4nj7ef