MC

MCP Server Connecting Claude to Substack and Medium

Connect Claude to your Substack and Medium with an open-sourced MCP server that syncs article context and boosts writing workflow.

Quick Install
npx -y @jonathan-politzki/mcp-writer-substack

Overview

This open-source MCP (Model Context Protocol) server connects Anthropic Claude to your Substack and Medium publications so Claude can read, search, and reference your published writing. The server fetches articles via RSS, permanently caches content and embeddings on disk, and exposes each essay as a discrete resource that Claude can load on-demand. That makes Claude-aware of your past work and improves context-aware writing, summarization, and idea generation.

The project is implemented as a lightweight Python MCP server you run locally alongside Claude Desktop. It preloads content and generates embeddings at startup for fast semantic search, while configuration options let you control how many posts are fetched, cache durations, and search behavior. Source code and issues live on GitHub: https://github.com/jonathan-politzki/mcp-writer-substack

Features

  • Fetches posts from Substack and Medium via RSS
  • Permanent disk caching of post content and metadata
  • Precomputes embeddings for semantic search across your corpus
  • Exposes each essay as an individual resource for Claude
  • Semantic search endpoint (search_writing) that returns most-relevant essays
  • Manual refresh tool (refresh_content) to force re-fetch and re-embed
  • Configurable limits: max posts, cache TTL, number of similar results
  • Startup preload: content and embeddings are generated when the server starts

Installation / Configuration

Clone the repository and install dependencies:

git clone https://github.com/jonathan-politzki/mcp-writer-substack.git
cd mcp-writer-substack

Create and activate a Python virtual environment, then install requirements.

Using uv (recommended):

# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh

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

Or using standard venv + pip:

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

Create your configuration from the example and edit it:

cp config.example.json config.json

Example config.json:

{
  "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
}

Config keys

KeyTypeDescription
platformsarrayList of blog sources (type: substack
max_postsintMax posts to fetch per platform
cache_duration_minutesintTime-to-live for cache before automatic refresh (minutes)
similar_posts_countintNumber of results returned by semantic search

Integrate with Claude Desktop

Create or update Claude Desktop MCP config to point to the local run command. macOS example:

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

If you prefer a wrapper script, make it executable:

chmod +x run_writer_tool.sh
# then reference /absolute/path/to/run_writer_tool.sh in claude_desktop_config.json with empty args

Restart Claude Desktop after adding the MCP server.

Available Tools / Resources

  • Individual essay resources: each fetched post appears as a selectable resource in Claude Desktop.
  • search_writing: semantic search tool that returns the top-N relevant essays (based on embeddings).
  • refresh_content: command to re-fetch all configured blogs and rebuild the cache and embeddings.

How caching and embeddings work:

  • All fetched content is stored on disk so data persists across restarts.
  • On startup (and during refresh), the server computes embeddings for each essay to enable semantic similarity queries.
  • Cache TTL controls when content is considered stale and eligible for automatic refresh.

Use Cases

  1. Context-aware editing

    • Prompt Claude: “Using my previous essays on newsletter growth, rewrite this intro to match my voice.” Claude can load the most relevant essays and emulate your style.
  2. Research and ideation

    • Ask: “Find essays where I discussed paid subscriptions and summarize key points.” search_writing returns targeted posts and Claude summarizes or synthesizes findings.
  3. Repurposing content

    • Prompt: “Show me passages I can expand into a standalone Medium post about onboarding.” Claude can reference candidate excerpts from your published writing.
  4. Consistency checks before publishing

    • Ask: “Does this draft contradict anything I’ve written before on [topic]?” Claude compares the draft to cached essays and highlights overlaps or contradictions.
  5. Quick lookup

    • Query: “List all my essays that mention ‘email open rates’.” The server returns matching posts so Claude can show full text or excerpts.

Tips & Troubleshooting

  • Ensure configured URLs are public and include published posts.
  • Use absolute paths in Claude Desktop config to avoid resolution issues.
  • If the MCP server doesn’t appear, verify Python dependencies and check logs for errors.
  • Use refresh_content when you publish new posts and want them immediately available to Claude.

For source code, issues, and contributions, see the GitHub repository: https://github.com/jonathan-politzki/mcp-writer-substack