Sanity.io

by jlmelis

1 stars
320 downloads
Not rated
GitHub

About

Integrates with Sanity.io to provide tools for creating, listing, and publishing draft posts, streamlining content management workflows for websites and applications.

Details

Author
jlmelis
GitHub stars
1
Downloads
320
Categories
Productivity, Design, Developer Tools, Infrastructure, AI, Project Management, Other
Tags
#web

- Create new documents in Sanity
- Edit existing documents by ID
- List documents of a specific type with limit
- Get a schema template from an existing document

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Sanity.io
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies with npm install, create a .env file with your Sanity project credentials, then configure the server in Claude Desktop via Settings > MCP Servers using the provided JSON settings with the command node and arguments ["src/sanity-mcp-server.ts"].

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "sanity.io": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Sanity MCP Server

This MCP server provides tools for interacting with Sanity.io content from Claude Desktop.

Installation

1. Clone this repository
2. Install dependencies:

npm install

3. Create a .env file with your Sanity credentials:

SANITY_PROJECT_ID=your_project_id
SANITY_DATASET=your_dataset
SANITY_TOKEN=your_token

Usage with Claude Desktop

1. In Claude Desktop, go to Settings > MCP Servers
2. Add a new server with these settings:

{
"command": "node",
"args": ["src/sanity-mcp-server.ts"],
"env": {
"SANITY_PROJECT_ID": "your_project_id",
"SANITY_DATASET": "your_dataset",
"SANITY_TOKEN": "your_token"
}
}

Available Tools

Create Document

Creates a new document in Sanity

Parameters:
- type: Document type
- content: Document content

Example:

{
"type": "post",
"content": {
"title": "My Post",
"body": [
{
"_type": "block",
"children": [
{
"_type": "span",
"text": "Hello world!"
}
]
}
]
}
}

Edit Document

Edits an existing document

Parameters:
- id: Document ID
- content: Updated content

List Documents

Lists documents of a specific type

Parameters:
- type: Document type
- limit: Maximum number of documents to return (default: 10)

Get Schema

Gets a schema template based on an existing document

Note: For best results, manually create at least one document of each type before using this tool.

Parameters:
- type: Document type

Example Usage

1. Create a new blog post:

{
"tool": "create-document",
"arguments": {
"type": "post",
"content": {
"title": "My First Post",
"slug": "my-first-post",
"body": [
{
"_type": "block",
"children": [
{
"_type": "span",
"text": "This is my first post!"
}
]
}
]
}
}
}

2. Edit an existing post:

{
"tool": "edit-document",
"arguments": {
"id": "post-id-123",
"content": {
"title": "Updated Title"
}
}
}

3. List recent posts:

{
"tool": "list-documents",
"arguments": {
"type": "post",
"limit": 5
}
}

4. Get schema for posts:
```json
{
"tool": "get-schema",
"arguments": {
"type": "post"
}
}

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.