Skip to main content
Glama

substack-mcp

Ein Model Context Protocol (MCP) Server für Substack. Ermöglicht es Claude Code, Entwürfe zu erstellen, Bilder hochzuladen, Titelbilder festzulegen, Beiträge zu planen und auf Ihrer Substack-Publikation zu veröffentlichen.

Basiert auf python-substack. Verwendet die interne API von Substack (es gibt keine öffentliche Posting-API). Nicht mit Substack Inc. verbunden.

Tools

Erforderlich

  • create_draft(title, content_markdown, subtitle?, audience?) — Erstellt einen neuen Entwurf aus Markdown.

  • update_draft(post_id, title?, subtitle?, content_markdown?, audience?) — Bearbeitet einen bestehenden Entwurf.

  • upload_image(image_path) — Lädt eine lokale Datei oder eine Remote-URL in das CDN von Substack hoch und gibt die URL zurück.

  • publish_draft(post_id, send_email?, share_automatically?) — Sofortige Veröffentlichung. send_email schaltet den E-Mail-Versand um.

Empfohlen

  • schedule_draft(post_id, iso_datetime) — Plant eine Veröffentlichung für ein zukünftiges Datum/eine zukünftige Uhrzeit (ISO 8601).

  • unschedule_draft(post_id) — Storniert eine geplante Veröffentlichung.

  • set_cover_image(post_id, image_url) — Legt das Titelbild fest (von der upload_image URL).

Dienstprogramm

  • list_drafts(limit?) — Listet aktuelle Entwürfe auf.

  • get_draft(post_id) — Ruft den vollständigen Inhalt eines Entwurfs ab.

  • delete_draft(post_id) — Dauerhaftes Löschen.

Related MCP server: Substack MCP Server

Einrichtung

# 1. Install dependencies
uv pip install -e .

# 2. Make sure you're logged in to Substack in Chrome (or Brave/Edge) — that's it.

# 3. Save credentials — auto-detects your existing browser session
substack-mcp-setup

# 4. Register with Claude Code
claude mcp add substack-mcp --scope user -- /Users/$USER/substack/.venv/bin/substack-mcp

Starten Sie Claude Code neu, dann sollte /mcp substack-mcp als connected anzeigen.

Funktionsweise der Authentifizierung

Standardmäßig liest substack-mcp-setup das substack.sid-Cookie direkt aus Ihrer bestehenden Chrome-Sitzung über pycookiecheat. Substack kann nicht erkennen, dass etwas automatisiert wurde, da nichts automatisiert wurde: Es ist dieselbe Sitzung, die Sie bereits verwenden.

macOS wird einmalig nach dem Zugriff auf den Schlüsselbund fragen ("Chrome Safe Storage"). Klicken Sie auf "Immer erlauben", damit Sie beim nächsten Mal nicht erneut gefragt werden.

Unterstützt: Chrome, Brave, Edge, Chromium, Vivaldi, Opera.

Fallback-Modi

# Specific browser
substack-mcp-setup --from-browser brave

# Playwright-based (often blocked by Substack — use --chrome instead)
substack-mcp-setup --browser

# Manual paste from DevTools
substack-mcp-setup --manual

Token werden unter ~/Library/Application Support/substack-mcp/config.json mit 0600-Berechtigungen gespeichert.

Sicherheit

Das substack.sid-Cookie ist gleichbedeutend mit einem Passwort — jeder, der es besitzt, hat vollen Kontozugriff (Beiträge veröffentlichen, Abrechnung bearbeiten usw.). Behandeln Sie es entsprechend.

Wo das Token gespeichert wird

  • macOS: ~/Library/Application Support/substack-mcp/config.json (Modus 0600)

  • Linux: ~/.config/substack-mcp/config.json (Modus 0600)

  • Oder über Umgebungsvariablen: SUBSTACK_PUBLICATION_URL + SUBSTACK_SESSION_TOKEN (Umgebungsvariablen werden von untergeordneten Prozessen geerbt — seien Sie vorsichtig beim Starten von Unterprozessen)

Die .gitignore schließt config.json aus; committen Sie diese niemals. Das MCP schreibt außerdem eine temporäre Cookie-Datei über tempfile.mkstemp (Modus 0600) und löscht sie in einem finally-Block — siehe auth.py:write_cookie_file.

Wenn ein Token geleakt wurde

  1. Von allen Sitzungen abmelden: Substack → Einstellungen → Sicherheit → "Von allen Sitzungen abmelden". Dies macht jedes existierende substack.sid sofort ungültig.

  2. Melden Sie sich in Ihrem Browser wieder bei Substack an.

  3. Führen Sie substack-mcp-setup erneut aus, um das neue Cookie zu erfassen.

Sicherheit beim Hochladen von Bildern

upload_image akzeptiert nur:

  • HTTP(S)-URLs, oder

  • Lokale Dateien mit Bild-Endungen (.png, .jpg, .jpeg, .gif, .webp, .heic, .heif), die sich nicht unter sensiblen Systempfaden befinden (/etc, /System, ~/.ssh, ~/.aws, ~/Library/Keychains usw.)

Dies schützt davor, dass ein Assistent (durch Prompt-Injection in abgerufenen Inhalten) dazu verleitet wird, z. B. einen privaten SSH-Schlüssel in das CDN von Substack hochzuladen.

Bekannte Einschränkung: Markdown-Bildsyntax ![alt](path) innerhalb von create_draft wird von python-substack verarbeitet und umgeht diese Validierung. Wenn Sie nicht vertrauenswürdiges Markdown übergeben, bereinigen Sie die Bildpfade zuerst.

