npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cmsmcp/sanity

v0.3.2

Published

MCP server for Sanity CMS platform — GROQ queries, document CRUD, assets, datasets, and publishing

Readme

@cmsmcp/sanity

MCP server for Sanity -- 16 tools for GROQ queries, document CRUD, asset management, datasets, transactions, publishing, and history.

npm version License: MIT

Quick Start

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "sanity": {
      "command": "npx",
      "args": ["-y", "@cmsmcp/sanity"],
      "env": {
        "SANITY_PROJECT_ID": "your-project-id",
        "SANITY_DATASET": "production",
        "SANITY_TOKEN": "your-token"
      }
    }
  }
}

Claude Code

claude mcp add sanity -e SANITY_PROJECT_ID=xxx -e SANITY_DATASET=production -e SANITY_TOKEN=xxx -- npx -y @cmsmcp/sanity

Cursor / Windsurf / Any MCP Client

Same JSON config format -- add to your client's MCP settings file.

Configuration

| Variable | Required | Description | |----------|----------|-------------| | SANITY_PROJECT_ID | Yes | Sanity project ID | | SANITY_DATASET | No | Dataset name (default: production) | | SANITY_TOKEN | Yes | Sanity API token with write access |

Available Tools (16 tools)

Content (7 tools)

| Tool | Description | |------|-------------| | sanity_query | Execute a GROQ query against the Content Lake | | sanity_get_document | Get a single document by ID | | sanity_create_document | Create a new document | | sanity_update_document | Update (patch) an existing document | | sanity_delete_document | Delete a document | | sanity_publish_draft | Publish a draft document | | sanity_increment_field | Increment a numeric field value | | sanity_decrement_field | Decrement a numeric field value |

Datasets & System (3 tools)

| Tool | Description | |------|-------------| | sanity_list_datasets | List all datasets in the project | | sanity_list_document_types | List all document types | | sanity_export_dataset | Export a dataset |

Assets (3 tools)

| Tool | Description | |------|-------------| | sanity_list_assets | List uploaded assets (images, files) | | sanity_upload_image | Upload an image asset | | sanity_upload_file | Upload a file asset |

Transactions & History (2 tools)

| Tool | Description | |------|-------------| | sanity_create_transaction | Execute a multi-document transaction | | sanity_get_history | Get document revision history |

Examples

You: "Find all published blog posts"
AI: Uses sanity_query with a GROQ query like *[_type == "post" && !(_id in path("drafts.**"))]

You: "Create a new author document"
AI: Uses sanity_create_document with _type: "author" and the provided fields.

You: "Publish my draft post"
AI: Uses sanity_publish_draft to move the draft to the published state.

You: "Show the revision history for this document"
AI: Uses sanity_get_history to display all revisions with timestamps and authors.

Development

# Build
npx turbo build --filter=@cmsmcp/sanity

# Test
npx turbo test --filter=@cmsmcp/sanity

# Dev mode
npx turbo dev --filter=@cmsmcp/sanity

# Test with MCP Inspector
npx @modelcontextprotocol/inspector node packages/sanity-mcp/dist/index.js

License

MIT