Sign inSign up

marcomoauro/substack-mcp

By marcomoauro

•Updated 26 days ago

A Model Context Protocol (MCP) Server enabling LLM clients to interact with Substack's API.

Image
API management
Machine learning & AI
Web servers
0

2.8K

marcomoauro/substack-mcp repository overview

⁠substack-mcp

A Model Context Protocol⁠ server for Substack⁠: 27 tools that let an LLM client draft, publish, tag and measure posts, read and export your subscribers, and work the reader side — Inbox, Notes, comments and restacks.

Multi-arch image (linux/amd64, linux/arm64), Node 24, no build step, stdio transport.

Full documentation: github.com/marcomoauro/substack-mcp⁠

⁠Quick start

Add this to your MCP client's configuration file (Claude Desktop, Cursor, Cline, Copilot, Windsurf — the shape is the same everywhere):

{
  "mcpServers": {
    "substack-api": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "SUBSTACK_PUBLICATION_URL",
        "-e", "SUBSTACK_SESSION_TOKEN",
        "-e", "SUBSTACK_USER_ID",
        "marcomoauro/substack-mcp:latest"
      ],
      "env": {
        "SUBSTACK_PUBLICATION_URL": "<YOUR_PUBLICATION_URL>",
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SESSION_TOKEN>",
        "SUBSTACK_USER_ID": "<YOUR_USER_ID>"
      }
    }
  }
}

-i is required: the server speaks JSON-RPC over stdin/stdout.

⁠Environment

VariableRequiredWhat it is
SUBSTACK_PUBLICATION_URLyese.g. https://yourname.substack.com
SUBSTACK_SESSION_TOKENyesyour substack.sid session cookie
SUBSTACK_USER_IDyesyour numeric Substack user id
SUBSTACK_MCP_LOG_LEVELnosilent | error | warn | info (default) | debug

How to obtain the three credentials: implementing.substack.com/p/mcp-server-for-substack⁠.

⁠Tools

Drafts and publishing

ToolWhat it does
create_draft_postCreate a draft from a title, subtitle and plain-text body
set_post_bodyReplace a draft's body with a structured document — headings, lists, links, code, images, buttons, paywall
update_draftChange the title, subtitle and the nine writable Post settings, cover image included
get_draftRead one draft in full
list_postsList drafts, published or scheduled posts
publish_draftPublish a draft, with an explicit email-the-list decision
delete_draftDelete an unpublished draft (refuses published posts)
upload_imageRe-host an external image on Substack's own bucket

Subscribers

ToolWhat it does
list_subscribersList and filter subscribers — 48 columns, 18 operators, search, sorting, paging
export_subscribersExport the matching set with every column value, engagement metrics included

Stats

ToolWhat it does
get_publication_statsThe headline numbers
get_post_statsRank the whole archive by any of 43 per-post metrics
get_analytics16 publication-level reports — growth, revenue, traffic, retention

Tags and comments

ToolWhat it does
list_publication_tags / get_post_tags / add_tag_to_postRead the tag list, read a post's tags, tag a post
get_post_comments / comment_on_postRead the comments on your posts, reply to them

Reader side (your account, not your publication)

ToolWhat it does
list_subscriptionsWhat this account subscribes to
list_reader_posts / get_reader_postThe Inbox, and any post read in full
get_reader_feed / get_profile_feedThe Notes feed, and what one account has published
get_comment_threadA Note and its replies
restack_itemRestack a Note
get_publication / get_user_profileYour publication's settings, and the account behind the session

⁠Logs

One JSON object per line on stderr — MCP clients collect it into their own log file. It is the fastest way to see what your LLM actually sent when a call did not do what you expected:

{"ts":"2026-08-08T10:12:03.114Z","level":"info","msg":"tool.call.start","tool":"create_draft_post","args":{"title":"My title"}}
{"ts":"2026-08-08T10:12:03.402Z","level":"info","msg":"substack.response","status":200,"duration_ms":287}

Your session token is never written to the log, at any level.

⁠Tags

latest tracks the newest release. Every release is also published as vX.Y.Z, and every build as its short commit SHA.

⁠Alternatives

Prefer no container? npx -y substack-mcp@latest runs the same server on Node 22 or newer — see the npm package⁠.

⁠Support

Issues and feature requests: github.com/marcomoauro/substack-mcp/issues⁠ · MIT licensed

Tag summary

Content type

Image

Digest

sha256:98efce6ce…

Size

59.1 MB

Last updated

26 days ago

docker pull marcomoauro/substack-mcp