Substack MCP Server · marcomoauro — Claude Code MCP server: how to install
Connects AI assistants to your Substack publication to publish drafts, review metrics, and segment subscribers directly from chat.
claude mcp add substack-mcp -e SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL> -e SUBSTACK_SESSION_TOKEN=<SUBSTACK_SESSION_TOKEN> -e SUBSTACK_USER_ID=<SUBSTACK_USER_ID> -- npx -y substack-mcpWhat Substack MCP Server does
This server exposes 27 tools to manage a Substack publication from MCP-compatible clients. It lets models write drafts and query subscriber records without opening the author dashboard. Because Substack lacks a public developer API, operations run through an authenticated browser session.
Getting started requires Node.js 22 or Docker alongside three credentials: publication URL, numeric user ID, and a session cookie. The initial draft tool accepts raw text without converting Markdown headings into rich layout, so structured articles require formatted JSON nodes.
What it helps with
- generate and save draft posts directly from assistant prompts
- filter audience records across activity and subscription tiers
- export reader engagement metrics including email opens
- upload article images via direct tool invocations
Example prompts for the agent
- List my five most recent drafts on Substack
- Create a draft post titled 'Weekly Update' with introduction text
- Filter subscribers who hold an active paid subscription plan
How to install Substack MCP Server
Platform CLI
claude mcp add substack-mcp -e SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL> -e SUBSTACK_SESSION_TOKEN=<SUBSTACK_SESSION_TOKEN> -e SUBSTACK_USER_ID=<SUBSTACK_USER_ID> -- npx -y substack-mcpReplace <…> with your own values
Platform CLI
codex mcp add substack-mcp-server --env SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL> --env SUBSTACK_SESSION_TOKEN=<SUBSTACK_SESSION_TOKEN> --env SUBSTACK_USER_ID=<SUBSTACK_USER_ID> -- npx -y substack-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"substack-mcp-server": {
"command": "npx",
"args": [
"-y",
"substack-mcp"
],
"env": {
"SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
"SUBSTACK_SESSION_TOKEN": "<SUBSTACK_SESSION_TOKEN>",
"SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"substack-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"substack-mcp"
],
"env": {
"SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
"SUBSTACK_SESSION_TOKEN": "<SUBSTACK_SESSION_TOKEN>",
"SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL> -e SUBSTACK_SESSION_TOKEN=<SUBSTACK_SESSION_TOKEN> -e SUBSTACK_USER_ID=<SUBSTACK_USER_ID> substack-mcp-server npx -y substack-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Substack MCP Server
What does Substack MCP Server do?
It connects your AI client to Substack using 27 distinct tools. The model can draft articles, inspect subscriber metrics, upload media, and review comments.
How do I install Substack MCP Server in Claude Code?
Run `claude mcp add substack-mcp -e SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL> -e SUBSTACK_SESSION_TOKEN=<SUBSTACK_SESSION_TOKEN> -e SUBSTACK_USER_ID=<SUBSTACK_USER_ID> -- npx -y substack-mcp`.
Where do the required credentials come from?
You find your publication URL, user ID, and substack.sid or connect.sid cookie by inspecting dashboard network requests in browser developer tools while signed in.
Similar MCP servers
Everything for Marketing and content →Substack MCP Server by other authors comes first.