substack-mcp: Instructions file for Claude Code

CLAUDE.md

substack-mcp CLAUDE.md is an instructions file for Claude Code from conorbronsdon/substack-mcp. It costs 803 tokens per session, scanned A, original, MIT.

Instructions for an MCP server that connects coding agents to Substack, a publishing platform for newsletters and posts. It supports reading posts, managing drafts, and creating short notes, while posts cannot be published or deleted through it.

In plain words
What is it for?
It helps read Substack posts, create or edit post drafts, and publish short notes, including notes with links.
Why use it?
It makes the allowed Substack actions and their limits clear, helping prevent accidental publishing or deletion and ensuring content uses the expected editor format.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is conorbronsdon/substack-mcp's own configuration. It tells Claude Code how to work on substack-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything substack-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to conorbronsdon/substack-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/conorbronsdon/substack-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/conorbronsdon/substack-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for substack-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/conorbronsdon/substack-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/conorbronsdon/substack-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/conorbronsdon/substack-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/conorbronsdon/substack-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for substack-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/conorbronsdon/substack-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/conorbronsdon/substack-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 803 This file is loaded in full into every session.
When invoked 803 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00803 $0.00803
Opus 5.5 $0.00321 $0.00321
Sonnet 5.5 $0.00161 $0.00161
Haiku 4.5 $0.00080 $0.00080

Measured today against content hash 8c5620beda8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

substack-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

substack-mcp

MCP server for Substack — read posts, manage drafts, create notes. Cannot publish or delete posts by design; notes (short-form) publish immediately since Substack has no note-draft state.

Architecture

  • src/index.ts — MCP server bootstrap and entry point; picks stdio (default) or HTTP transport via MCP_TRANSPORT
  • src/transport/http.ts — Stateless Streamable HTTP transport (POST /mcp, GET /health) for persistent/networked deployments
  • src/server.ts — Tool registration, request handlers, Zod schema generation; createServer(publications: PublicationConfig[]) takes one client per configured publication
  • src/annotations.ts — Tool side-effect classification (read / draft-write / public-upload / publish) → MCP annotations (hints set explicitly; MCP defaults omitted hints to the unsafe direction)
  • src/auth/resolve-credentials.ts — Single-publication env-var + stored-session credential resolution (the original, still-supported contract)
  • src/auth/resolve-publications.ts — Multi-publication credential resolution (SUBSTACK_PUB_<KEY>_* env vars), falling back to resolve-credentials.ts when none are set
  • src/api/client.ts — HTTP client for Substack API (session cookie auth)
  • src/api/types.ts — TypeScript interfaces for API responses
  • src/utils/errors.ts — Error handling utilities
  • src/utils/markdown-to-prosemirror.ts — Markdown to ProseMirror AST converter (Substack editor format)
  • src/__tests__/ — Vitest tests for client, errors, and markdown conversion

Key constraints

  • Posts are read/draft only — no publish or delete capabilities by design
  • Notes publish immediately via create_note / create_note_with_link — Substack has no note-draft state, so there is no preview step
  • Auth sends both connect.sid and substack.sid cookies set to the same session token (custom domains use their own connect.sid; substack.com's substack.sid is a different session rejected by a custom domain)
  • Markdown must be converted to ProseMirror format for Substack's editor
  • Community writes: see docs/community-writes.md. Comments use the selected publication; restacks use a separately configured reader session and explicit account ID. Both preview by default, require exact per-call consent, and are disabled for live writes unless explicitly enabled.
  • With 2+ publications configured (SUBSTACK_PUB_<KEY>_*), every publication tool gains a required publication enum parameter — no default, no guessing. With exactly one publication configured, no publication parameter is added at all (schema-identical to single-publication mode)

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +1 lines · +53 tokens per session 8c5620beda8d
  2. 25d ago Changed · +11 tokens per session 86ebee642082
  3. 1mo ago Changed · -1 lines · -4 tokens per session d0c1d00decf9
  4. 1mo ago Changed a2af91e2609d
  5. 1mo ago Changed · +4 lines · +198 tokens per session 40d4cea68532
  6. 1mo ago First seen · 41 lines · 545 tokens per session scan A cc8291f01ccf

Subscribe to this mod's changes

substack-mcp CLAUDE.md is an instructions file published in the GitHub repository conorbronsdon/substack-mcp (44 stars, last pushed yesterday), licensed MIT. It adds 803 tokens to every session, about $0.0032 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories