DEV Community

André Ahlert
André Ahlert

Posted on

I built an MCP Server that lets Claude manage your Substack

The Substack web UI is fine for casual use, but if you're a power user who publishes daily, manages engagement, and wants to automate interactions, you need something faster.

TUI Gif Interface Demo

I built @postcli/substack, a tool that gives you three interfaces to Substack:

1. CLI - Direct commands from your terminal

postcli-substack notes publish "Shipping fast from the terminal"
postcli-substack posts list --limit 5
postcli-substack feed --tab for-you
Enter fullscreen mode Exit fullscreen mode

2. TUI - Full interactive terminal UI with 6 tabs

postcli-substack tui
Enter fullscreen mode Exit fullscreen mode

Navigate with j/k or arrow keys, scroll with mouse wheel, open posts in browser with 'o'. It's keyboard-driven and fast.

3. MCP Server - 16 tools for AI agents

{
  "mcpServers": {
    "substack": {
      "command": "postcli-substack",
      "args": ["mcp"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Tell Claude "like back everyone who liked my last note" and it just works.

The automation engine

The part I'm most proud of is the automation engine. It uses SQLite to track processed entities (no duplicate actions) and supports triggers like:

  • Someone likes your note → auto-like their latest note back
  • New note from specific authors → auto-like or restack
  • New post from specific publications → auto-restack

Auth without API keys

Substack doesn't have a public API. Auth works by extracting your existing Chrome session cookies (AES-128-CBC decryption) or manual cookie entry.

postcli-substack auth login
Enter fullscreen mode Exit fullscreen mode

Install

npm install -g @postcli/substack
Enter fullscreen mode Exit fullscreen mode

89 tests. CI on Node 18/20/22. Open source (AGPL-3.0).

GitHub: https://github.com/postcli/substack
NPM: https://www.npmjs.com/package/@postcli/substack

Top comments (0)