# Substack MCP CLI MCP server

> Enables AI agents to manage Substack drafts, posts, subscribers, analytics, and research other writers using Substack's native document format.

- Repository: https://github.com/thenavidm/substack-mcp-cli
- Page: https://hostedmcp.org/servers/thenavidm/substack-mcp-cli
- Transport: stdio
- Stars: 1
- License: MIT

## Install

### Claude Code

```sh
claude mcp add substack-mcp-cli -- npx -y @thenavidm/substack-mcp-cli
```

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

```json
{
  "mcpServers": {
    "substack-mcp-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@thenavidm/substack-mcp-cli"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "substack-mcp-cli": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@thenavidm/substack-mcp-cli"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"substack-mcp-cli","type":"stdio","command":"npx","args":["-y","@thenavidm/substack-mcp-cli"]}'
```

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

```json
{
  "mcpServers": {
    "substack-mcp-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@thenavidm/substack-mcp-cli"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add substack-mcp-cli -- npx -y @thenavidm/substack-mcp-cli
```

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

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

### Gemini CLI

```sh
gemini mcp add -s user substack-mcp-cli npx -- -y @thenavidm/substack-mcp-cli
```

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

```json
{
  "mcpServers": {
    "substack-mcp-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@thenavidm/substack-mcp-cli"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SUBSTACK_AUDIT_LOG` | no | no |  |
| `SUBSTACK_PUBLICATIONS` | no | no |  |
| `SUBSTACK_PUBLICATION_URL` | no | no |  |
| `SUBSTACK_READ_ONLY` | no | no |  |
| `SUBSTACK_SESSION_TOKEN` | no | no |  |

## Tools (65)

- `create_draft`
- `update_draft`
- `get_draft`
- `list_drafts`
- `delete_draft`
- `publish_draft`
- `schedule_draft`
- `unschedule_draft`
- `list_scheduled_posts`
- `set_draft_body`
- `preview_draft_body`
- `get_sections`
- `list_posts`
- `get_post`
- `get_post_by_id`
- `search_posts`
- `get_post_stats`
- `rank_posts`
- `publish_note`
- `publish_note_with_link`
- `schedule_note`
- `list_scheduled_notes`
- `cancel_scheduled_note`
- `list_notes`
- `delete_note`
- `list_subscribers`
- `export_subscribers`
- `get_subscriber_count`
- `add_subscriber`
- `get_analytics`
- `get_dashboard_summary`
- `get_email_stats`
- `get_revenue_summary`
- `get_growth_sources`
- `list_publication_tags`
- `create_tag`
- `get_post_tags`
- `add_tag_to_post`
- `remove_tag_from_post`
- `get_post_comments`
- `comment_on_post`
- `delete_comment`
- `list_subscriptions`
- `list_reader_posts`
- `get_reader_post`
- `get_reader_feed`
- `get_profile_feed`
- `get_comment_thread`
- `restack_note`
- `get_publication_settings`
- `update_publication_settings`
- `get_user_profile`
- `search_publications`
- `get_publication_info`
- `list_contributors`
- `get_import_status`
- `list_templates`
- `create_template`
- `delete_template`
- `create_draft_from_template`
- `research_creator_posts`
- `research_creator_notes`
- `compare_publications`
- `scrape_post`
- `upload_image`

## FAQ

### Does Substack have a public API?

No, Substack does not have a public API or OAuth, which is why this server uses your browser session cookie to interact with the platform.

### How do I connect my Substack account?

You can connect by running the login command and providing your publication URL and session cookie, using Playwright to extract it from Chrome, or by setting environment variables.

### Can I use this with a custom domain?

No, you must use your canonical .substack.com address because Substack does not serve its API on custom domains.

### Is it safe to publish posts via the AI?

Yes, the server includes safeguards where publishing, deleting, and posting Notes require your approval in the client.
