The Sanity connector: talking to your CMS from Claude
This post was written from my phone. Not typed on it. I opened the Claude app, asked for a post about the Sanity connector, and the draft appeared in my Sanity project a minute later, with a title, a slug, an excerpt and a body that fits the schema. I read it on the sofa, changed a few sentences, and pressed Publish. The site rebuilt itself.
That is the whole pitch, so let me explain the pieces, because the names are confusing.
Connector, MCP, plugin: one thing, three doors
Sanity runs a hosted MCP server. MCP is a small open standard for letting an AI assistant call tools: query documents, create a draft, upload an image, publish. The server knows your schema, so when Claude creates a post it creates a post with your fields, not a blob of text.
The connector is that same server, listed in Claude's connector directory so you can add it with a click and sign in with your Sanity account. No token to copy, nothing to install. Once added, it follows your Claude account to the desktop app, the web and the phone. The Claude Code plugin is the same server again, packaged for the terminal, with written guidance on schemas, migrations and frameworks so the assistant knows the conventions before it touches anything.
Three doors into one room. Your Sanity role applies behind all of them. An editor through the connector is still an editor, a viewer is still a viewer, and every change shows up in the document history under your name.
Why it works better than it sounds
Chatbots that write blog posts are not new and mostly produce text you paste somewhere. The difference here is structure. Sanity stores content as data with a schema, and the connector reads that schema first. So the assistant does not produce a paragraph with a headline in it; it produces a document with a title field, a slug that follows your rules, an excerpt at the length you set, a body in Portable Text with real headings, and an image with alt text because your schema requires alt text.
It also reads before it writes. When I asked for a post in the same style as the existing ones, it queried the existing posts. When I added a table block to the schema, it used tables in the next post. When I want an image, it fetches one from a URL into the asset store, waits for Sanity to extract the dimensions and blur placeholder, and references the asset properly.
And it goes both ways. The audit questions are the ones I would never get round to: which posts have no excerpt, which images are missing alt text, what is in the next release and are any required fields empty. Those are one sentence each now.
The workflow I have settled on
| Step | Tool | What happens |
|---|---|---|
| Idea | Claude app, any device | One message: topic, angle, whether I want a table or an image. |
| Draft | Connector | A draft document appears in Sanity, matching the schema. |
| Edit | Sanity Studio | I read it as a human, cut what I disagree with, fix the voice. |
| Publish | Sanity Studio | Manual, on purpose. The button stays mine. |
| Site update | Webhook | Publish triggers a rebuild; the static site updates in about a minute. |
| Code changes | Claude Code on the dev box | Schema, templates and deploys happen in the terminal, in git. |
The line I keep is that drafting is shared and publishing is not. Sanity has no role that allows writing drafts but forbids publishing, so this is a habit rather than a setting. For a client site I would say it out loud in the hand-over.
The tooling is not what makes this work. What makes it work is that the content is structured enough for an assistant to be useful rather than decorative, and the connector makes that available from a phone with one login. For a one-person blog, that is the difference between writing four posts a month and writing four posts a year.