Abhängigkeiten

Versionen sind mit ~= fixiert (kompatible Version, keine Major-Updates). Insbesondere das Update von python-substack sollte überprüft werden — es kommuniziert mit der privaten API von Substack und liegt außerhalb der offiziellen Oberfläche von Substack.

Hinweise

  • audience akzeptiert: everyone (Standard), only_paid, founding, only_free.

  • Markdown-Bildsyntax ![alt](path/or/url) lädt lokale Dateien automatisch hoch, wenn Sie create_draft aufrufen.

  • Das Titelbild (festgelegt über set_cover_image) ist das Bild, das auf Ihrer Publikations-Startseite und bei Social-Media-Shares erscheint. Wenn Sie keines explizit festlegen, verwendet Substack normalerweise das erste Bild im Textkörper.

Available Tools

11 tools
create_draftA

Create a new Substack draft post from Markdown.

Args: title: Post title (max 280 chars). content_markdown: Body in Markdown. Supports headings, bold/italic, links, bullet lists, blockquotes, code blocks, and images (alt - local paths are auto-uploaded to Substack CDN). subtitle: Optional subtitle (max 280 chars). audience: Who can read it: 'everyone' (default), 'only_paid', 'founding', or 'only_free'.

Returns: Summary including post_id, title, edit_url.

Inputs: title (required), content_markdown (required), subtitle, audience.

delete_draftA

Permanently delete a draft. This cannot be undone.

Args: post_id: Draft ID.

Returns: {post_id, deleted: true}

Inputs: post_id (required).

get_draftA

Get full details of a specific draft, including the body content.

Args: post_id: Draft ID.

Returns: Full draft data including draft_body (ProseMirror JSON).

Inputs: post_id (required).

list_draftsA

List recent drafts (unpublished posts).

Args: limit: Max number of drafts to return (1-50). Default 10.

Returns: List of draft summaries with post_id, title, edit_url, etc.

Inputs: limit. Returns: result

post_noteA

Post a Note (Substack's short-form, X/Threads-like post) to the public feed.

Notes are different from Posts:

  • No title or subtitle.

  • No email delivery to subscribers.

  • Not added to the publication's article archive.

  • Visible in the Substack Notes feed (cross-publication discovery surface).

Use Notes for:

  • Quick thoughts, links, restacks, questions to your audience

  • Daily presence between long-form posts

  • Networking with other Substackers (replies, mutual follows)

Args: text: Plain text body. Use \n\n to separate paragraphs and \n for soft line breaks. Max 4000 chars (Substack's practical Notes limit).

Returns: {note_id, url, raw}

Inputs: text (required).

publish_draftA

Publish a draft immediately.

Args: post_id: Draft ID. send_email: If True (default), send the post as an email to subscribers. If False, publish to web only without emailing. share_automatically: If True, auto-share to Substack social channels.

Returns: {post_id, title, public_url, post_date, send_email}

Inputs: post_id (required), send_email, share_automatically.

schedule_draftA

Schedule a draft to publish at a future datetime.

Args: post_id: Draft ID. iso_datetime: ISO 8601 datetime, e.g., '2026-05-15T09:00:00+09:00' for JST or '2026-05-15T00:00:00Z' for UTC.

Returns: {post_id, scheduled_for}

Inputs: post_id (required), iso_datetime (required).

set_cover_imageA

Set the cover (thumbnail) image for a draft.

The cover image is shown on the publication homepage, in social shares, and as the email header. Use upload_image first to get a CDN URL.

Args: post_id: Draft ID. image_url: Substack CDN URL from upload_image, or any public image URL.

Returns: Updated draft summary.

Inputs: post_id (required), image_url (required).

unschedule_draftB

Cancel a scheduled publish, keeping the post as a draft.

Args: post_id: Draft ID.

Returns: {post_id}

Inputs: post_id (required).

update_draftA

Update an existing draft. Provide only the fields you want to change.

Args: post_id: Draft ID returned by create_draft or list_drafts. title: New title (optional). subtitle: New subtitle (optional). content_markdown: New body in Markdown (optional, replaces full body). audience: New audience setting (optional).

Returns: Updated draft summary.

Inputs: post_id (required), title, subtitle, content_markdown, +1 more.

upload_imageA

Upload an image to Substack's CDN and return its public URL.

Args: image_path: Local file path (e.g., /Users/foo/cover.png) or remote URL.

Returns: {url, id, width, height} — pass url to set_cover_image or embed in Markdown as alt.

Inputs: image_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: draft CRUD, publishing, scheduling, notes, and image operations. No two tools overlap in functionality.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with underscores (e.g., create_draft, publish_draft, upload_image), making the API predictable.

    Tool Count5/5

    11 tools is well-scoped for a Substack server, covering drafting, publishing, scheduling, notes, and images without being excessive.

    Completeness4/5

    The tool set covers core drafting and publishing workflows comprehensively, but lacks tools for managing published posts, subscribers, or analytics, which are minor gaps for a content creation MCP.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that enables AI assistants like Claude to interact with Substack newsletters, allowing for post retrieval, content searching, and author information access through a standardized interface.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      MCP server and CLI for Substack creators: rich Markdown drafts, draft tags, Notes, publication and post analytics, growth sources, archive search, anonymous reading of public profiles and Note threads, subscriber segmentation and consented subscriber management. Long-form posts stay drafts; Notes publish immediately.
      39
      2,698 npm
      53
      MIT