alxgntv GitHub avatar

substack-api-mcp

alxgntv

An MCP server that enables AI agents (Claude, Cursor) to draft, publish, and schedule posts on Substack using a third-party API key and Substack cookie authentication.

Stars

69

7-day growth

No data

Forks

0

Open issues

2

License

No data

Last updated

2026-07-28

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It fills the gap left by Substack's lack of a native publishing API, allowing authors to automate content workflows through AI agents.

Who it is for

  • Substack authors who use AI coding agents
  • Developers building AI-powered content automation
  • Power users of Claude, Cursor, and other MCP hosts
  • Content creators seeking to streamline publishing

Use cases

  • Drafting and publishing posts via AI agents
  • Scheduling posts for future publication
  • Managing tags and metadata on posts
  • Integrating Substack publishing into automated workflows

Strengths

  • Provides a comprehensive set of tools (create, publish, schedule, tags)
  • Works seamlessly with popular MCP hosts like Claude Desktop and Cursor
  • Uses existing Substack authentication (cookie) without requiring official API
  • Offers a free trial for the required API key

Considerations

  • Relies on a third-party API service (apisubstack.com) and Substack cookie, which expires
  • Not an official Substack solution; use at your own risk
  • Requires manual extraction and refreshing of the substack.sid cookie

README quick start

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

RealityWhat we built
No official Substack write/publish API for authorsA posting MCP so agents can create drafts, publish now, and schedule
Authors live in the browser editorAuthors publish through their agents instead
Session-cookie auth is the practical path todaysubstack.sid + your publication URL, gated by an API Substack key

Examples

Tools

ToolDescription
test_connectionVerify substack.sid and return profile
create_postCreate draft / publish now / schedule (+ optional tags)
get_draftFetch draft by id
update_draftUpdate draft fields
publish_postPublish existing draft
schedule_postSchedule existing draft
delete_draftDelete draft
list_tagsList publication tags
create_tagCreate tag
set_tagsEnsure + attach tags
get_post_tagsList 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

  1. Sign in at apisubstack.com, start the free trial, generate an ask_* API key.
  2. Copy your Substack substack.sid cookie:
    • Open Chrome and sign in to Substack.
    • Open DevTools → ApplicationCookies.
    • Select https://substack.com (or your publication host, e.g. https://yourname.substack.com).
    • Find the cookie named substack.sid and copy its Value.
  3. 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.

Description

MCP server for Substack posts (FastMCP + substack-api-client)

Related repositories

Similar projects matched by category, topics, and programming language.

gavamedia
Featured
gavamedia GitHub avatar

deltafin

Deltafin is a research project that runs the 2.8-trillion-parameter Mixture-of-Experts model Kimi K3 on a single Apple Silicon Mac (e.g., M1 Max with 64 GB) at about 16 seconds per token, using exact, reproducible inference with local or streaming expert loading.

AI & Machine LearningLarge Language Models
304
mereyabdenbekuly-ctrl
Featured
mereyabdenbekuly-ctrl GitHub avatar

clodex-ide

Clodex is an open-source, local-first agentic IDE that combines persistent AI tasks, code, terminal, browser, Git, models, memory, and governed execution in one Electron workspace, currently in technical preview.

AI & Machine LearningAI Agents
859
0xwilliamortiz
Featured
0xwilliamortiz GitHub avatar

openclaude-improved

OpenClaude is an open-source CLI coding agent that runs on any platform and supports a wide range of LLM providers, offering the same tools and workflows as Claude Code.

AI & Machine LearningLarge Language Models
577