substack-mcp
substack-mcp
Un servidor del Protocolo de Contexto de Modelo (MCP) para Substack. Permite a Claude Code crear borradores, subir imágenes, establecer miniaturas de portada, programar y publicar entradas en tu publicación de Substack.
Construido sobre
python-substack. Utiliza la API interna de Substack (no existe una API pública de publicación). No está afiliado a Substack Inc.
Herramientas
Requeridas
create_draft(title, content_markdown, subtitle?, audience?)— Crea un nuevo borrador a partir de Markdown.update_draft(post_id, title?, subtitle?, content_markdown?, audience?)— Edita un borrador existente.upload_image(image_path)— Sube un archivo local o una URL remota a la CDN de Substack, devolviendo la URL.publish_draft(post_id, send_email?, share_automatically?)— Publica inmediatamente.send_emailalterna el envío por correo electrónico.
Recomendadas
schedule_draft(post_id, iso_datetime)— Programa una publicación para una fecha/hora futura (ISO 8601).unschedule_draft(post_id)— Cancela una publicación programada.set_cover_image(post_id, image_url)— Establece la miniatura de portada (desde la URL deupload_image).
Utilidad
list_drafts(limit?)— Lista los borradores recientes.get_draft(post_id)— Obtiene el cuerpo completo de un borrador.delete_draft(post_id)— Eliminación permanente.
Related MCP server: Substack MCP Server
Configuración
# 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-mcpReinicia Claude Code, luego /mcp debería mostrar substack-mcp como connected.
Cómo funciona la autenticación
Por defecto, substack-mcp-setup lee la cookie substack.sid directamente de tu sesión de Chrome existente a través de pycookiecheat.
Substack no puede saber que algo fue automatizado porque nada lo fue: es la misma sesión que ya estás usando.
macOS solicitará una vez el acceso al Llavero ("Chrome Safe Storage"). Haz clic en "Siempre permitir" para que no vuelva a preguntar la próxima vez.
Compatible con: Chrome, Brave, Edge, Chromium, Vivaldi, Opera.
Modos de respaldo
# 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 --manualLos tokens se almacenan en ~/Library/Application Support/substack-mcp/config.json con permisos 0600.
Seguridad
La cookie substack.sid es equivalente a una contraseña: cualquiera que la tenga tiene acceso total a la cuenta (publicar entradas, editar facturación, etc.). Trátala como tal.
Dónde reside el token
macOS:
~/Library/Application Support/substack-mcp/config.json(modo0600)Linux:
~/.config/substack-mcp/config.json(modo0600)O mediante variables de entorno:
SUBSTACK_PUBLICATION_URL+SUBSTACK_SESSION_TOKEN(las variables de entorno son heredadas por los procesos hijos; ten cuidado al generar subprocesos)
El .gitignore excluye config.json; nunca lo subas al repositorio. El MCP también escribe un archivo de cookie temporal mediante tempfile.mkstemp (modo 0600) y lo elimina en un bloque finally — consulta auth.py:write_cookie_file.
Si un token se filtra
Cierra sesión en todas las sesiones: Substack → Configuración → Seguridad → "Cerrar sesión en todas las sesiones". Esto invalida cada
substack.sidexistente inmediatamente.Vuelve a iniciar sesión en Substack en tu navegador.
Vuelve a ejecutar
substack-mcp-setuppara capturar la nueva cookie.
Seguridad en la carga de imágenes
upload_image solo acepta:
URLs HTTP(S), o
Archivos locales con extensiones de imagen (
.png,.jpg,.jpeg,.gif,.webp,.heic,.heif) que no estén bajo rutas sensibles del sistema (/etc,/System,~/.ssh,~/.aws,~/Library/Keychains, etc.)
Esto protege contra que un asistente sea engañado (mediante inyección de prompts en el contenido obtenido) para subir, por ejemplo, una clave privada SSH a la CDN de Substack.
Limitación conocida: La sintaxis de imagen Markdown  dentro de create_draft es procesada por python-substack y omite esta validación. Si pasas Markdown no confiable, desinfecta primero las rutas de las imágenes.
Dependencias
Las versiones están fijadas con ~= (lanzamiento compatible, sin cambios mayores). La actualización de python-substack en particular debe ser revisada: se comunica con la API privada de Substack y vive fuera de la superficie oficial de Substack.
Notas
audienceacepta:everyone(por defecto),only_paid,founding,only_free.La sintaxis de imagen Markdown
sube automáticamente archivos locales cuando llamas acreate_draft.La imagen de portada (establecida mediante
set_cover_image) es la que aparece en la página de inicio de tu publicación y en las publicaciones en redes sociales. Si no estableces una explícitamente, Substack normalmente utiliza la primera imagen del cuerpo.
Available Tools
11 toolscreate_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 ( - 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 .
Inputs: image_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: draft CRUD, publishing, scheduling, notes, and image operations. No two tools overlap in functionality.
All tools follow a consistent verb_noun pattern with underscores (e.g., create_draft, publish_draft, upload_image), making the API predictable.
11 tools is well-scoped for a Substack server, covering drafting, publishing, scheduling, notes, and images without being excessive.
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
Related MCP Connectors
MCP server for QPost — lets AI agents publish video and image posts to YouTube, TikTok, Instagram.
PostHero MCP server — schedule and publish social media posts from any MCP-compatible AI tool
HTTP-first Apify MCP server for Substack RAG Markdown, sponsor domains, and /about emails.
Hosted MCP server for AI agents to post to LinkedIn profiles and X and upload to YouTube.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceAn 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
- AlicenseAqualityAmaintenanceMCP 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.392,698 npm53MIT
- AlicenseNot gradedqualityCmaintenanceEnables programmatic management of Substack content, including creating drafts, publishing posts, and uploading images. It supports specialized features like live blogging and posting to Substack Notes through MCP-compatible AI tools.MIT
- AlicenseNot gradedqualityDmaintenanceCreate, manage, and publish Substack posts with full rich text formatting directly from Claude Desktop or any MCP-compatible client.88 npm26MIT