Substack API MCP
Enables AI agents to draft, publish, and schedule posts on Substack, bypassing the lack of an official publishing API.
README
Substack API MCP
<p align="center"> <img src="assets/claude-substack.jpg" alt="Claude + Substack" width="720" /> </p>
Substack does not provide a native public API for publishing posts.
But authors who want to draft, publish, and schedule from AI agents (Cursor, Claude, and other MCP hosts) still need a way out. This is the MCP server to publish to Substack via any agent.
Will not start without a valid APISUBSTACK_API_KEY (ask_*). Get API key here: apisubstack.com.
Why this exists
| Reality | What we built |
|---|---|
| No official Substack write/publish API for authors | A posting MCP so agents can create drafts, publish now, and schedule |
| Authors live in the browser editor | Authors publish through their agents instead |
| Session-cookie auth is the practical path today | substack.sid + your publication URL, gated by an API Substack key |
Examples
Tools
| Tool | Description |
|---|---|
test_connection |
Verify substack.sid and return profile |
create_post |
Create draft / publish now / schedule (+ optional tags) |
get_draft |
Fetch draft by id |
update_draft |
Update draft fields |
publish_post |
Publish existing draft |
schedule_post |
Schedule existing draft |
delete_draft |
Delete draft |
list_tags |
List publication tags |
create_tag |
Create tag |
set_tags |
Ensure + attach tags |
get_post_tags |
List tags on a post/draft |
Install
cd /path/to/Substack-API-MCP
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Auth env
- Sign in at apisubstack.com, start the free trial, generate an
ask_*API key. - Copy your Substack
substack.sidcookie:- Open Chrome and sign in to Substack.
- Open DevTools → Application → Cookies.
- Select
https://substack.com(or your publication host, e.g.https://yourname.substack.com). - Find the cookie named
substack.sidand copy its Value.
- Export:
export APISUBSTACK_API_KEY="ask_YOUR_KEY"
export SUBSTACK_PUBLICATION_URL="https://yourname.substack.com"
export SUBSTACK_SID="YOUR_SUBSTACK_SID_VALUE"
# optional
# export SUBSTACK_USER_ID="123456"
Cookies expire. If you get 401/403, refresh substack.sid and try again.
Run
substack-api-mcp
# or
python -m substack_api_mcp
Cursor / Claude Desktop config
See mcp.example.json:
{
"mcpServers": {
"substack-api": {
"command": "/ABSOLUTE/PATH/TO/Substack-API-MCP/.venv/bin/substack-api-mcp",
"args": [],
"env": {
"APISUBSTACK_API_KEY": "ask_YOUR_KEY",
"SUBSTACK_PUBLICATION_URL": "https://yourname.substack.com",
"SUBSTACK_SID": "YOUR_SUBSTACK_SID_VALUE"
}
}
}
}
Use absolute paths. Restart the host after config changes.
License
Use at your own risk. Not affiliated with Substack. Built so authors can publish through their agents when Substack itself does not offer a native publishing API.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.