Enables management of Substack publications including creating and publishing posts with cover images, creating short-form notes, retrieving content and comments, and accessing profile information.
Substack MCP Server
An MCP (Model Context Protocol) server that allows Claude Desktop and Claude Code to interact with your Substack publication. Create posts with cover images, publish notes, manage your content, and more - all through natural conversation with Claude.
Features
✅ Post Management: Create full blog posts with cover images
✅ Notes: Create short-form Substack notes
✅ Profile Access: Get your own profile and other users' profiles
✅ Content Retrieval: Fetch posts, notes, and comments
✅ Image Upload: Native Substack image upload (v2.3.0) - no third-party dependencies
✅ Draft Mode: Create drafts for review before publishing
Version 2.3.0 - What's New
This version replaces Imgur with Substack's native image upload:
Native Integration: Direct upload to Substack's CDN (Amazon S3)
Data URI Format: Images encoded as base64 data URIs
Automatic MIME Detection: Supports PNG, JPG, JPEG, GIF, WEBP
Post Association: Images properly linked to posts via
postIdMore Reliable: No third-party API dependencies
Prerequisites
Node.js 18+ installed on your system
Substack account with publication access
Substack API Key (connect.sid cookie value)
Getting Your Substack API Key
The Substack API uses cookie-based authentication:
Login to Substack in your browser
Open Developer Tools (F12 or Right-click → Inspect)
Go to Application/Storage tab → Cookies →
https://substack.comFind the
connect.sidcookie and copy its valueThis value is your
SUBSTACK_API_KEY
⚠️ Important: Keep this cookie value private. Do not commit it to version control.
Cookie Extraction Tools
The tools/ directory contains utility scripts to help extract your Substack cookie:
extract-cookie.js- Manual cookie extraction toolextract-cookie-auto.js- Automated cookie extraction
To use these tools, save your cookie value to tools/cookie.txt (this file is git-ignored for security).
Installation
Building the MCP Server
For Claude Desktop
Open your Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the Substack MCP server configuration:
Replace
your-connect-sid-cookie-value-herewith your actual cookie valueReplace
yoursite.substack.comwith your Substack hostnameRestart Claude Desktop
For Claude Code
Add to your Claude Code MCP configuration or use:
Available Tools
mcp__substack__create_post
Create a full blog post with optional cover image
Parameters:
title(required): Post titlebody(required): Post content (supports markdown)subtitle(optional): Post subtitlecover_image(optional): Path to cover image filedraft(optional): Create as draft (default: true)
Example:
mcp__substack__create_note
Create a new Substack note (short-form post)
Parameters:
text(required): Note content
mcp__substack__create_note_with_link
Create a note with a link attachment
Parameters:
text(required): Note contentlink(required): URL to attach
mcp__substack__get_own_profile
Get your own Substack profile information
Returns: name, slug, handle, bio, follower count, photo URL
mcp__substack__get_profile_posts
Get your recent posts
Parameters:
limit(optional): Number of posts to retrieve (default: 10)
mcp__substack__get_post
Get a specific post by ID with full content
Parameters:
post_id(required): The post ID
mcp__substack__get_post_comments
Get comments for a specific post
Parameters:
post_id(required): The post IDlimit(optional): Number of comments (default: 20)
mcp__substack__get_notes
Get your recent notes
Parameters:
limit(optional): Number of notes (default: 10)
Usage Examples
With Claude Desktop/Code
Once configured, you can have natural conversations with Claude:
Claude will automatically use the appropriate MCP tools to fulfill your requests.
Environment Variables
SUBSTACK_API_KEY(required): Your connect.sid cookie valueSUBSTACK_HOSTNAME(required): Your Substack hostname (e.g., "yourname.substack.com")
Workflow Example
Here's a typical workflow for creating a post with cover image:
Write your article in markdown format
Create or generate a cover image
Tell Claude: "Create a draft post with article.md and cover.png"
Claude will:
Read the markdown file
Upload the cover image to Substack's CDN
Create the draft post with both
Return the draft URL for review
Documentation
CLAUDE.md - Development guidelines for Claude Code
Troubleshooting
"SUBSTACK_API_KEY environment variable is required"
Make sure you've added the SUBSTACK_API_KEY to the env section of your MCP configuration.
"Failed to connect"
Verify your connect.sid cookie value is correct and hasn't expired
Check that you're logged into Substack in your browser
Try getting a fresh cookie value by logging out and back in
MCP server not appearing in Claude Desktop
Check that the path to
mcp-server.jsis correctEnsure Node.js 18+ is installed:
node --versionRun
npm run buildto compile the TypeScriptRestart Claude Desktop after configuration changes
Image upload fails
Ensure the image file exists and is readable
Check that the file format is supported (PNG, JPG, JPEG, GIF, WEBP)
Verify your Substack API key is valid
Development
To extend the MCP server:
Edit
src/mcp-server.tsto add new toolsRun
npm run buildto compile TypeScriptRestart Claude Desktop/Code to load changes
Testing
Security Notes
Never commit your connect.sid cookie value to version control
Store your API key securely using environment variables
The cookie value gives full access to your Substack account
Regularly refresh your cookie value for security
Version History
v2.3.0 (Nov 2025): Native Substack image upload, replaces Imgur
v2.2.0: Added Imgur-based cover image upload
v2.1.0: Added create_post tool with ProseMirror support
v2.0.0: Initial MCP server implementation
License
MIT - See LICENSE file for details
Credits
Built on top of the substack-api TypeScript client.
MCP server and image upload implementation by Daniel Simon Jr.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Enables interaction with Substack publications through natural conversation, allowing users to create posts with cover images, publish notes, manage content, and retrieve profile information.
- Features
- Version 2.3.0 - What's New
- Prerequisites
- Getting Your Substack API Key
- Installation
- Available Tools
- Usage Examples
- Environment Variables
- Workflow Example
- Documentation
- Troubleshooting
- Development
- Security Notes
- Version History
- License
- Credits