trackmcp
Back to directory
alxgntv

substack-api-mcp

View on GitHub

Move your blog to Substack Newsletter in few clikcs

129 stars PythonOthers Updated Sep 4, 2026

Documentation

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 today`substack.sid` + your publication URL, gated by an API Substack key

Examples

Tools

ToolDescription
`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

Install

bash
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:

    3. Export:

    bash
    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

    bash
    substack-api-mcp
    # or
    python -m substack_api_mcp

    Cursor / Claude Desktop config

    See `mcp.example.json`:

    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",
            "SUBSTACK_SID": "YOUR_SUBSTACK_SID_VALUE"
          }
        }
      }
    }

    Use absolute paths. Restart the host after config changes.

    License

    Attribution-or-Royalty (source available). See `LICENSE` and `COMMERCIAL_LICENSE.md`.

    • Non-commercial use: allowed (keep copyright + license notice).
    • Commercial use: either visible attribution everywhere the software is used, or a paid royalty / commercial license via apisubstack.com.

    Use at your own risk. Not affiliated with Substack. Built so authors can publish through their agents when Substack itself does not offer a native publishing API.

    Frequently asked questions

    What is substack-api-mcp?

    substack-api-mcp is Move your blog to Substack Newsletter in few clikcs

    How do I install substack-api-mcp?

    Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

    Is substack-api-mcp open source?

    Yes — it is hosted on GitHub at https://github.com/alxgntv/substack-api-mcp and has 129 stars.

    Related MCP tools

    Run your own MCP server? See who uses it and what to fix.

    Measure it with TrackMCP