# substack-ops MCP server

> Lets an AI client manage Substack publications by drafting replies, managing comments, and automating notes and restacks.

- Repository: https://github.com/06ketan/substack-ops
- Page: https://hostedmcp.org/servers/06ketan/substack-ops
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.3.5

## Install

### Claude Code

```sh
claude mcp add --env 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' substack-ops -- uvx substack-ops
```

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

```json
{
  "mcpServers": {
    "substack-ops": {
      "command": "uvx",
      "args": [
        "substack-ops"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "substack-ops": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "substack-ops"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"substack-ops","type":"stdio","command":"uvx","args":["substack-ops"],"env":{"SUBSTACK_SESSION_TOKEN":"<YOUR_SUBSTACK_SESSION_TOKEN>"}}'
```

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

```json
{
  "mcpServers": {
    "substack-ops": {
      "command": "uvx",
      "args": [
        "substack-ops"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add substack-ops --env 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' -- uvx substack-ops
```

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

```toml
[mcp_servers.substack-ops]
command = "uvx"
args = ["substack-ops"]

[mcp_servers.substack-ops.env]
SUBSTACK_SESSION_TOKEN = "<YOUR_SUBSTACK_SESSION_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'SUBSTACK_SESSION_TOKEN=<YOUR_SUBSTACK_SESSION_TOKEN>' substack-ops uvx -- substack-ops
```

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

```json
{
  "mcpServers": {
    "substack-ops": {
      "command": "uvx",
      "args": [
        "substack-ops"
      ],
      "env": {
        "SUBSTACK_SESSION_TOKEN": "<YOUR_SUBSTACK_SESSION_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SUBSTACK_SESSION_TOKEN` | no | yes | Your Substack session cookie value (the s%3A... string). Required for authenticated calls. Easier path: run `substack-ops auth login --browser chrome` and the cookie is auto-grabbed. |
| `SUBSTACK_OPS_LLM_CMD` | no | no | Optional: override the host CLI used by the unattended daemon path (default: auto-detect claude / cursor-agent / codex on PATH). Use {prompt} placeholder if your CLI takes the prompt as an arg. |
| `SUBSTACK_OPS_MCP_PATH` | no | no | Override path to the mcp.json file the auth layer reads. Defaults to ~/.cursor/mcp.json. |
| `SUBSTACK_PUBLICATION_URL` | no | no | Your Substack publication URL (e.g. https://you.substack.com/). Optional if set in ~/.cursor/mcp.json's mcpServers.substack-api.env. |
| `SUBSTACK_USER_ID` | no | no | Your Substack numeric user id. Optional if set in ~/.cursor/mcp.json. |

## FAQ

### Does this require an API key?

No, it uses your existing Substack authentication and does not require any additional AI API keys.
