@modelcontextprotocol/sdk and ships both transports the specification defines — stdio for a locally spawned subprocess, and streamable HTTP for a URL a remote host connects to.
The MCP server obeys the same boundary as every other Avocado surface. Its 49 tools all bottom out in typed content operations against the orchestrator. There is no tool for editing a file, adding a dependency, or changing a route — an agent driving this server cannot reach your codebase.
How it fits together
The MCP server is a thin wrapper with no state of its own. Every content mutation is sent to the orchestrator’sPOST /ops, so Zod validation, the undo stack, the version log and demo-mode gating all still apply. Everything else — history, publishing, media, screenshots — is a call to the matching orchestrator route.
Each install is bound to exactly one site. The (session, siteId) pair comes from environment variables at launch, so tools never take a session or site argument.
Two transports
Both entry points register the identical tool set, so nothing about the catalogue below depends on which one you pick.
Connect it
The generic stdio launch spec
Most hosts that spawn a local MCP server want the same three things. The file they live in and the key they sit under differ per host, so check your host’s own documentation for where to put this — the values themselves do not change.
If your host prefers an installed binary to
npx, install the package and point it at the avocado-mcp bin instead:
- JSON config file
- Claude Code CLI
- Your own MCP client
Many hosts (Claude Desktop among them) take an On Claude Desktop that file is
mcpServers object in a JSON config file:~/Library/Application Support/Claude/claude_desktop_config.json on macOS. Restart the app after editing it, then open Settings → Connectors → avocado-studio to set per-tool permissions. The discovery and get tools are safe to auto-allow; keep mutations on Ask.Other hosts use the same object under a different filename, or a different key name entirely. The command / args / env triple is what carries over.Streamable HTTP
Start the HTTP server. A bearer token is mandatory — the process refuses to start without one.avocado-studio MCP server listening on http://localhost:4300/mcp (siteId: your-site-id).
Connection details, for any host:
Verify it with a raw JSON-RPC call before pointing a host at it:
Environment variables
Tool catalogue
49 tools in 12 groups. Every one is scoped to the bound(session, siteId).
Looking for
avocado-scope-url? It is now
npx avocado-scope <url>. It was the only
tool here needing no orchestrator, no session and no site — and the question it
answers is asked before Avocado is installed, so putting it behind a
configured MCP server was backwards.Discovery
Call these first. They read the block manifest from the orchestrator, which is the process that actually runs your site’sregisterBlocks(), so they report your own custom blocks and not Avocado’s built-ins.
If the manifest cannot be read, both tools fall back to the MCP server’s own built-in registry and say so in a
warning field. Treat a warned answer as a guess, not as your site’s catalogue.
Session
Quality assurance
This is the tool an agent should call before reporting an integration as done. A site can build cleanly, serve a valid manifest, pass type checking and still hand a marketer a property panel whose rows all read
Item 4. Nothing else in the toolchain looks for that.
It errors rather than guessing when the manifest is unreadable — a QA check that silently measured the wrong site’s blocks would report an all-clear on a panel nobody has looked at.
Its companion check, editableCoverage, measures the preview rather than the panel and runs site-side. See coverage checks for both, and for what the numbers mean.
Pages
Batch and validation
Blocks and list items
Target list items by
itemId rather than index wherever you can. Ids survive sibling inserts and removals; indexes do not.
Site and theme
Media
Publishing
History
Planner
Preview
Tools can disappear, on purpose
Eight of the 49 are gated on what the site’s content adapter says it can honour. On a CMS-routed site where pages are created in the CMS and not by Avocado,avocado-create-page would apply cleanly to the draft, preview correctly, and then fail the entire publish transaction. So the server asks, and hides what the site has refused.
Three things follow from how that is built, and they matter if you are debugging a tool list:
- Every tool registers first, unconditionally. Registration never waits on the network, or the server would fail to start whenever the site is down. Gated tools are disabled afterwards, once the site answers, and the SDK emits
tools/list_changed. - Silence is permission. An unreachable orchestrator, an older one, and an adapter that declared nothing all produce the same answer: unknown, and unknown permits.
- A gated tool refuses at call time too, with text explaining why, because some hosts cache the tool list and ignore
tools/list_changed.
avocado-whoami reports the current capability answer.
How agents should use it
1
Confirm the session
Call
avocado-whoami. Check source: if it says demo or unknown-site, stop and fix the AVOCADO_SITE_ID before editing anything. Everything after this point applies to whatever session you are actually bound to.2
Discover the blocks
Call
avocado-list-block-types once, then avocado-get-block-schema for any type you are about to add or edit. On a site with custom blocks, the schema is the only place the real prop shape exists. If either answer carries a warning, the manifest could not be read and the list is not your site’s.3
Read before you mutate
Call
avocado-list-pages, then avocado-get-page for block ids and item ids. Ids are stable and opaque; positions are not.4
Prefer the structural op
avocado-update-list-item with an id and a patch is cheaper and safer than replacing a whole list through avocado-update-block-props. avocado-reorder-list-items and avocado-reorder-blocks beat chains of moves, which compute from stale positions.5
Batch the bulk, dry-run the finicky
Use
avocado-batch-apply for the reliable bulk of a multi-step edit. Probe anything you are unsure about with avocado-dry-run-ops first, or run it as a separate single-op call, so one rejection does not roll back good work.6
Check the editing surface before you report success
Call
avocado-check-editing-surface. Fix what comes back, or list what you are leaving and why. A clean build is not evidence that the panel is usable — see coverage checks.Related
Custom blocks
Register your own components so the discovery tools can describe them.
Coverage checks
editableCoverage and panelCoverage — what avocado-check-editing-surface reports and how to read it.Publishing
What the publish tools diff, and how a partial publish is computed.
Field table
One declaration that feeds the schema, the panel, the projection and the merge.