# Substack MCP server

> Lets an AI client create and manage Substack drafts, publish Notes, search posts, inspect analytics, and handle consented subscribers across publications.

- Repository: https://github.com/conorbronsdon/substack-mcp
- Page: https://hostedmcp.org/servers/conorbronsdon/substack-mcp
- Transport: stdio
- Stars: 48
- License: MIT
- Latest version: 1.3.0

## Install

### Claude Code

```sh
claude mcp add --env 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' --env 'SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL>' --env 'SUBSTACK_USER_ID=<SUBSTACK_USER_ID>' substack-mcp -- npx -y @conorbronsdon/substack-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "substack-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@conorbronsdon/substack-mcp"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>",
        "SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
        "SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "substack-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@conorbronsdon/substack-mcp"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>",
        "SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
        "SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"substack-mcp","type":"stdio","command":"npx","args":["-y","@conorbronsdon/substack-mcp"],"env":{"SUBSTACK_SESSION_TOKEN":"<YOUR_SUBSTACK_SESSION_TOKEN>","SUBSTACK_PUBLICATION_URL":"<SUBSTACK_PUBLICATION_URL>","SUBSTACK_USER_ID":"<SUBSTACK_USER_ID>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "substack-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@conorbronsdon/substack-mcp"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>",
        "SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
        "SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add substack-mcp --env 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' --env 'SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL>' --env 'SUBSTACK_USER_ID=<SUBSTACK_USER_ID>' -- npx -y @conorbronsdon/substack-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.substack-mcp]
command = "npx"
args = ["-y", "@conorbronsdon/substack-mcp"]

[mcp_servers.substack-mcp.env]
SUBSTACK_SESSION_TOKEN = "<YOUR_SUBSTACK_SESSION_TOKEN>"
SUBSTACK_PUBLICATION_URL = "<SUBSTACK_PUBLICATION_URL>"
SUBSTACK_USER_ID = "<SUBSTACK_USER_ID>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' -e 'SUBSTACK_PUBLICATION_URL=<SUBSTACK_PUBLICATION_URL>' -e 'SUBSTACK_USER_ID=<SUBSTACK_USER_ID>' substack-mcp npx -- -y @conorbronsdon/substack-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "substack-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@conorbronsdon/substack-mcp"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>",
        "SUBSTACK_PUBLICATION_URL": "<SUBSTACK_PUBLICATION_URL>",
        "SUBSTACK_USER_ID": "<SUBSTACK_USER_ID>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SUBSTACK_SESSION_TOKEN` | yes | yes | connect.sid cookie value from your Substack session |
| `SUBSTACK_PUBLICATION_URL` | yes | no | Your Substack publication URL (e.g., https://yourblog.substack.com) |
| `SUBSTACK_USER_ID` | yes | no | Your Substack user ID |
| `SUBSTACK_PUBLICATION_URL` | no | no |  |
| `SUBSTACK_PUB_KEVIN_MULDOON_PUBLICATION_URL` | no | no |  |
| `SUBSTACK_PUB_KEVIN_MULDOON_SESSION_TOKEN` | no | no |  |
| `SUBSTACK_PUB_KEVIN_MULDOON_USER_ID` | no | no |  |
| `SUBSTACK_PUB_SAPERE_PUBLICATION_URL` | no | no |  |
| `SUBSTACK_PUB_SAPERE_SESSION_TOKEN` | no | no |  |
| `SUBSTACK_PUB_SAPERE_USER_ID` | no | no |  |
| `SUBSTACK_REQUEST_TIMEOUT_MS` | no | no |  |
| `SUBSTACK_SESSION_TOKEN` | no | no |  |
| `SUBSTACK_USER_AGENT` | no | no |  |
| `SUBSTACK_USER_ID` | no | no |  |

## Tools (42)

- `get_subscriber_count`
- `list_subscribers`
- `search_subscribers`
- `get_subscriber`
- `list_published_posts`
- `get_publication`
- `list_publication_tags`
- `get_post_tags`
- `search_posts`
- `plan_draft_update`
- `export_draft`
- `preflight_draft`
- `list_drafts`
- `get_post`
- `get_draft`
- `get_post_comments`
- `get_sections`
- `get_post_analytics`
- `rank_posts`
- `get_publication_stats`
- `get_growth_sources`
- `list_incoming_recommendations`
- `list_outgoing_recommendations`
- `list_outgoing_recommendation_stats`
- `list_scheduled_posts`
- `get_user_profile`
- `get_profile_feed`
- `get_note_thread`
- `list_public_posts`
- `get_public_post`
- `create_draft`
- `update_draft`
- `update_draft_tags`
- `upload_image`
- `create_post_comment`
- `restack`
- `create_note`
- `create_note_with_link`
- `review_draft`
- `what_worked`
- `draft_from_idea`
- `plan_notes`

## FAQ

### Can the Substack MCP server publish my long-form posts?

No. Long-form post tools only create and edit drafts; you review and publish manually through Substack's editor.

### Do Notes created through the server publish immediately?

Yes. Notes have no draft state on Substack, so the Note tools publish publicly right away with no preview or undo.

### How do I authenticate the Substack MCP server?

You can paste credentials as environment variables or run the optional browser login, which stores the session for later use.

### Does it work with multiple Substack publications?

Yes. Named profiles let you store separate sessions and select them with the SUBSTACK_PROFILES environment variable.

### What do I need to run the Substack MCP server?

Node.js 22 or newer is required, and browser login additionally needs Playwright.
