Skip to main content

Connect Sanity to Relato with the Sanity MCP

Attach a Sanity MCP account to Relato so your AI Content Agents turn a project into a Sanity document with a clean field mapping.

Written by David Baum

Connect Sanity so your Relato AI Content Agents can write into your dataset. Once the account is attached, an agent can turn a Relato project into a Sanity document and map each project field onto a field in your schema.

What you can do

With Sanity connected, an agent can:

  • Create a Sanity document from a finished Relato project.

  • Update an existing document when the project changes.

  • Hold a clean field mapping between project fields and your Sanity schema.

Connect Sanity

In Relato open Settings > Integrations > MCP > Add account, paste the Sanity MCP URL, approve OAuth, and name the account. The name you choose prefixes Sanity's tools in the agent tool picker. Then attach the Sanity tools plus the Relato query and project tools to an agent, and set a trigger: a project stage change, a schedule, or manual. For the full walkthrough, read Connect any MCP to Relato.

A good first agent

Start with an agent that turns an approved project into a Sanity document:

  • Attach the Sanity tools and the Relato query and project tools.

  • Instruct the agent to read the project title, body, and summary.

  • Give it the exact field mapping: project title to the title field, summary to the excerpt field, body to the portable text or body field.

  • Set the trigger to fire when the project reaches your ready stage, and have the agent create the document as a draft.

A note on OAuth

Relato's MCP integration is OAuth-based. You can connect Sanity if it runs an OAuth-capable MCP server that Relato can reach. If a public OAuth MCP for Sanity does not exist yet, tell us at [email protected] and we will help you find a path.

FAQ

Will the document publish live or stay a draft? That is your call. Instruct the agent to create a draft for review, or to publish once the mapping is stable.

How do I keep the field mapping clean? Name each source and target field in the agent instructions. The agent writes only the fields you list, so the mapping stays predictable.

Related articles

  • Connect any MCP to Relato

  • The Relato MCP server

  • Build your first AI Content Agent

If you need help, message us in the Relato Slack community or email [email protected].

Did this answer your question?