substack-mcp is an MCP server for Substack, with the goal of managing Substack newsletters in an AI assistant or terminal.
Main capabilities It can prepare rich long-form drafts, search archives, publish Notes, view analytics data, and manage free subscribers who have explicitly consented to subscribe, supporting operations across multiple publications. The server is regularly used by multiple newsletters and includes a CLI.
Security design Long-form posts can only be created and edited as drafts; they cannot be published or deleted; users need to manually review and publish in the Substack editor. Notes are the exception: create_note and create_note_with_link immediately publicly publish short-form Notes, because Notes on Substack have no draft state. Note tools are considered public publishing operations, with no preview step and no mechanism to undo from this server.
Installation and login Requires Node.js 22 or newer (CI covers Node 22 and 24). Browser login also requires the optional Playwright dependency: npm install @conorbronsdon/substack-mcp playwright npx playwright install chromium npx substack-mcp login https://yourblog.substack.com --user-id 12345 Use the user ID of your own account. The session is saved only after one bounded authentication read succeeds. You can also choose the paste-credentials method.
Verification read npx substack-mcp doctor --json --check-auth performs one bounded read per publication, confirming read access, but does not verify the user ID or write permissions.
Connect an MCP client Add the server to Claude Desktop or Claude Code, or use the Codex plugin. Environment variables take precedence; if omitted, the stored browser login session is used. Afterward you can ask the assistant: "How many Substack subscribers do I have?"
Draft workflow Follow the draft workflow: create_draft, search_posts, export_draft, preflight_draft, then plan_draft_update and update_draft. Long-form posts remain unpublished drafts until published in the Substack editor.
Credential provisioning methods Method A: Browser login (optional, no need to manually copy cookies). Install the server and the optional Playwright dependency in the local tools directory, then log in. substack-mcp-login is still a supported alias. If the publication URL and user ID are missing, you will be prompted. Login opens a browser for sign-in, including any CAPTCHA. After login, open <publication>/publish/home and wait for the publication session cookie; on a custom domain, this is connect.sid on the custom domain. One bounded authentication read must succeed before saving. When using --profile, login is saved to ~/.substack-mcp/session.json (directory override: SUBSTACK_MCP_HOME). Default storage (SUBSTACK_CREDENTIAL_STORE=file): the session uses AES-256-GCM, with the key derived from the operating system account and machine. File permissions request 0600. This is a machine-bound file, not an operating system keychain or secret vault. Optional operating system keychain: set SUBSTACK_CREDENTIAL_STORE=keychain in both the login process and the MCP client environment. macOS uses Keychain, Linux requires libsecret and secret-tool, Windows uses Credential Manager.
Multiple publications Set SUBSTACK_PROFILES=work,personal in the MCP client environment to select up to 32 different profiles. First remove all publication credential variables. A missing, corrupted, or invalid selected profile will prevent startup and will never fall back to another account. When using multiple profiles, tools require an explicit publication key, and CLI reads require --publication.
Method B: Manually obtain credentials Session token: for a custom domain, open DevTools → Application → Cookies → https://your-custom-domain and copy the connect.sid on the publication's own domain. For *.substack.com publications, use the connect.sid on that host or the substack.sid on .substack.com. User ID: open your account profile in Substack and copy its handle, then open https://substack.com/api/v1/user/your-handle/public_profile to read the top-level numeric id. Publication URL: the Substack URL including a custom domain.
Anonymous read tools Five tools use a separate anonymous reader that sends only User-Agent and Accept, and never sends the configured publication cookie or other credentials. Allowed hosts include substack.com, single-label *.substack.com, the configured publication origin, and the exact origins in SUBSTACK_PUBLIC_READ_ORIGINS. Redirects are rejected.
Archive search and draft review search_posts accepts query (1–500 characters), status (published, drafts, or scheduled, default published), offset (default 0), and limit (1–50, default 25). It performs one authenticated archive request and returns projected metadata, returned, total, has_more, and next_offset. preflight_draft accepts draft_id, reads once, and returns the check result, findings, content counts, and editor link. It checks the title, audience, JSON/body shape, image wrappers and HTTPS origins, as well as paywall counts and edge placement.
Use cases Suitable for users who want to efficiently manage Substack newsletter drafts, search archives, publish Notes, and view analytics data through an AI assistant or terminal.
Limitations Long-form posts cannot be published or deleted through this server and must be handled manually in the Substack editor. Notes are published immediately with no preview and no undo. Reader subscriptions and the inbox are not supported. This server does not perform Bestseller status checks.