substack-mcp
This server enables AI assistants to read Substack publication data and manage drafts, while intentionally preventing publishing or deletion of long-form content.
Read capabilities:
Get current subscriber count
List published or draft posts with pagination (title, date, slug, URL, audience)
Get full content of a specific published post or draft by ID
Get comments on a published post (commenter, body, date, reaction counts)
Write capabilities:
Create new draft posts from markdown (title, subtitle, body, audience: everyone, paid, founding, or free subscribers)
Update existing unpublished drafts (title, subtitle, body, audience)
Upload base64-encoded images to Substack's CDN, returning a hosted URL
Immediately publish short-form Substack Notes (with optional link card attachment)
Intentional limitations (safety by design):
Cannot publish or delete long-form posts — those actions require manual review in Substack's editor
Cannot schedule posts
Allows AI assistants to interact with Substack publications to retrieve subscriber counts, list and read published posts or drafts, and manage draft content by creating or updating posts from Markdown, including support for image uploads.
substack-mcp
An MCP server for Substack that lets AI assistants read your publication data and manage drafts.
Safe by design: This server can create and edit drafts but cannot publish or delete posts. You always review and publish manually through Substack's editor.
Tools
Read
Tool | Description |
| Get your publication's current subscriber count |
| List published posts with pagination |
| List draft posts |
| Get full content of a published post by ID |
| Get full content of a draft by ID |
| Get comments on a published post |
Write
Tool | Description |
| Create a new draft from markdown |
| Update an existing draft (unpublished only) |
| Upload an image to Substack's CDN |
| Publish a Substack Note (short-form, publishes immediately) |
| Publish a Note with a link card attachment |
Intentionally excluded
Publish posts — Publishing long-form posts should be a deliberate human action
Delete — Too destructive for an AI tool
Schedule — Use Substack's editor for scheduling
Setup
1. Get your credentials
Open your Substack in a browser, then:
Session token: Navigate to your publication, open DevTools → Application → Cookies → copy the value of
connect.sid(URL-encoded string starting withs%3A)User ID: In DevTools Console, run:
fetch('/api/v1/archive?sort=new&limit=1').then(r=>r.json()).then(d=>console.log(d[0]?.publishedBylines?.[0]?.id))Publication URL: Your Substack URL, including custom domain if you have one (e.g.,
https://newsletter.yourdomain.comorhttps://yourblog.substack.com)
2. Configure your MCP client
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"substack": {
"command": "npx",
"args": ["-y", "@conorbronsdon/substack-mcp"],
"env": {
"SUBSTACK_PUBLICATION_URL": "https://yourblog.substack.com",
"SUBSTACK_SESSION_TOKEN": "your-session-token",
"SUBSTACK_USER_ID": "your-user-id"
}
}
}
}Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"substack": {
"command": "npx",
"args": ["-y", "@conorbronsdon/substack-mcp"],
"env": {
"SUBSTACK_PUBLICATION_URL": "https://yourblog.substack.com",
"SUBSTACK_SESSION_TOKEN": "your-session-token",
"SUBSTACK_USER_ID": "your-user-id"
}
}
}
}3. Verify
Ask your AI assistant: "How many Substack subscribers do I have?"
Token expiration
Substack session tokens expire periodically (typically ~90 days). If you get authentication errors, grab a fresh connect.sid cookie from your browser and update the env var. Make sure ad blockers are disabled when copying the cookie.
Markdown support
The create_draft and update_draft tools accept markdown and convert it to Substack's native format. Supported:
Paragraphs, headings (h1–h6)
Bold, italic,
inline codeImages
Bullet and numbered lists
Code blocks (with language)
Blockquotes
Horizontal rules
Important notes
This server uses Substack's unofficial API. It may break if Substack changes their endpoints.
Session tokens are sent as cookies. Keep your
SUBSTACK_SESSION_TOKENsecure.The server validates authentication on startup and will fail fast if your token is expired.
Development
git clone https://github.com/conorbronsdon/substack-mcp.git
cd substack-mcp
npm install
npm run buildRun locally:
SUBSTACK_PUBLICATION_URL=https://yourblog.substack.com \
SUBSTACK_SESSION_TOKEN=your-token \
SUBSTACK_USER_ID=your-id \
npm startDisclaimer
All views, opinions, and statements expressed on this account are solely my own and are made in my personal capacity. They do not reflect, and should not be construed as reflecting, the views, positions, or policies of Modular. This account is not affiliated with, authorized by, or endorsed by Modular in any way.
License
MIT
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/conorbronsdon/substack-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server