Official Substack MCP Server

Official Substack MCP Server

Official Substack MCP Server

Category
访问服务器

README

Writer Context Tool for Claude

image

Open-Sourced Model Context Protocol (MCP) implementation that connects Claude to your Substack and Medium writing.

What is this?

Writer Context Tool is an MCP server that allows Claude to access and analyze your writing from platforms like Substack and Medium. With this tool, Claude can understand the context of your published content, providing more personalized assistance with your writing.

Features

  • 🔍 Retrieves and permanently caches your blog posts from Substack and Medium
  • 🔎 Uses embeddings to find the most relevant essays based on your queries
  • 📚 Makes individual essays available as separate resources for Claude
  • 🧠 Performs semantic searches across your writing
  • ⚡ Preloads all content and generates embeddings at startup

How It Works

The tool connects to your Substack/Medium blogs via their RSS feeds, fetches your posts, and permanently caches them locally. It also generates embeddings for each post, enabling semantic search to find the most relevant essays based on your queries.

When you ask Claude about your writing, it can use these individual essay resources to provide insights or help you develop new ideas based on your existing content.

Setup Instructions (Step by Step)

Prerequisites

  • Python 3.10 or higher
  • Claude Desktop (latest version)
  • A Substack or Medium account with published content

1. Clone this Repository

git clone https://github.com/yourusername/writer-context-tool.git
cd writer-context-tool

2. Set up Python Environment

Using uv (recommended):

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt

Or using standard pip:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

3. Configure Your Blogs

  1. Copy the example configuration file:

    cp config.example.json config.json
    
  2. Edit config.json with your Substack/Medium URLs:

    {
      "platforms": [
        {
          "type": "substack",
          "url": "https://yourusername.substack.com",
          "name": "My Substack Blog"
        },
        {
          "type": "medium",
          "url": "https://medium.com/@yourusername",
          "name": "My Medium Blog"
        }
      ],
      "max_posts": 100,
      "cache_duration_minutes": 10080,
      "similar_posts_count": 10
    }
    
    • max_posts: Maximum number of posts to fetch from each platform (default: 100)
    • cache_duration_minutes: How long to cache content before refreshing (default: 1 week or 10080 minutes)
    • similar_posts_count: Number of most relevant posts to return when searching (default: 10)

4. Connect with Claude Desktop

  1. Create the Claude Desktop configuration directory:

    # On macOS
    mkdir -p ~/Library/Application\ Support/Claude/
    
  2. Create the configuration file:

    # Get the absolute path to your uv command
    UV_PATH=$(which uv)
    
    # Create the configuration
    cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << EOF
    {
      "mcpServers": {
        "writer-tool": {
          "command": "${UV_PATH}",
          "args": [
            "--directory",
            "$(pwd)",
            "run",
            "writer_tool.py"
          ]
        }
      }
    }
    EOF
    

    Note: If you experience issues with the uv command, you can use the included shell script alternative:

    1. Make the script executable: chmod +x run_writer_tool.sh
    2. Update your Claude Desktop config to use the script:
    {
      "mcpServers": {
        "writer-tool": {
          "command": "/absolute/path/to/run_writer_tool.sh",
          "args": []
        }
      }
    }
    
  3. Restart Claude Desktop

Using the Tool with Claude

Once set up, you'll see individual essays available as resources in Claude Desktop. You can:

  1. Search across your writing: Ask Claude to find relevant content

    • "Find essays where I discuss [specific topic]"
    • "What have I written about [subject]?"
  2. Reference specific essays: Access individual essays by clicking on them when listed in search results

    • "Show me the full text of [essay title]"
  3. Refresh content: Force a refresh of your content

    • "Refresh my writing content"

Available Tools and Resources

The Writer Context Tool provides:

  1. Individual Essay Resources: Each of your essays becomes a selectable resource
  2. search_writing: A semantic search tool that finds the most relevant essays using embeddings
  3. refresh_content: Refreshes and recaches your content from all configured platforms

How Caching Works

The tool implements permanent caching with these features:

  1. Disk Caching: All content is stored on disk, so it persists between sessions
  2. Embeddings: Each essay is converted to embeddings for semantic search
  3. Selective Refresh: The tool only refreshes content when needed according to your cache settings
  4. Preloading: All content is automatically refreshed and embeddings generated at startup

Troubleshooting

If you encounter issues:

  1. Tool doesn't appear in Claude Desktop:

    • Check that your Claude Desktop configuration file is correct
    • Verify that all paths in the configuration are absolute
    • Make sure your Python environment has all required packages
    • Restart Claude Desktop
  2. No content appears:

    • Verify your Substack/Medium URLs in config.json
    • Try using the "refresh_content" tool
    • Check that your blogs are public and have published posts
  3. Error with uv command:

    • Try using the shell script approach instead
    • Verify the uv command is installed and in your PATH
  4. Embedding issues:

    • If you see errors about the embedding model, make sure you have enough disk space
    • Consider rerunning with a fresh installation if embeddings aren't working properly

License

This project is available under the MIT License.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选