Integrates with Sanity CMS to enable direct content creation, querying, and management through specialized tools for documents, datasets, schemas, releases, and embeddings
Log in to Your Sanity.io Project
Select the Relevant Project
- From your Sanity dashboard, select the project you want to connect to the MCP server.
Find Your Project ID
- In the project overview or under project settings, locate your Project ID and copy it.
Get the Dataset Name
- Go to your project's datasets (often found in the main dashboard or under "Datasets").
- Identify the dataset you wish to use (commonly named
production
, but could be different).
- Copy the dataset name.
Generate an API Token
- In your Sanity project dashboard, go to
Settings
→ API
→ Tokens
.
- Click "Add new token".
- Create a new token for MCP server usage.
- Choose appropriate permissions:
- For read-only usage: Select the viewer role.
- For editing content: Select editor or developer.
- Important: Copy and store the token securely when it is shown—it will only be shown once!
Determine Your User Role
- Decide on the user role for the MCP server:
- Use
developer
for full access to all MCP tools.
- Use
editor
for content management only.
Fill in the FastMCP Connection Interface
- Click your "Install Now" button for adding ENVs in your FastMCP interface.
- Enter the following values:
SANITY_PROJECT_ID
: (Paste your copied Project ID)
SANITY_DATASET
: (Paste your dataset name)
SANITY_API_TOKEN
: (Paste the API token you just generated)
MCP_USER_ROLE
: (Enter either developer
or editor
as chosen in the previous step)
Save and Continue
- Save the connection. Your MCP server can now interact with your Sanity content!
Security Tip: Use different API tokens for development and production environments, never share or commit your token, and periodically rotate your token for maximum security.