mcp-sanity
VENDORED INTERIM COPY of luminarylane/mcp-sanity
(branch feat/standalone-ci-release). Copied here to validate the Lane
integration while the upstream package is finalized. Once mcp-sanity is
published to npm, this directory is deleted and Lane consumes the npm package
instead — the only change required is the SANITY_MCP_SERVER env override in
src/lane-operator/config.py. Do not diverge this copy from upstream; push
fixes upstream. See ticket #2394.
Standalone Model Context Protocol server for Sanity-backed blog operations.
This package exposes a stdio MCP server that lets MCP-compatible clients list, read, create, publish, delete, and upload images for blog posts in a Sanity dataset.
This repository contains no embedded credentials or project-specific secrets. All runtime access is driven through environment variables.
Features
Tools provided by the server:
sanity_blog_list
sanity_blog_get
sanity_blog_upsert
sanity_image_upload
sanity_blog_publish
sanity_blog_delete
Requirements
- Node.js 20 or newer
- A Sanity API token with access to the target dataset
Required environment variables
Set these before starting the server:
SANITY_PROJECT_ID
SANITY_DATASET
SANITY_API_VERSION
SANITY_API_TOKEN
Example:
export SANITY_PROJECT_ID=<project-id>
export SANITY_DATASET=production
export SANITY_API_VERSION=2024-07-01
export SANITY_API_TOKEN=<token>
Installation
Install from npm
npx -y @luminarylane/sanity-mcp-server
Install locally for development
npm install
Usage
Run the published CLI
SANITY_PROJECT_ID=<project-id> \
SANITY_DATASET=production \
SANITY_API_VERSION=2024-07-01 \
SANITY_API_TOKEN=<token> \
luminarylane-sanity-mcp
Run the built server directly
npm run build
SANITY_PROJECT_ID=<project-id> \
SANITY_DATASET=production \
SANITY_API_VERSION=2024-07-01 \
SANITY_API_TOKEN=<token> \
node dist/index.js
Run in development mode
SANITY_PROJECT_ID=<project-id> \
SANITY_DATASET=production \
SANITY_API_VERSION=2024-07-01 \
SANITY_API_TOKEN=<token> \
npm run dev
MCP client configuration
Example MCP config:
{
"mcpServers": {
"sanity-blog": {
"command": "npx",
"args": ["-y", "@luminarylane/sanity-mcp-server"],
"env": {
"SANITY_PROJECT_ID": "your-project-id",
"SANITY_DATASET": "production",
"SANITY_API_VERSION": "2024-07-01",
"SANITY_API_TOKEN": "your-token"
}
}
}
}
If you are developing from a local checkout instead of an installed package, point your client at Node and the built entrypoint:
{
"mcpServers": {
"sanity-blog": {
"command": "node",
"args": ["/absolute/path/to/sanity-mcp-server/dist/index.js"],
"env": {
"SANITY_PROJECT_ID": "your-project-id",
"SANITY_DATASET": "production",
"SANITY_API_VERSION": "2024-07-01",
"SANITY_API_TOKEN": "your-token"
}
}
}
}
Development
Useful scripts:
npm run build — compile TypeScript to dist/
npm run typecheck — run TypeScript without emitting files
npm run clean — remove dist/
npm run dev — run the server with tsx --watch
npm run validate — clean, build, typecheck, and verify the package tarball with npm pack --dry-run
CI
GitHub Actions CI is configured in .github/workflows/ci.yml and runs on pushes and pull requests. It:
- installs dependencies with
npm ci
- builds the package
- runs typechecking
- verifies publishable package contents with
npm pack --dry-run
Publishing notes
Publishing is performed by GitHub Actions from a signed vX.Y.Z tag using npm
trusted publishing with provenance. Do not publish manually from a workstation.
Repository checklist
This standalone repo now expects the following basic workflow:
npm install
npm run validate
- open a pull request
- let GitHub Actions confirm build and typecheck health
- publish manually when ready