npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

substack-analysis-mcp

v1.0.8

Published

MCP server for Substack essay analysis using Gemini AI

Downloads

23

Readme

Substack Analysis MCP Server

This is an MCP (Model Context Protocol) server that allows you to analyze your Substack essays using Google's Gemini AI directly from Claude Desktop.

Quick Install

npx substack-analysis-mcp

Features

The MCP server exposes three tools to Claude:

  1. fetch_substack_posts - Fetches the latest posts from your Substack RSS feed
  2. analyze_writing_summary - Generates a comprehensive analysis of your writing covering themes, style, and intellectual journey
  3. ask_about_writing - Ask specific questions about your essays and get answers based on the full text

Prerequisites

  • Node.js 18+ installed
  • Python 3.x installed (for running the analyzer)
  • A Google Gemini API key
  • Claude Desktop app

Setup Instructions

1. Install Dependencies

First, install the Node.js dependencies:

cd mcp-server
npm install

2. Configure Environment

Copy the example environment file and add your API key:

cp env.example .env

Edit .env and add your Gemini API key:

GEMINI_API_KEY=your-actual-api-key-here
SUBSTACK_URL=https://jonathanpolitzki.substack.com/

3. Configure Claude Desktop

You need to add this MCP server to your Claude Desktop configuration.

On macOS:

  1. Open your Claude Desktop configuration file:

    open ~/Library/Application\ Support/Claude/claude_desktop_config.json
  2. Add the following to the mcpServers section (create it if it doesn't exist):

    {
      "mcpServers": {
        "substack-analysis": {
          "command": "node",
          "args": [
            "/Users/jonathanpolitzki/Desktop/Coding/Substack-Analysis/mcp-server/index.js"
          ],
          "env": {
            "GEMINI_API_KEY": "your-actual-gemini-api-key",
            "SUBSTACK_URL": "https://jonathanpolitzki.substack.com/"
          }
        }
      }
    }

    Make sure to:

    • Replace the path with the absolute path to your mcp-server/index.js file
    • Add your actual Gemini API key
    • Update the Substack URL if needed
  3. Restart Claude Desktop for the changes to take effect

On Windows:

The config file is located at:

%APPDATA%\Claude\claude_desktop_config.json

4. Test the Server

You can test the server standalone:

node index.js

It should output: Substack Analyzer MCP server running

Using in Claude

Once configured, you can use these commands in Claude:

  1. Fetch your posts:

    • "Fetch my Substack posts"
    • "Get the latest posts from my Substack"
  2. Analyze your writing:

    • "Analyze my Substack writing and give me a summary"
    • "What are the main themes in my essays?"
  3. Ask questions:

    • "What have I written about AI?"
    • "Summarize my thoughts on technology"
    • "How has my writing style evolved?"

How It Works

The MCP server:

  1. Uses the existing Python scraper and analyzer code
  2. Spawns Python processes to run the analysis
  3. Caches fetched posts for 1 hour to avoid repeated API calls
  4. Returns results to Claude in a structured format

Troubleshooting

"Python script failed" errors

  • Make sure Python 3 is installed and accessible as python3
  • Ensure all Python dependencies are installed in the parent directory:
    cd ..
    pip install -r requirements.txt

"GEMINI_API_KEY environment variable is required"

  • Make sure you've set up your .env file or added the API key to the Claude config

Claude doesn't see the tools

  • Restart Claude Desktop after updating the configuration
  • Check that the path in the config file is absolute and correct
  • Verify the MCP server starts without errors

Development

To run in development mode with auto-reload:

npm run dev

Notes

  • The server caches posts for 1 hour. Use force_refresh: true to bypass the cache
  • RSS feeds typically only provide the ~20 most recent posts
  • All analysis is done using Google's Gemini AI, so API usage costs apply