Skip to content

Conversation

@bdougie
Copy link
Collaborator

@bdougie bdougie commented Oct 3, 2025

Overview

This PR adds a comprehensive Sanity MCP cookbook that demonstrates how to build AI-powered content management workflows with Continue CLI and Sanity MCP.

Key Features

🔧 Dual Agent Configuration Support

Quick Start - Sanity Agent Config

  • Pre-configured agent with Sanity MCP and optimized prompts
  • Supports both OAuth (interactive) and environment variable (CI) authentication
  • Includes content management rules and schema optimization guidelines

Manual Setup - Sanity MCP Config

  • Standalone MCP configuration for custom agent setups
  • Environment variable authentication for headless/CI workflows
  • Detailed setup instructions for all required variables

🚀 CI/CD Ready

The cookbook now properly supports both authentication modes:

  • Interactive Mode: OAuth via browser for development workflows
  • CI Mode: Environment variables for automated workflows

Required environment variables for CI:

  • SANITY_PROJECT_ID: Your Sanity project ID
  • SANITY_DATASET: Your dataset name (usually "production")
  • SANITY_API_TOKEN: API token with appropriate permissions
  • MCP_USER_ROLE: User role (typically "admin" or "editor")

📖 Comprehensive Workflows

Includes complete examples for:

  • Schema exploration and validation
  • GROQ query execution and optimization
  • Content migration and bulk operations
  • Localization setup
  • Documentation generation
  • GitHub Actions CI/CD integration

Why Two Agent Configs?

  1. Sanity Agent Config: Complete solution for users who want everything pre-configured. Includes the MCP plus optimized prompts, rules, and workflows.

  2. Sanity MCP Config: Just the MCP configuration for users who want to build custom agents or integrate into existing setups. Provides the environment variable setup needed for CI mode.

This dual approach gives users flexibility while ensuring both interactive development and automated CI workflows are properly supported.

Testing

  • ✅ All code examples verified
  • ✅ Hub agent links confirmed
  • ✅ Environment variable authentication tested
  • ✅ GitHub Actions workflow validated
  • ✅ Both TUI and headless modes documented

Closes #[issue-number-if-applicable]


Summary by cubic

Adds a Sanity MCP cookbook for Continue with correct agent configs and authentication, enabling content workflows in interactive and CI/headless modes.

  • New Features
    • New guide: sanity-mcp-continue-cookbook.mdx with schema, GROQ, migration, localization, and docs workflows.
    • Dual setup: pre-built Sanity agent (continuedev/sanity-agent-config) and MCP-only config (sanity/sanity-mcp-config).
    • CI/headless support: environment variable auth (SANITY_PROJECT_ID, SANITY_DATASET, SANITY_API_TOKEN, MCP_USER_ROLE, CONTINUE_API_KEY) and OAuth for interactive mode.
    • GitHub Actions example using Continue CLI and --auto for validation and reports.

- Updated Quick Start to use continuedev/sanity-agent-config
- Updated Manual Setup to reference sanity/sanity-mcp-config
- Added environment variable authentication for headless/CI mode
- Restored all headless mode prompts and examples
- Updated GitHub Actions workflow with proper env vars:
  - SANITY_PROJECT_ID, SANITY_DATASET, SANITY_API_TOKEN, MCP_USER_ROLE
- Added proper Hub links and config documentation
- Sanity MCP config now supports CI mode with env var authentication

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
@bdougie bdougie requested a review from a team as a code owner October 3, 2025 04:48
@bdougie bdougie requested review from Patrick-Erichsen and removed request for a team October 3, 2025 04:48
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 3, 2025
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

✅ Review Complete

⚠️ AI review completed but no review output was generated.

Likely cause: Expired CONTINUE_API_KEY or missing continuedev/review-bot assistant

📋 View workflow logs for details.


@bdougie bdougie changed the title Add Sanity MCP Continue cookbook with proper agent configs for CI/interactive modes docs: Add Sanity MCP Continue cookbook with proper agent configs for CI/interactive modes Oct 3, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

… cookbook

- Add "Your First MCP Conversation" section with starter prompts
- Include beginner prompts from official Sanity MCP blog post:
  - Content discovery, creation, updates, and scheduling examples
- Update both Quick Start and Manual Setup with accessible first steps
- Add links to official Sanity MCP blog post throughout cookbook
- Improve user onboarding with progressive complexity approach
- Add blog post reference to Additional Resources section

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Oct 3, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 3, 2025
@bdougie bdougie merged commit b127301 into main Oct 3, 2025
57 checks passed
@bdougie bdougie deleted the bdougie/sanity-mcp-cookbook branch October 3, 2025 15:13
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Oct 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2025
@sestinj
Copy link
Contributor

sestinj commented Oct 5, 2025

🎉 This PR is included in version 1.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 6, 2025

🎉 This PR is included in version 1.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 15, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants