squarespace

A reference guide for saving Squarespace page content through an application programming interface, which lets software read and update site data.

In plain words
What is it for?
It is for agents working with the Squarespace Content Save API, including reading sections, updating blocks, and preserving required layout fields.
Why use it?
It documents the required session checks and read-modify-write process, reducing errors when changing page sections.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/timncox/squarespace-mcp/squarespace
Clone the repo
git clone --depth 1 https://github.com/timncox/squarespace-mcp

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,870 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.03870
Opus 5 $0.00000 $0.01935
Sonnet 5 $0.00000 $0.00774
Haiku 4.5 $0.00000 $0.00387

Measured 2d ago against content hash 65d309d8f93c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

squarespace 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 2d ago.

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/agents/squarespace.md · 272 lines

How it starts

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

Squarespace Content Save API — Agent Reference

Reference for agents working with the Squarespace API layer. All methods are on ContentSaveClient in src/services/content-save.ts. Types in src/services/content-save-types.ts.

Authentication

  • Session file: storage/auth/sqsp-session.json (Playwright session export)
  • Crumb token: Extracted from site-specific cookies (NOT account.squarespace.com)
  • Pre-flight: ContentSaveClient.checkSessionHealth() — checks existence, age, crumb
  • Factory: createContentSaveClient(subdomain) — loads cookies automatically
  • Sessions work 90+ hours but warn after 24h

Read-Modify-Write Pattern

All block/section modifications follow this pattern:

1. GET  /api/page-sections/{pageSectionsId}          → read current sections
2. Modify sections JSON in memory
3. PUT  /api/page-sections/{pageSectionsId}/collection/{collectionId}  → save

CRITICAL: PUT validates ALL blocks. Missing verticalAlignment or zIndex on ANY block causes 400 errors. Always backfill before PUT:

for (const gc of section.gridContents) {
  if (gc.layout?.desktop && !gc.layout.desktop.verticalAlignment) {
    gc.layout.desktop.verticalAlignment = 'top';
  }
  if (gc.layout?.desktop && gc.layout.desktop.zIndex == null) {
    gc.layout.desktop.zIndex = 0;
  }
}

Block Type Reference

Type ID Name Add Method Update Method Find-By Strategy
2 Text addTextBlock() updateTextBlock() / patchTextBlock() Stripped HTML text match
18 Menu updateMenuBlock() Raw text, tab/section/item titles
23 Code addCodeBlock() updateCodeBlock() Code content match
44 Quote addQuoteBlock() updateQuoteBlock() Quote text / attribution
46 Button (legacy) addButtonBlock() updateButtonBlock() Label text match
1337 Button (new) addButtonBlock() updateButtonBlock() buttonText/buttonLink match (definitionName: website.components.button)
1337 Image addImageBlock() / addImageBlockBatch() updateImageBlock() title/description/altText
8 Gallery
52 Divider addDividerBlock()
50 Video addVideoBlock() updateVideoBlock() title/url match

Read the full file on GitHub · 272 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. 2d ago First seen · 272 lines · 0 tokens per session scan A 65d309d8f93c

Subscribe to this mod's changes

squarespace is an agent published in the GitHub repository timncox/squarespace-mcp (2 stars, last pushed 25d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,870 tokens. 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-31.