
alxgntv/substack-api-mcp 是从 https://github.com/alxgntv/substack-api-mcp. 导入的 MCP 服务器候选
概览
alxgntv/substack-api-mcp 是从 https://github.com/alxgntv/substack-api-mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
Substack 没有提供原生的公开 API 来发布帖子。
但那些想从AI代理(Cursor、Claude及其他MCP主机)起草、发布和调度的作者仍然需要一个出路。这是通过任何代理发布到Substack的MCP服务器。
没有有效的APISUBSTACK_API_KEY](ask_*)无法启动。点击此处获取API密钥:apisubstack.com.
为什么会有这样的存在
| 现实 | 我们所建造的 |
|---|---|
| 没有官方的Substack写/发布作者API | 一个发布MCP,方便代理创建草稿、立即发布和安排 |
| 作者存在于浏览器编辑器中 | 作者通过其代理人发布 |
| 会话 Cookie 认证是当今的实用路径 | substack.sid + 您的发布 URL,由 API 子栈密钥限制 |
示例
工具
| 工具 | 描述 |
|---|---|
test_connection |
验证substack.sid并返回配置文件 |
create_post |
创建草稿 / 立即发布 / 排程(+ 可选标签) |
get_draft |
通过id获取草稿 |
pangram_detection |
全字母句 AI 文本 / AI 草稿检查 |
update_draft |
更新草稿字段 |
publish_post |
发布现有草稿 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Substack API MCP
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 |
pangram_detection |
Pangram AI-text / AI-slop check on a draft |
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 |
create_note |
Create a Substack Note (optional link attachment) |
delete_note |
Delete a Substack Note by id |
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",
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"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"
}
}
}
}