
marcomoauro/substack-mcp 是从 https://github.com/marcomoauro/substack-mcp. 导入的 MCP 服务器候选
概览
marcomoauro/substack-mcp 是从 https://github.com/marcomoauro/substack-mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
一个用于Substack的模型上下文协议(MCP)服务器,使LLM客户端能够与Substack的API交互,实现诸如创建帖子、管理草稿等自动化。
创建和发布帖子,管理订阅者和分析数据,浏览读者信息流,管理 标签和评论,以及上传图片——27个工具通过一个MCP服务器暴露。
[!重要] Substack 不提供这些操作的公开 API。该服务器使用你认证的 网页会话。会话令牌就像密码一样对待:保持本地,绝不提交,并且 从不在错误报告中包含它或完整的Cookie头。
快速开始
最快的安装方式使用Node.js 22或更新版本和npx。
1.收集你的Substack账号
在浏览器中登录 Substack,打开你的出版仪表盘。你需要三个值:
- 出版物URL——例如,您的出版物的完整基础URL。
https://your-publication.substack.com。 - 会话令牌 — 打开浏览器开发工具,选择Network,筛选至 取取/XHR,重新加载仪表盘。向你的 出版。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Substack MCP Server
A Model Context Protocol (MCP) Server for Substack enabling LLM clients to interact with Substack’s API for automations like creating posts, managing drafts, and more.
Create and publish posts, work with subscribers and analytics, browse your reader feeds, manage tags and comments, and upload images — 27 tools exposed through one MCP server.
[!IMPORTANT] Substack does not provide a public API for these operations. This server uses your authenticated web session. Treat the session token exactly like a password: keep it local, never commit it, and never include it or a complete Cookie header in a bug report.
Quick start
The fastest installation uses Node.js 22 or newer and npx.
1. Collect your Substack credentials
Sign in to Substack in your browser and open your publication dashboard. You need three values:
- Publication URL — the full base URL of your publication, for example
https://your-publication.substack.com. - Session token — open your browser’s developer tools, select Network, filter to
Fetch/XHR, and reload the dashboard. Open a successful authenticated request to your
publication. Under Request Headers, find the
Cookieheader and locate a session cookie namedsubstack.sidorconnect.sid. Copy its value without the cookie name or the rest of the header. If both names appear with different values, test them separately and locally with the read-only verification in step 3; never paste either value into an issue. - User ID — in the same Network panel, search for a successful
publication_userrequest. In its JSON response, copy the numericidinside theuserobject.
If the browser UI differs, the illustrated credential guide shows the same requests. If authentication later stops working, sign in again and repeat these steps to obtain the current token.
2. Add the server to your MCP client
For clients that accept MCP JSON configuration, add:
{
"mcpServers": {
"substack": {
"command": "npx",
"args": ["-y", "substack-mcp@latest"],
"env": {
"SUBSTACK_PUBLICATION_URL": "https://your-publication.substack.com",
"SUBSTACK_SESSION_TOKEN": "your-session-token",
"SUBSTACK_USER_ID": "your-user-id"
}
}
}
}
Replace the three example values, save the configuration, and restart your MCP client. Consult your client’s documentation if it uses a different configuration format.
3. Verify the connection
Ask your client:
List my five most recent Substack drafts.
安装
npx -y substack-mcp@latest配置
{
"mcpServers": {
"substack": {
"command": "npx",
"args": ["-y", "substack-mcp@latest"],
"env": {
"SUBSTACK_PUBLICATION_URL": "https://your-publication.substack.com",
"SUBSTACK_SESSION_TOKEN": "your-session-token",
"SUBSTACK_USER_ID": "your-user-id"
}
}
}
}