📚 Table of Contents
1. Overview
This guide documents the complete process for setting up MCP (Model Context Protocol) servers in Claude Desktop, specifically focusing on Sanity CMS integration. Based on real-world troubleshooting experience from September 26, 2025.
What is MCP?
Model Context Protocol allows Claude to directly interact with external services like:
- Sanity CMS (content management)
- ChromaDB (vector database)
- Desktop Commander (file system access)
- Filesystem tools (local file operations)
2. Prerequisites
Before You Start, You Need:
- Claude Desktop installed (Pro recommended for all MCP features)
- Node.js installed (v18+ recommended)
- Sanity project created with Project ID
- Sanity Studio installed locally
- Admin access to generate API tokens
3. Step-by-Step Setup
1Install Sanity MCP Server
Navigate to your Sanity project folder and install the MCP server:
cd C:\Users\yourname\path\to\sanity-project
npm install @sanity/mcp-server
2Generate Sanity Auth Token
- Go to
https://www.sanity.io/manage - Select your project
- Navigate to API → Tokens
- Click "Add API token"
- Settings:
- Name:
Claude MCP Integration - Permissions: Editor (not Viewer!)
- Name:
- Copy the token immediately (you can't view it again!)
3Locate Claude Config File
The configuration file location depends on your operating system:
| Operating System | Config File Location |
|---|---|
| Windows | C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
4Edit Configuration File
Add the Sanity configuration to your claude_desktop_config.json:
{
"mcpServers": {
// Keep existing servers intact!
"desktop-commander": {
"command": "npx",
"args": ["-y", "@wonderwhy-er/desktop-commander@latest"]
},
"chroma": {
// Your existing ChromaDB config
},
// Add Sanity here:
"sanity": {
"command": "node",
"args": [
"C:\\Users\\yourname\\path\\to\\project\\node_modules\\@sanity\\mcp-server\\build\\index.js"
],
"env": {
"SANITY_PROJECT_ID": "your_project_id",
"SANITY_DATASET": "production",
"SANITY_AUTH_TOKEN": "your_token_here"
}
}
}
}
build/index.js not dist/index.js. Use node not npx for reliability!
5Restart Claude Desktop
This step is mandatory! Configuration changes don't hot-reload.
- Completely close Claude Desktop (not just minimize)
- Wait 5 seconds
- Reopen Claude Desktop
- Start a new chat
6Verify Connection
Check the developer settings:
- Press
Ctrl+Shift+I(orCmd+Option+Ion Mac) - Look for MCP servers section
- Sanity should show "running" status
4. Common Errors & Solutions
Error: "MCP sanity: Server disconnected"
Causes & Solutions:
- Wrong path format: Use absolute paths with double backslashes on Windows
- Package not installed: Run
npm install @sanity/mcp-serverfirst - Wrong command: Use
nodeinstead ofnpx - Token permissions: Must be "Editor" not "Viewer"
- Free tier limitation: Some features may require Claude Pro
Error: "Cannot find module"
The path to the MCP server is incorrect. Verify:
// Check if the file exists:
dir C:\path\to\node_modules\@sanity\mcp-server\build\index.js
Error: "Invalid token"
Token issues can be:
- Token has expired
- Token has wrong permissions (needs Editor)
- Token was copied incorrectly
- Wrong project ID
5. Configuration Templates
Complete Multi-Server Configuration
Here's a complete working example with multiple MCP servers:
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": ["filesystem-server-path"]
},
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander@latest"
]
},
"chroma": {
"command": "C:\\path\\to\\chroma-mcp.exe",
"args": [
"--client-type", "http",
"--host", "localhost",
"--port", "8000",
"--ssl", "false"
]
},
"sanity": {
"command": "node",
"args": [
"C:\\absolute\\path\\to\\node_modules\\@sanity\\mcp-server\\build\\index.js"
],
"env": {
"SANITY_PROJECT_ID": "nxz8ny4n",
"SANITY_DATASET": "production",
"SANITY_AUTH_TOKEN": "sk..."
}
}
}
}
6. Troubleshooting Checklist
When Things Don't Work, Check:
- Is the MCP server package installed?
npm list @sanity/mcp-server - Is the path correct and using double backslashes?
- Is it
build/index.jsnotdist/index.js? - Are you using
nodenotnpxas the command? - Does the token have Editor permissions?
- Did you fully restart Claude Desktop?
- Are you on Claude Pro (for advanced MCP features)?
- Is the Sanity Studio running locally?
- Is the project ID correct?
- Is the dataset name correct (usually "production")?
7. Pro Tips & Best Practices
claude_desktop_config_backup.json
Path Handling Tips
- Windows: Use double backslashes
\\or forward slashes/ - Always use absolute paths, never relative
- Test path exists before adding to config
Token Management
- Name tokens descriptively: "Claude MCP Production"
- Store tokens securely (consider using environment variables)
- Rotate tokens periodically
- Never commit tokens to Git
Debugging Process
- Check Claude Developer Console (Ctrl+Shift+I)
- Look for specific error messages
- Test with simpler configuration first
- Verify each component independently
Performance Optimization
- Use local file paths instead of network paths
- Keep node_modules on SSD for faster loading
- Limit number of concurrent MCP servers
8. Additional Resources
Official Documentation
Related Guides
- ChromaDB MCP Setup
- Desktop Commander Configuration
- Filesystem MCP Integration
Folder Structure Best Practices
MUTUAL-COGNITION-CURRENT/
├── Educational-HTML/ # Guides like this one
│ └── MCP-Setup-Guide-Sanity-Claude.html
├── broadcasting-hub/ # Sanity project
│ └── node_modules/
│ └── @sanity/
│ └── mcp-server/
├── MCP-Configs/ # Backup configs
│ ├── claude_desktop_config_working.json
│ └── troubleshooting-notes.md
└── Scripts/ # Helper scripts
└── test-sanity-connection.js