Substack MCP Server
Enables reading from and optionally drafting to a Substack publication via Claude, using unofficial JSON endpoints and RSS feed.
README
Substack MCP Server
A Model Context Protocol server that lets Claude read from — and optionally draft to — a Substack publication.
Substack has no official public API. This server uses the same unofficial JSON endpoints the Substack website itself calls, plus the public RSS feed. That has two consequences worth knowing up front:
- Read tools work with no login and are reliable.
- Writing (drafts) needs your session cookie, and because it rides on
undocumented endpoints, treat
create_draftas experimental — Substack can change these endpoints without notice.
Tools
| Tool | Auth? | What it does |
|---|---|---|
get_publication_info |
no | Connection check; publication name, URL, latest post. |
list_recent_posts |
no | Recent posts, newest first, with free/paid flag. |
search_posts |
no | Keyword search across your posts. |
get_post |
no | Full content of one post by slug (API, RSS fallback). |
create_draft |
yes | Creates a draft (never publishes). Attaches your author byline. Needs SUBSTACK_SID. |
list_drafts |
yes | Lists your unpublished drafts with edit URLs. |
create_note |
yes | Publishes a plain-text Note. Live/public — no draft step. |
create_note_with_link |
yes | Publishes a Note with a link-preview card. Live/public. |
create_note_with_image |
yes | Publishes a Note with an uploaded image. Live/public. |
A local .env file (next to server.py) is loaded automatically, so you can
keep SUBSTACK_PUBLICATION / SUBSTACK_SID there for local runs instead of
exporting them by hand. Copy .env.example to .env to start.
Setup
cd substack-mcp
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
Set your publication (subdomain only):
export SUBSTACK_PUBLICATION=your-subdomain
python server.py # should start and wait silently on stdio
Ctrl-C to stop. If it exits with an error about SUBSTACK_PUBLICATION, that
variable isn't set.
Connect it to Claude Code
From the repo directory:
claude mcp add substack \
--scope user \
--env SUBSTACK_PUBLICATION=your-subdomain \
-- /absolute/path/to/substack-mcp/.venv/bin/python /absolute/path/to/substack-mcp/server.py
Then claude mcp get substack should show ✔ Connected. The write tools read
SUBSTACK_SID from your local .env (see below), so it never lands in config.
Connect it to Claude Desktop
Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add (use absolute paths, and your venv's python if you made one):
{
"mcpServers": {
"substack": {
"command": "/absolute/path/to/substack-mcp/.venv/bin/python",
"args": ["/absolute/path/to/substack-mcp/server.py"],
"env": {
"SUBSTACK_PUBLICATION": "your-subdomain",
"SUBSTACK_SID": ""
}
}
}
}
Fully quit and reopen Claude Desktop. You should see the substack tools appear.
Try: "Use the substack tools to list my 5 most recent posts."
Enabling the write tools (optional)
The write tools (create_draft, create_note, create_note_with_link,
create_note_with_image, list_drafts) act on your behalf, so they need proof
you're logged in. There's no API key, so it uses your browser session cookie:
- Log into Substack in your browser.
- Open DevTools → Application (Chrome) / Storage (Firefox) → Cookies →
https://substack.com. - Copy the value of the
substack.sidcookie. - Copy
.env.exampleto.envand paste it afterSUBSTACK_SID=.
Security notes: this cookie is equivalent to your login — anyone with it can
act as you. It lives only in your local .env (git-ignored). Don't commit it,
don't paste it into chats, and rotate it (log out / back in) if it leaks. It
expires periodically; when a write tool starts returning auth errors, refresh it.
⚠️ Notes publish immediately.
create_draftonly ever makes a draft you publish yourself, butcreate_note*post to your public Notes feed the moment they run — there is no draft step. Treat them as a real send.
Limitations & notes
- Draft and note bodies convert plain paragraphs (blank-line separated) into Substack's editor format — no bold/italic/headings yet. Drafts are meant to seed a post you finish in the editor.
- Paywalled post bodies only come through in full when authenticated; otherwise you get the free preview.
- The unofficial endpoints can change without notice. If a read tool starts
failing, the
/api/v1/archiveshape or/feedis the first thing to check.
Extending it
Natural next tools: list_comments(slug), delete_note(id), scheduling, or
richer Markdown→ProseMirror conversion (bold/italic/links/headings). Each is a
new @mcp.tool() function in server.py.
Support
Every tool here started as a mess in my own week — a client problem I kept solving by hand, until I built something that could run it for me. I ship them open, MIT, because a tool you can hand to someone else is the only proof the thinking was real.
A coffee keeps the tools free and maintained, and funds the next one — built in the open.
Disclaimer
This project is not affiliated with or endorsed by Substack. It uses undocumented endpoints that may change or break at any time. Use at your own risk, and in line with Substack's terms of service.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。