Merge branch 'main' of https://github.com/continuedev/continue into dallin/workflow-files

This commit is contained in:
Dallin Romney 2025-10-03 18:04:49 -07:00
commit f6d353fb28
17 changed files with 1415 additions and 42 deletions

View file

@ -110,6 +110,6 @@ jobs:
# Create GitHub release
gh release create "v${{ steps.get_version.outputs.beta_version }}" \
--title "Beta Release v${{ steps.get_version.outputs.beta_version }}" \
--title "CLI Beta Release v${{ steps.get_version.outputs.beta_version }}" \
--notes "Daily beta release for testing. This version will be promoted to stable after 7 days if no critical issues are found." \
--prerelease

View file

@ -116,7 +116,7 @@ jobs:
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v5
# # Set up Java environment for the next steps
- name: Setup Java
@ -127,7 +127,7 @@ jobs:
# # Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v5
with:
gradle-home-cache-cleanup: true
@ -444,7 +444,7 @@ jobs:
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v5
with:
gradle-home-cache-cleanup: true
@ -522,7 +522,7 @@ jobs:
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v5
with:
gradle-home-cache-cleanup: true

View file

@ -208,7 +208,7 @@ jobs:
# Create GitHub release
gh release create "v${{ steps.final_version.outputs.stable_version }}" \
--title "Stable Release v${{ steps.final_version.outputs.stable_version }}" \
--title "CLI Stable Release v${{ steps.final_version.outputs.stable_version }}" \
--notes "${{ steps.final_version.outputs.release_notes }}" \
--latest

View file

@ -19,7 +19,7 @@ jobs:
distribution: "temurin"
java-version: 17
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v4
uses: gradle/actions/dependency-submission@v5
with:
# The gradle project is not in the root of the repository.
build-root-directory: extensions/intellij

View file

@ -83,6 +83,7 @@ import { NextEditProvider } from "./nextEdit/NextEditProvider";
import type { FromCoreProtocol, ToCoreProtocol } from "./protocol";
import { OnboardingModes } from "./protocol/core";
import type { IMessenger, Message } from "./protocol/messenger";
import { ContinueError, ContinueErrorReason } from "./util/errors";
import { shareSession } from "./util/historyUtils";
import { Logger } from "./util/Logger.js";
@ -1131,12 +1132,27 @@ export class Core {
if (!tool) {
throw new Error(`Tool ${toolName} not found`);
}
const preprocessedArgs = await tool.preprocessArgs?.(args, {
ide: this.ide,
});
return {
preprocessedArgs,
};
try {
const preprocessedArgs = await tool.preprocessArgs?.(args, {
ide: this.ide,
});
return {
preprocessedArgs,
};
} catch (e) {
let errorReason =
e instanceof ContinueError ? e.reason : ContinueErrorReason.Unknown;
let errorMessage =
e instanceof Error
? e.message
: `Error preprocessing tool call args for ${toolName}\n${JSON.stringify(args)}`;
return {
preprocessedArgs: undefined,
errorReason,
errorMessage,
};
}
});
on("isItemTooBig", async ({ data: { item } }) => {

View file

@ -54,6 +54,7 @@ import {
} from "../control-plane/client";
import { ProcessedItem } from "../nextEdit/NextEditPrefetchQueue";
import { NextEditOutcome } from "../nextEdit/types";
import { ContinueErrorReason } from "../util/errors";
export enum OnboardingModes {
API_KEY = "API Key",
@ -317,7 +318,11 @@ export type ToCoreFromIdeOrWebviewProtocol = {
];
"tools/preprocessArgs": [
{ toolName: string; args: Record<string, unknown> },
{ preprocessedArgs?: Record<string, unknown> },
{
preprocessedArgs?: Record<string, unknown>;
errorReason?: ContinueErrorReason;
errorMessage?: string;
},
];
"clipboardCache/add": [{ content: string }, void];
"controlPlane/openUrl": [{ path: string; orgSlug?: string }, void];

View file

@ -15,4 +15,28 @@ By implementing rules, you transform the AI from a generic coding agent into a k
Your agent detects rules and applies the specified rules while in [Agent](/features/agent/quick-start), [Chat](/features/chat/quick-start), and [Edit](/features/edit/quick-start) modes.
## Where to Manage Rules
<Columns cols={2}>
<Card title="Local Rules (.continue/rules)" icon="folder">
- Create files in `.continue/rules` folder
- Automatically appear with Hub assistants
- Edit directly in your file system
- Version controlled alongside your code
- Best for project-specific rules (e.g., "remember to generate migrations after modifying the db")
</Card>
<Card title="Hub Rules" icon="cloud">
- Manage on [Continue Hub](https://hub.continue.dev)
- Reference in config.yaml with `uses:`
- Share with team and community
- Easy to include in multiple agents
- Best for organization-wide rules (e.g., "always use X library for Y task")
</Card>
</Columns>
<Info>
**Quick Setup**: Start with local rules for immediate use, then promote commonly used rules to the Hub for sharing and reuse.
</Info>
Learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details.

View file

@ -20,6 +20,42 @@ You can view the current rules by clicking the pen icon above the main toolbar:
To form the system message, rules are joined with new lines, in the order they appear in the toolbar. This includes the base chat system message ([see below](#how-to-customize-chat-system-message)).
## Understanding Hub vs Local Rules Integration
<Warning>
**Important:** Rules created in different locations behave differently and have different synchronization patterns.
</Warning>
Continue supports two types of rules with different behaviors:
<Columns cols={2}>
<Card title="Local Rules" icon="folder">
- **Location**: `.continue/rules` folder in your workspace
- **Visibility**: Automatically visible when using Hub assistants
- **Creation**: Add rules button in VSCode or manual file creation
- **File Management**: Creates actual `.md` files you can edit directly
</Card>
<Card title="Hub Rules" icon="cloud">
- **Location**: Stored on Continue Hub, referenced in config.yaml
- **Visibility**: Only appear when referenced in assistant configuration
- **Creation**: Created directly on Hub or copied from local rules
- **File Management**: No local files created, managed through Hub interface
</Card>
</Columns>
### How Rules Are Applied
When using Continue, rules are loaded in this order:
1. **Hub assistant rules** (if using a Hub-based assistant)
2. **Referenced Hub rules** (via `uses:` in config.yaml)
3. **Local workspace rules** (from `.continue/rules` folder)
4. **Global rules** (from `~/.continue/rules` folder)
<Info>
**TL;DR**: Local rules show up automatically when using Hub assistants. Hub rules show up automatically when referenced in your config.
</Info>
## Quick Start: How to Create Your First Rule File
Below is a quick example of setting up a new rule file:
@ -42,6 +78,8 @@ Now test your rules by asking a question about a file in chat.
## How to Create Rules Blocks
### Creating Local Rules
Rules can be added locally using the "Add Rules" button while viewing the Local Agent's rules.
![add local rules button](/images/add-local-rules.png)
@ -50,12 +88,44 @@ Rules can be added locally using the "Add Rules" button while viewing the Local
**Automatically create local rule blocks**: When in Agent mode, you can prompt the agent to create a rule for you using the `create_rule_block` tool if enabled.
For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation.
</Info>
Rules can also be added to an Agent on the Continue Hub.
### Creating Hub Rules
Explore available rules [here](https://hub.continue.dev), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub.
Rules can also be created and managed on the Continue Hub:
1. **Browse existing rules**: [Explore available rules](https://hub.continue.dev)
2. **Create new rules**: [Create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub
3. **Copy from local rules**: Copy/paste content from your `.continue/rules` files to create Hub rules
### Working Between Hub and Local Rules
<Tabs>
<Tab title="Hub to VSCode">
To use Hub rules in your local setup:
1. Reference them in your `config.yaml`:
```yaml
rules:
- uses: username/my-hub-rule
```
2. The rule will automatically appear in your rules toolbar
3. **Note**: No local file is created - the rule exists only on the Hub
</Tab>
<Tab title="VSCode to Hub">
To move local rules to the Hub:
1. Copy the content from your `.continue/rules/rule-name.md` file
2. Go to [Create new rule](https://hub.continue.dev/new?type=block&blockType=rules)
3. Paste the content and configure the rule
4. Optionally, remove the local file and reference the Hub rule in your config
<Warning>
**Current Limitation**: There's no automatic sync from local to Hub. You must manually copy/paste rule content.
</Warning>
</Tab>
</Tabs>
### How to Configure Rule Properties and Syntax
@ -150,6 +220,42 @@ globs: ["**/*.ts", "**/*.tsx"]
- modularize components into smaller, reusable pieces
```
## Troubleshooting Rules
### Issue: Rules Created in Different Places Don't Sync
**Problem**: You created rules in the Hub but don't see them in VSCode, or vice versa.
**Solution**:
- **Hub rules** only appear when referenced in your config.yaml using the `uses:` syntax
- **Local rules** automatically appear when using Hub assistants
- There's currently no automatic bidirectional sync
### Issue: "Edit" Links Point to Wrong Location
**Problem**: When you click "Edit" on a rule in VSCode, it tries to open the Hub even though the rule is local, or shows an incorrect URL.
**Root Cause**: This happens when you have a mix of local and Hub rules, and Continue can't properly determine where each rule originates.
**Workaround**:
1. **For local rules**: Navigate directly to `.continue/rules/` folder and edit the `.md` file
2. **For Hub rules**: Go directly to your assistant page on [Continue Hub](https://hub.continue.dev) and edit from there
3. Keep track of which rules are local vs Hub-based to avoid confusion
<Info>
**Known Issue**: This link accuracy problem is tracked in [Linear issue CON-3084](https://linear.app/continue/issue/CON-3084) and will be fixed in a future update.
</Info>
### Issue: Rules Don't Appear in Assistant
**Problem**: Your rules exist but don't show up in the rules toolbar.
**Check These**:
1. **File location**: Ensure local rules are in `.continue/rules/` (not `.continue/rule/`)
2. **File format**: Rules should be `.md` files with proper YAML frontmatter
3. **Config reference**: Hub rules must be referenced in `config.yaml`
4. **Assistant type**: Ensure you're using the correct assistant (local vs Hub)
### How to Customize Chat System Message
Continue includes a simple default system message for [Agent](../../features/agent/quick-start) and [Chat](../../features/chat/quick-start) requests, to help the model provide reliable codeblock formats in its output.

View file

@ -260,6 +260,7 @@
"icon": "book-open-cover",
"pages": [
"guides/posthog-github-continuous-ai",
"guides/continue-docs-mcp-cookbook",
"guides/snyk-mcp-continue-cookbook",
"guides/dlt-mcp-continue-cookbook",
"guides/netlify-mcp-continuous-deployment"

View file

@ -0,0 +1,542 @@
---
title: "Contributing to Continue with Model Context Protocol (MCP)"
description: "Use the Continue Docs MCP to write cookbooks, guides, and documentation with AI-powered workflows."
sidebarTitle: "Continue Docs MCP Cookbook"
---
<Card title="What You'll Build" icon="book-open-cover">
Master using the Continue Docs MCP to contribute documentation, create cookbooks, and maintain consistency across Continue's docs - all through natural language prompts.
</Card>
## Prerequisites
Before starting, ensure you have:
- Continue account with **Hub access**
- Read: [Contributing to Continue Documentation](/CONTRIBUTING) for setup instructions
- Forked the [continuedev/continue](https://github.com/continuedev/continue) repository
- Node.js 20+ and Continue CLI installed
<Warning>
This cookbook assumes you've read the setup in the [CONTRIBUTING guide](/CONTRIBUTING). If you haven't, start there first.
</Warning>
## Continue Docs MCP Setup
<Card title="Fastest Path to Success" icon="rocket">
Use the pre-built [Docs Assistant - Mintlify agent](https://hub.continue.dev/continuedev/docs-mintlify) that includes the Continue Docs MCP and is ready to use immediately.
</Card>
<Tabs>
<Tab title="⚡ Quick Start (Recommended)">
```bash
# From your Continue docs directory
cn --config continuedev/docs-mintlify
```
This agent includes:
- **Continue Docs MCP** for searching Continue documentation
- **Mintlify formatting rules** for proper component usage
- **Documentation-focused prompts** for common tasks
</Tab>
<Tab title="🛠️ Custom Agent">
If you want to customize, create your own agent and add:
1. [Continue Docs MCP](https://hub.continue.dev/continuedev/continue-docs-mcp)
2. [Mintlify Technical Writing Rule](https://hub.continue.dev/mintlify/technical-writing-rule)
See the [CONTRIBUTING guide](/CONTRIBUTING#option-2-create-your-own-custom-agent) for details.
</Tab>
</Tabs>
---
## What is the Continue Docs MCP?
<Card title="Continue Docs MCP" icon="circle-info">
A Model Context Protocol server built with [Mintlify's MCP generation](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs) that enables semantic search across Continue documentation. [Learn more →](/reference/continue-mcp)
</Card>
The MCP helps you:
- **Find examples** from existing documentation
- **Maintain consistency** with established patterns
- **Source accurate information** about Continue features
- **Write better documentation** faster
---
## Documentation Workflows with Prompts
### 🆕 Creating a New Cookbook
Cookbooks show how to use Continue CLI with specific tools or services. Here's how to create one using the Continue Docs MCP:
<Steps>
<Step title="Research Existing Cookbooks">
```bash
cn --config continuedev/docs-mintlify
```
**Prompt:**
```
"Show me the structure of existing MCP cookbooks in the Continue docs.
I want to create a cookbook for GitHub MCP."
```
The agent will find examples like the dlt, Snyk, and Sanity cookbooks.
</Step>
<Step title="Source Official Documentation">
**Prompt:**
```
"Using the Continue Docs MCP, find information about how GitHub MCP works.
Then search the web for the official GitHub MCP documentation and combine
both sources to create a cookbook following the same structure as the
dlt cookbook."
```
The agent will:
- Search Continue docs for MCP patterns
- Fetch GitHub MCP official documentation
- Combine both sources
- Generate a cookbook with consistent formatting
</Step>
<Step title="Add to Navigation">
**Prompt:**
```
"Add my new github-mcp-continue-cookbook.mdx to the docs.json navigation
under the Cookbooks section."
```
</Step>
<Step title="Preview and Iterate">
```bash
npm run dev
# Visit http://localhost:3000
```
**Refine with prompts:**
```
"Add more examples to the troubleshooting section"
"Include a CI/CD workflow example using GitHub Actions"
"Add authentication setup using environment variables"
```
</Step>
</Steps>
<Info>
**Pro Tip:** The agent uses the Continue Docs MCP to maintain consistency with existing cookbooks automatically.
</Info>
---
### ✏️ Updating Existing Documentation
<Steps>
<Step title="Find the Documentation">
**Prompt:**
```
"Where is the MCP tools documentation located? Show me the file path."
```
</Step>
<Step title="Make Targeted Updates">
**Prompt:**
```
"Update the MCP tools documentation at docs/customization/mcp-tools.mdx
to include information about the new Slack MCP server. Use the Continue
Docs MCP to find examples of how other MCP servers are documented, then
add a similar section for Slack."
```
</Step>
</Steps>
---
### 📝 Adding New Guides
<Steps>
<Step title="Research Similar Content">
**Prompt:**
```
"I want to create a guide for setting up Continue with Amazon Bedrock.
Search the Continue docs for similar model provider setup guides and
show me the common structure they follow."
```
</Step>
<Step title="Create the Guide">
**Prompt:**
```
"Create a new guide at docs/guides/amazon-bedrock-setup.mdx following
the structure you found. Include:
- Prerequisites
- Step-by-step setup with code examples
- Configuration options
- Troubleshooting common issues
Use the Continue Docs MCP to find accurate information about Continue's
model provider configuration."
```
</Step>
<Step title="Add Navigation Entry">
**Prompt:**
```
"Add this guide to docs.json under the Model Providers section"
```
</Step>
</Steps>
---
## Real-World Cookbook Examples
### Example 1: PostgreSQL MCP Cookbook
**Prompt:**
```
"Create a cookbook for using Continue with PostgreSQL MCP. Follow the same
structure as the dlt cookbook, but customize it for database operations.
Include these sections:
1. Quick start with pre-built agent
2. Manual setup with MCP configuration
3. Common database tasks (schema exploration, query writing, migrations)
4. Troubleshooting database connection issues
Use the Continue Docs MCP to find MCP configuration patterns and search the
web for PostgreSQL MCP documentation."
```
### Example 2: Sentry Error Tracking Cookbook
**Prompt:**
```
"Create a cookbook showing how to use Continue to analyze Sentry errors.
The cookbook should demonstrate:
1. Setting up Sentry MCP integration
2. Querying recent errors
3. Analyzing error patterns with AI
4. Generating fixes for common errors
5. CI/CD integration for automated error analysis
Research the Snyk cookbook structure since it's also about error detection,
and adapt it for Sentry."
```
### Example 3: OpenAPI Documentation Cookbook
**Prompt:**
```
"I want to create a cookbook for using Continue to work with OpenAPI specs.
Show how to:
1. Load OpenAPI specs into Continue's context
2. Generate API client code from specs
3. Create tests based on API endpoints
4. Update documentation when APIs change
Use the Continue Docs MCP to find how context providers work, then combine
that with OpenAPI MCP information."
```
---
## Advanced Prompt Patterns
<CardGroup cols={2}>
<Card title="Multi-Source Research" icon="magnifying-glass">
```bash
"Use the Continue Docs MCP to understand how agents
work in Continue, then search the web for Anthropic's
Computer Use MCP. Create a cookbook showing how to
combine Continue agents with Computer Use for
automated testing."
```
</Card>
<Card title="Cross-Reference Documentation" icon="link">
```bash
"Find all mentions of MCP servers across Continue
documentation. Then create a comprehensive reference
page that links to all MCP-related guides and
configurations."
```
</Card>
<Card title="Consistency Checking" icon="check-double">
```bash
"Review all cookbook files in docs/guides/ and check
if they follow the same structure. List any
inconsistencies and suggest updates to make them
uniform."
```
</Card>
<Card title="Example Extraction" icon="code">
```bash
"Extract all code examples showing MCP server
configuration from the Continue docs. Format them
as a single reference page with explanations for
each pattern."
```
</Card>
</CardGroup>
---
## Testing Your Documentation
### Local Preview
```bash
cd docs
npm run dev
# Visit http://localhost:3000
```
### Validation Prompts
```bash
# Check formatting
"Review this documentation for Mintlify formatting issues and fix any problems"
# Verify links
"Check all links in this file and ensure they point to existing documentation"
# Test code examples
"Verify that all code examples in this cookbook are syntactically correct"
```
---
## Submitting Your Contribution
**Prompt:**
```bash
"Create a pull request with my documentation changes and use the repo's
PR template to write the description"
```
The agent will:
- Create a feature branch
- Stage and commit your changes
- Push to your fork
- Generate a PR description following the template
- Open the PR for review
<Info>
See the full [Contributing Guide](/CONTRIBUTING#submitting-your-contribution) for manual PR submission details.
</Info>
---
## Automated Documentation Checks with GitHub Actions
Add automated documentation checks to your PR workflow using the Continue Docs MCP agent:
```yaml title=".github/workflows/docs-check.yml"
name: Documentation Check
on:
pull_request:
types: [opened, synchronize]
paths:
- 'core/**'
- 'extensions/**'
- 'packages/**'
- 'gui/**'
jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Continue CLI
run: npm i -g @continuedev/cli
- name: Analyze Changes for Documentation Needs
id: analyze
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
echo "🔍 Analyzing code changes for documentation needs..."
# Get changed files
git diff origin/${{ github.base_ref }}..HEAD --name-only > changed_files.txt
# Create detailed diff
git diff origin/${{ github.base_ref }}..HEAD > changes.diff
# Use Continue agent to check if docs need updates
PROMPT="Review these code changes and determine if documentation updates are needed.
Changed files: $(cat changed_files.txt | tr '\n' ' ')
Consider:
- New features or APIs
- Breaking changes
- New configuration options
- Modified CLI commands
- New MCP integrations
If docs updates are needed, specify which files in docs/ should be updated.
If no updates needed, respond with 'NO_DOCS_NEEDED'.
Be specific and concise."
cn --config continuedev/docs-mintlify -p "$PROMPT" --auto > analysis.md || {
echo "⚠️ Analysis failed"
echo "needs_docs=false" >> $GITHUB_OUTPUT
exit 0
}
if grep -q "NO_DOCS_NEEDED" analysis.md; then
echo "needs_docs=false" >> $GITHUB_OUTPUT
else
echo "needs_docs=true" >> $GITHUB_OUTPUT
fi
- name: Post Documentation Recommendation
if: steps.analyze.outputs.needs_docs == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "📝 Creating PR comment with documentation recommendations..."
cat > pr-comment.md <<'EOF'
## 📚 Documentation Update Recommended
Based on the code changes in this PR, documentation updates may be needed:
EOF
cat analysis.md >> pr-comment.md
cat >> pr-comment.md <<'EOF'
---
### Next Steps
1. Review the suggested documentation areas above
2. Update relevant files in the `/docs` folder
3. Consider updating:
- API references for interface changes
- Guides for workflow changes
- Configuration docs for new settings
- MCP cookbooks for new integrations
### Resources
- [Contributing to Docs](/CONTRIBUTING)
- [Continue Docs MCP Cookbook](/guides/continue-docs-mcp-cookbook)
*This analysis was generated using the Continue Docs MCP agent.*
EOF
gh pr comment ${{ github.event.pull_request.number }} --body-file pr-comment.md
- name: Add Label
if: steps.analyze.outputs.needs_docs == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "docs-needed"
```
<Info>
This workflow uses the Continue Docs MCP agent to analyze code changes and automatically comment on PRs when documentation updates are recommended.
</Info>
---
## Documentation MCP for Other Projects
Want to create documentation MCPs for your own projects? Mintlify makes it easy:
<Steps>
<Step title="Set Up Mintlify Docs">
```bash
npm i -g mintlify
mintlify init
```
</Step>
<Step title="MCP Auto-Generated">
Mintlify automatically generates an MCP server for your documentation, enabling semantic search.
[Learn more about Mintlify MCP generation →](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs)
</Step>
<Step title="Publish to Continue Hub">
Share your docs MCP on [Continue Hub](https://hub.continue.dev/new?type=mcp) so others can use it with Continue agents.
</Step>
</Steps>
<Info>
The [Continue Docs MCP](/reference/continue-mcp) itself was built this way!
</Info>
---
## Key Prompts Cheat Sheet
| Task | Prompt |
|:-----|:-------|
| **Find structure** | "Show me the structure of existing cookbooks in Continue docs" |
| **Create cookbook** | "Create a cookbook for [tool] MCP following the dlt cookbook structure" |
| **Update docs** | "Update [file] to include information about [feature], using Continue Docs MCP to find examples" |
| **Add navigation** | "Add [file] to docs.json under the [section] section" |
| **Check consistency** | "Review this file for consistency with other Continue documentation" |
| **Fix formatting** | "Review for Mintlify formatting issues and fix any problems" |
| **Extract examples** | "Find all examples of [topic] in Continue docs" |
| **Research feature** | "Use Continue Docs MCP to explain how [feature] works in Continue" |
---
## Resources
### Continue Documentation
- [Contributing Guide](/CONTRIBUTING) - Setup and submission process
- [Continue Docs MCP Reference](/reference/continue-mcp) - MCP server details
- [Understanding Agents](/guides/understanding-agents) - How agents work
### Mintlify
- [MCP Generation Guide](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs)
- [Mintlify Documentation](https://mintlify.com/docs)
### Community
- [Continue Discord](https://discord.gg/continue) - #documentation channel
- [GitHub Discussions](https://github.com/continuedev/continue/discussions)
---
## Next Steps
<CardGroup cols={2}>
<Card title="Start Contributing" icon="code" href="/CONTRIBUTING">
Set up your environment
</Card>
<Card title="Use Docs Agent" icon="robot" href="https://hub.continue.dev/continuedev/docs-mintlify">
Install pre-built agent
</Card>
<Card title="Browse Cookbooks" icon="book-open" href="/guides/overview">
See cookbook examples
</Card>
<Card title="Join Discord" icon="discord" href="https://discord.gg/continue">
Get help from community
</Card>
</CardGroup>

View file

@ -19,9 +19,11 @@ description: "Comprehensive collection of practical guides for Continue includin
Step-by-step guides for integrating Model Context Protocol (MCP) servers with Continue:
- [Continue Docs MCP Cookbook](/guides/continue-docs-mcp-cookbook) - Use the Continue Docs MCP to write cookbooks, guides, and documentation with AI-powered workflows
- [PostHog Session Analysis Cookbook](/guides/posthog-github-continuous-ai) - Analyze user behavior data to optimize your codebase with automatic issue creation
- [Netlify Performance Optimization Cookbook](/guides/netlify-mcp-continuous-deployment) - Optimize web performance with A/B testing and automated monitoring using Netlify MCP
- [Snyk + Continue Hub Agent Cookbook (MCP)](/guides/snyk-mcp-continue-cookbook) - Integrate Snyk MCP via Continue Hub to scan code, deps, IaC, and containers
- [dlt Data Pipelines Cookbook](/guides/dlt-mcp-continue-cookbook) - Build AI-powered data pipelines with dlt MCP for pipeline inspection, schema management, and debugging
## What Advanced Tutorials Are Available

View file

@ -67,6 +67,7 @@ First, you'll need to gather your PostHog and GitHub API credentials and add the
3. Name it "Continue CLI Session Analysis"
4. Select these scopes:
- `session_recording:read` - **Required** for accessing session data
- `feature_flag:read` - **Required** for feature flag auditing
- `insight:read`
- `query:read`
- `session_recording_playlist:read`
@ -212,9 +213,9 @@ You only need to configure the PostHog MCP credential - it automatically handles
<Warning>
**Repository Labels Required**: Make sure your GitHub repository has these labels:
- `bug`, `enhancement`
- `bug`, `enhancement`, `technical-debt`
- `high-priority`, `medium-priority`, `low-priority`
- `user-experience`, `automated`
- `user-experience`, `automated`, `feature-flag`, `cleanup`
Create missing labels in your repo at: **Settings → Labels → New label**
@ -266,7 +267,57 @@ After completing this guide, you have a complete **Continuous AI system** that:
</Warning>
## Advanced Prompts
## Example Use Cases
Here are practical examples of what you can build with PostHog MCP and Continue CLI:
### Session Recording Analysis (Current Implementation)
The main workflow above focuses on analyzing session recordings to identify UX issues and create GitHub issues automatically.
### Feature Flag Audit and Cleanup
<Card title="🏁 Feature Flag Management" icon="flag">
Automatically audit your feature flags to identify unused, outdated, or problematic flags that need attention.
</Card>
**What this workflow does:**
- Fetches all feature flags from your PostHog project
- Analyzes flag usage, rollout status, and configuration
- Identifies flags that may be candidates for removal or updates
- Creates GitHub issues for flag cleanup tasks
**Example Continue CLI prompts:**
```bash
# Get all feature flags and analyze them
cn "Use PostHog MCP to fetch all feature flags with mcp__posthog__feature-flag-get-all. Then analyze each flag to identify: 1) Flags that are 100% rolled out and could be removed, 2) Flags that haven't been updated in 90+ days, 3) Flags with complex targeting that might need simplification, 4) Experimental flags that should be cleaned up."
# Create cleanup issues for identified flags
cn "For each problematic feature flag identified, create a GitHub issue using gh CLI:
- Title: '🏁 Feature Flag Cleanup: [flag_name]'
- Include flag details: rollout percentage, last modified date, targeting rules
- Add labels: 'technical-debt', 'feature-flag', 'cleanup'
- Set priority based on risk level (high for 100% rollouts, medium for stale flags)
- Include specific recommendations for each flag"
# Audit flag performance impact
cn "Cross-reference feature flags with PostHog performance metrics to identify flags that may be impacting user experience or site performance. Create performance-focused GitHub issues for flags showing negative impact."
```
**Required PostHog MCP Tools:**
- `feature-flag-get-all` - Retrieve all feature flags
- `feature-flag-get-definition` - Get detailed flag configuration
- `query-run` - Run analytics queries to check flag usage
- `insights-get-all` - Get insights related to flag performance
**Sample Output:**
This workflow creates GitHub issues like:
- "🏁 Feature Flag Cleanup: dark-mode-toggle" (100% rollout, safe to remove)
- "🏁 Feature Flag Review: experimental-checkout" (unused for 120 days)
- "🏁 Feature Flag Simplify: complex-user-targeting" (overly complex rules)
### Advanced Prompts
Consider enhancing your workflow with these advanced Continue CLI prompts:
@ -280,13 +331,12 @@ Consider enhancing your workflow with these advanced Continue CLI prompts:
"Cross-reference JavaScript console errors with user actions to identify the
root cause of UX issues"
</Card>
<Card title="Feature Flag Analysis" icon="flag">
"Analyze how [PostHog feature flags](https://posthog.com/docs/feature-flags)
impact user behavior in session recordings"
<Card title="Feature Flag Performance Impact" icon="flag">
"Use PostHog MCP to correlate feature flag rollouts with performance metrics and user behavior changes to identify flags causing issues"
</Card>
<Card title="Custom Slack Alerts" icon="slack">
"Create Slack alerts when critical UX issues are detected in PostHog
sessions"
sessions or when feature flags need attention"
</Card>
</CardGroup>

View file

@ -0,0 +1,610 @@
---
title: "Content Management with Sanity MCP and Continue"
description: "Set up an AI-powered content management workflow that helps you manage schemas, run GROQ queries, handle documentation, and perform migrations using natural language commands."
sidebarTitle: "Sanity CMS with Continue"
---
<Card title="What You'll Build" icon="database">
An AI-powered content management system workflow that uses Continue's AI agent with Sanity
MCP to manage schemas, execute GROQ queries, handle migrations, and maintain documentation - all through simple natural language prompts
</Card>
## Prerequisites
Before starting, ensure you have:
- Continue account with **Hub access**
- Read: [Understanding Agents — How to get started with Hub agents](/guides/understanding-agents#how-to-get-started-with-hub-agents)
- Node.js 20+ installed locally
- A [Sanity account](https://www.sanity.io/) and project (free tier works)
- Basic understanding of content management systems
For all options, first:
<Steps>
<Step title="Install Continue CLI">
```bash
npm i -g @continuedev/cli
```
</Step>
<Step title="Install Sanity CLI">
```bash
npm install -g @sanity/cli
```
</Step>
</Steps>
<Warning>
To use agents in headless mode, you need a [Continue API key](https://hub.continue.dev/settings/api-keys) and proper environment variable configuration.
</Warning>
## Getting Started with Sanity
<Accordion title="New to Sanity? Start Here">
New to Sanity? Follow the [Sanity Getting Started Guide](https://www.sanity.io/docs/getting-started) to set up your first project.
**Quick setup:**
```bash
npm create sanity@latest
cd your-project-name
npm run dev
```
**Key resources:**
- [Sanity Studio](https://www.sanity.io/docs/sanity-studio) - Content editing interface
- [Schema Types](https://www.sanity.io/docs/schema-types) - Define content structure
- [GROQ](https://www.sanity.io/docs/groq) - Query language for fetching content
- [Content Lake](https://www.sanity.io/docs/datastore) - Real-time data store
</Accordion>
## Sanity MCP Workflow Options
<Card title="Fastest Path to Success" icon="rocket">
Skip the manual setup and use our pre-built Sanity Assistant agent that includes
the Sanity MCP and optimized content management workflows for more consistent results. You can [remix this agent](/guides/understanding-agents#how-to-get-started-with-hub-agents) to customize it for your specific needs.
</Card>
After ensuring you meet the **Prerequisites** above, you have two paths to get started:
<Tabs>
<Tab title="⚡ Quick Start (Recommended)">
<Steps>
<Step title="Load the Pre-Built Agent">
Visit the [Sanity Agent Config](https://hub.continue.dev/continuedev/sanity-agent-config) on Continue Hub and click **"Install Agent"** or run:
```bash
cn --config continuedev/sanity-agent-config
```
This agent includes:
- **[Sanity MCP](https://hub.continue.dev/sanity/sanity-mcp)** pre-configured and ready to use
- **Content management rules** for best practices
- **Schema optimization** guidelines
</Step>
<Step title="Your First MCP Conversation">
Start with these beginner-friendly prompts to explore your content:
```bash
# Content exploration
"Show me all blog posts published in the last month"
# Schema understanding
"Show me all the document types in my Sanity schema and explain their relationships"
# Content management
"Create a new product page for our upcoming feature"
```
That's it! The agent handles everything automatically. For more starter prompts and examples, see the [official Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol).
</Step>
</Steps>
<Info>
**Why Use the Agent?** The pre-built Sanity Assistant agent provides consistent content management workflows and handles MCP configuration automatically, making it easier to get started with AI-powered CMS operations. Results are more consistent and debugging is easier thanks to the [Sanity MCP](https://hub.continue.dev/sanity/sanity-mcp) integration and pre-tested prompts.
</Info>
</Tab>
<Tab title="🛠️ Manual Setup">
<Steps>
<Step title="Create a New Agent via the Continue Hub">
Go to the [Continue Hub](https://hub.continue.dev) and [create a new agent](https://hub.continue.dev/new?type=agent).
</Step>
<Step title="Connect Sanity MCP via Continue Hub">
Visit the [Sanity MCP on Continue Hub](https://hub.continue.dev/sanity/sanity-mcp) and click **"Install"** to add it to the agent you created in the step above.
This will add Sanity MCP to your agent's available tools. The Hub listing automatically configures the MCP connection.
<Tip>
**Alternative installation methods:**
1. **Quick CLI install**: `cn --mcp sanity/sanity-mcp`
2. **With config**: Use [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) for environment variable setup
3. **Manual configuration**: Add the MCP to your agent configuration
Once installed, Sanity MCP tools become available to your Continue agent for all prompts.
</Tip>
<Info>
**Authentication Options:**
- **Interactive mode**: OAuth authentication via browser (expires after 7 days)
- **Headless/CI mode**: Uses environment variables (SANITY_API_TOKEN, SANITY_PROJECT_ID, etc.)
See [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) for environment variable setup.
</Info>
</Step>
<Step title="Your First MCP Conversation">
Start with these beginner-friendly prompts:
```bash
cn
# Try these starter prompts:
# "Show me all blog posts published in the last month"
# "Show me all the document types in my Sanity schema and explain their relationships"
# "Create a new product page for our upcoming feature"
```
For more examples, see the [Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol).
</Step>
</Steps>
</Tab>
</Tabs>
<Accordion title="Agent Requirements">
To use the pre-built Sanity Assistant agent, you need either:
- **Continue CLI Pro Plan** with the models add-on, OR
- **Your own API keys** added to Continue Hub secrets
The agent will automatically detect and use your configuration along with the pre-configured Sanity MCP for content operations. Note that OAuth authentication will be required on first use.
</Accordion>
---
## Sanity MCP Capabilities
<Card title="Understanding the Capabilities" icon="info-circle">
**Sanity MCP** provides comprehensive tools for content management:
- Execute [GROQ queries](https://www.sanity.io/docs/groq) to fetch and analyze content
- Explore and modify [document schemas](https://www.sanity.io/docs/schema-types)
- Manage [content releases](https://www.sanity.io/docs/release-schedules) and versions
- Handle content [migrations](https://www.sanity.io/docs/migrating-data) between environments
- Automate documentation generation
- Perform bulk content operations
- Manage [localization](https://www.sanity.io/docs/localization) and translations
The MCP integrates seamlessly with your existing Sanity workspace, providing AI-powered assistance for both development and content operations.
</Card>
---
## Your First MCP Conversation
With everything set up, you're ready for your first AI-powered content conversation! Try these beginner-friendly starter prompts:
<CardGroup cols={2}>
<Card title="Content Discovery" icon="search">
```
"Show me all blog posts published in the last month"
```
</Card>
<Card title="Content Creation" icon="plus">
```
"Create a new product page for our upcoming feature"
```
</Card>
<Card title="Content Updates" icon="edit">
```
"Update our pricing information across all service pages"
```
</Card>
<Card title="Content Scheduling" icon="calendar">
```
"Schedule the Easter marketing campaign content release for next Tuesday"
```
</Card>
</CardGroup>
<Info>
**New to MCP?** These prompts demonstrate the power of natural language content management. For more examples and detailed explanations, check out the [official Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol).
</Info>
## Content Management Recipes
Now you can use natural language prompts to manage your Sanity content and schemas. The Continue agent automatically calls the appropriate Sanity MCP tools.
<Info>
You can add prompts to your agent's configuration for easy access in future sessions. Go to your agent in the [Continue Hub](https://hub.continue.dev), click **Edit**, and add prompts under the **Prompts** section.
</Info>
<Info>
**Where to run these workflows:**
- **IDE Extensions**: Use Continue in VS Code, JetBrains, or other supported IDEs
- **Terminal (TUI mode)**: Run `cn` to enter interactive mode, then type your prompts
- **CLI (headless mode)**: Use `cn -p "your prompt"` for headless commands
**Test in Plan Mode First**: Before running operations that might make
changes, test your prompts in plan mode (see the [Plan Mode
Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes in TUI/IDE). This
shows you what the agent will do without executing it.
</Info>
<Info>
**About the --auto flag**: The `--auto` flag enables tools to run continuously without manual confirmation. This is essential for headless mode where the agent needs to execute multiple tools automatically to complete tasks like schema exploration, GROQ execution, and content migration.
</Info>
### Schema Management
<Card title="Explore Document Types" icon="diagram-project">
Review and understand your content schema structure.
**TUI Mode Prompt:**
```
Show me all document types in my Sanity schema with their fields,
validation rules, and relationships to other types.
```
**Headless Mode Prompt:**
```bash
cn -p "Show me all document types in my Sanity schema with their fields, validation rules, and relationships to other types." --auto
```
</Card>
### GROQ Queries
<Card title="Execute GROQ Queries" icon="magnifying-glass">
Run GROQ queries to fetch and analyze content.
**TUI Mode Prompt:**
```
Run a GROQ query to fetch all articles published in the last 30 days,
including their titles, authors, categories, and view counts.
```
**Headless Mode Prompt:**
```bash
cn -p "Run a GROQ query to fetch all articles published in the last 30 days, including their titles, authors, categories, and view counts." --auto
```
</Card>
### Content Operations
<Card title="Bulk Content Updates" icon="arrows-rotate">
Perform bulk operations on your content.
**TUI Mode Prompt:**
```
Find all blog posts with the category "News" and update their
status to "archived" if they are older than 6 months.
```
**Headless Mode Prompt:**
```bash
cn -p "Find all blog posts with the category 'News' and update their status to 'archived' if they are older than 6 months." --auto
```
</Card>
### Localization
<Card title="Add Localization Support" icon="language">
Set up and manage content translations.
**TUI Mode Prompt:**
```
Add localization support to my article document type for
Spanish and French languages with appropriate field configurations.
```
**Headless Mode Prompt:**
```bash
cn -p "Add localization support to my article document type for Spanish and French languages with appropriate field configurations." --auto
```
</Card>
### Content Migration
<Card title="Migrate Content Structure" icon="right-left">
Migrate content between different schemas or environments.
**TUI Mode Prompt:**
```
Help me migrate my blog posts from the old schema structure
to the new one, mapping the deprecated fields to the new format.
```
**Headless Mode Prompt:**
```bash
cn -p "Help me migrate my blog posts from the old schema structure to the new one, mapping the deprecated fields to the new format." --auto
```
</Card>
### Documentation Generation
<Card title="Generate Schema Documentation" icon="book">
Automatically generate documentation for your content model.
**TUI Mode Prompt:**
```
Generate comprehensive documentation for my Sanity schema including
all document types, their purposes, field descriptions, and usage examples.
```
**Headless Mode Prompt:**
```bash
cn -p "Generate comprehensive documentation for my Sanity schema including all document types, their purposes, field descriptions, and usage examples." --auto
```
</Card>
### Content Releases
<Card title="Manage Content Releases" icon="rocket">
Work with Sanity's content release feature.
**TUI Mode Prompt:**
```
List all active releases in my dataset and show me the content
changes scheduled for each release.
```
**Headless Mode Prompt:**
```bash
cn -p "List all active releases in my dataset and show me the content changes scheduled for each release." --auto
```
</Card>
### Performance Analysis
<Card title="Analyze Query Performance" icon="gauge-high">
Optimize GROQ queries for better performance.
**TUI Mode Prompt:**
```
Analyze the performance of my most frequent GROQ queries and
suggest optimizations to improve response times.
```
**Headless Mode Prompt:**
```bash
cn -p "Analyze the performance of my most frequent GROQ queries and suggest optimizations to improve response times." --auto
```
</Card>
## Continuous Content Management with GitHub Actions
This example demonstrates a **Continuous AI workflow** where content validation and schema checks run automatically in your CI/CD pipeline in headless mode using the Sanity agent config. Consider [remixing this agent](/guides/understanding-agents#how-to-get-started-with-hub-agents) to add your organization's specific content governance rules.
### Add GitHub Secrets
Navigate to **Repository Settings → Secrets and variables → Actions** and add:
- `CONTINUE_API_KEY`: Your Continue API key from [hub.continue.dev/settings/api-keys](https://hub.continue.dev/settings/api-keys)
- `SANITY_PROJECT_ID`: Your Sanity project ID
- `SANITY_DATASET`: Your Sanity dataset name (usually "production")
- `SANITY_API_TOKEN`: Your Sanity API token with appropriate permissions
- `MCP_USER_ROLE`: Your MCP user role (typically "admin" or "editor")
<Info>
The workflow uses the [Sanity Agent Config](https://hub.continue.dev/continuedev/sanity-agent-config) with environment variable authentication via [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config). This enables headless mode operation without OAuth browser authentication.
</Info>
### Create Workflow File
This workflow automatically validates your Sanity schemas and content on pull requests using the Continue CLI in [headless mode](/cli/overview#headless-mode%3A-production-automation). It checks schema integrity, validates content relationships, and posts a summary report as a PR comment.
Create `.github/workflows/sanity-content-validation.yml` in your repository:
```yaml
name: Sanity Content Validation with MCP
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
validate-content:
runs-on: ubuntu-latest
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
SANITY_PROJECT_ID: ${{ secrets.SANITY_PROJECT_ID }}
SANITY_DATASET: ${{ secrets.SANITY_DATASET }}
SANITY_API_TOKEN: ${{ secrets.SANITY_API_TOKEN }}
MCP_USER_ROLE: ${{ secrets.MCP_USER_ROLE }}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install Sanity CLI
run: |
npm install -g @sanity/cli
echo "✅ Sanity CLI installed"
- name: Install Continue CLI
run: |
npm install -g @continuedev/cli
echo "✅ Continue CLI installed"
- name: Validate Schema Structure
run: |
echo "🔍 Validating schema structure..."
cn --config continuedev/sanity-agent-config \
-p "Analyze the Sanity schema for any structural issues,
missing required fields, or broken references between document types." \
--auto
- name: Check Content Integrity
run: |
echo "📊 Checking content integrity..."
cn --config continuedev/sanity-agent-config \
-p "Run GROQ queries to identify any orphaned documents,
broken references, or missing required fields in the content." \
--auto
- name: Generate Schema Documentation
run: |
echo "📝 Generating schema documentation..."
cn --config continuedev/sanity-agent-config \
-p "Generate a markdown summary of all schema changes
in this PR and their potential impact on existing content." \
--auto > schema-changes.md
- name: Comment Report on PR
if: always() && github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPORT=$(cn --config continuedev/sanity-agent-config \
-p "Generate a concise summary (200 words or less) of:
- Schema validation results
- Content integrity checks
- Any breaking changes detected
- Recommended actions before merging" \
--auto)
gh pr comment ${{ github.event.pull_request.number }} --body "$REPORT"
```
<Info>
Environment variables enable the MCP to authenticate without OAuth browser prompts. The [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) documentation provides detailed setup instructions for all required variables.
</Info>
## Content Management Best Practices
Implement automated content quality checks using Continue's rule system. See the [Rules deep dive](/customize/deep-dives/rules) for authoring tips.
<Card title="Schema Validation" icon="check-circle">
```bash
"Before deploying schema changes, validate that all required fields
are present and that no breaking changes affect existing content."
```
</Card>
<Card title="Content Consistency" icon="shield-exclamation">
```bash
"When creating new content types, ensure they follow the existing
naming conventions and field patterns established in the schema."
```
</Card>
<Card title="Query Optimization" icon="gauge-high">
```bash
"Review GROQ queries for performance issues and suggest indexes
or query restructuring to improve response times."
```
</Card>
<Card title="Localization Standards" icon="check-double">
```bash
"Ensure all user-facing content fields have proper localization
support configured for the required languages."
```
</Card>
## Troubleshooting
### Authentication Issues
```bash
"Check if I'm properly authenticated with Sanity.
If not, help me set up OAuth or API token authentication."
```
### Schema Not Found
```bash
"Verify that the Sanity project is properly configured
and that the schema files are accessible in the current directory."
```
### GROQ Query Errors
```bash
"Debug this GROQ query and explain why it's failing,
then provide a corrected version that achieves the intended result."
```
### Migration Conflicts
<Check>
**Verification Steps:**
- Sanity MCP is installed via [Continue Hub](https://hub.continue.dev/sanity/sanity-mcp)
- Project is authenticated with Sanity
- Schema files are present and valid
- Dataset permissions are correctly configured
</Check>
## What You've Built
After completing this guide, you have a complete **AI-powered content management system** that:
- ✅ Uses natural language — Simple prompts instead of complex CMS commands
- ✅ Manages schemas automatically — AI handles schema evolution and migrations
- ✅ Runs continuously — Automated validation in CI/CD pipelines
- ✅ Ensures quality — Content checks prevent broken references and invalid data
<Card title="Continuous AI" icon="rocket">
Your content management workflow now operates at **[Level 2 Continuous
AI](https://blog.continue.dev/what-is-continuous-ai-a-developers-guide/)** -
AI handles routine content operations and schema management with human oversight
through review and approval of changes.
</Card>
## Next Steps
1. **Explore your schema** - Try the schema exploration prompt on your current project
2. **Run GROQ queries** - Use natural language to query your content
3. **Set up CI validation** - Add the GitHub Actions workflow to your repo
4. **Create documentation** - Generate comprehensive docs for your content model
5. **Optimize performance** - Analyze and improve query performance
## Additional Resources
<CardGroup cols={2}>
<Card title="Sanity Documentation" icon="book" href="https://www.sanity.io/docs">
Complete Sanity platform documentation
</Card>
<Card title="Continue Hub" icon="plug" href="https://hub.continue.dev">
Explore more MCP integrations and agents
</Card>
<Card
title="GROQ Documentation"
icon="code"
href="https://www.sanity.io/docs/groq"
>
Learn GROQ query language
</Card>
<Card
title="Sanity MCP Blog Post"
icon="newspaper"
href="https://www.sanity.io/blog/model-context-protocol"
>
Official Sanity MCP introduction with examples
</Card>
<Card
title="Sanity MCP Setup"
icon="puzzle-piece"
href="https://www.sanity.io/docs/compute-and-ai/mcp-server"
>
Official Sanity MCP documentation
</Card>
</CardGroup>

View file

@ -14,6 +14,7 @@ export function addCommonOptions(command: Command): Command {
.option("--readonly", "Start in plan mode (read-only tools)")
.option("--auto", "Start in auto mode (all tools allowed)")
.option("--verbose", "Enable verbose logging")
.option("--beta-status-tool", "Enable beta status tool")
.option(
"--rule <rule>",
"Add a rule (can be a file path, hub slug, or string content). Can be specified multiple times.",

View file

@ -24,12 +24,14 @@ export const statusTool: Tool = {
displayName: "Status",
description: `Set the current status of your task for the user to see
The available statuses are:
The default available statuses are:
- PLANNING: You are creating a plan before beginning implementation
- WORKING: The task is in progress
- DONE: The task is complete
- BLOCKED: You need further information from the user in order to proceed
However, if the user explicitly specifies in their prompt to use one or more different statuses, you can use those as well.
You should use this tool to notify the user whenever the state of your work changes. By default, the status is assumed to be "PLANNING" prior to you setting a different status.`,
parameters: {
type: "object",

View file

@ -1,4 +1,6 @@
import { ToolCallState } from "core";
import { ContinueErrorReason } from "core/util/errors";
import posthog from "posthog-js";
import { IIdeMessenger } from "../../context/IdeMessenger";
import {
errorToolCall,
@ -15,25 +17,29 @@ export async function preprocessToolCalls(
// Tool call pre-processing
await Promise.all(
generatedToolCalls.map(async (tcState) => {
try {
const result = await ideMessenger.request("tools/preprocessArgs", {
let errorReason: ContinueErrorReason | undefined = undefined;
let errorMessage: string | undefined = undefined;
let preprocessedArgs: Record<string, unknown> | undefined = undefined;
const result = await ideMessenger.request("tools/preprocessArgs", {
toolName: tcState.toolCall.function.name,
args: tcState.parsedArgs,
});
if (result.status === "success") {
preprocessedArgs = result.content.preprocessedArgs;
errorMessage = result.content.errorMessage;
errorReason = result.content.errorReason;
} else {
errorMessage = result.error;
errorReason = ContinueErrorReason.Unknown;
}
if (errorReason) {
posthog.capture("tool_call_outcome", {
// model: , TODO
succeeded: false,
toolName: tcState.toolCall.function.name,
args: tcState.parsedArgs,
errorReason,
duration_ms: 0, // preprocessing is more or less instantaneous
});
if (result.status === "success") {
if (result.content.preprocessedArgs) {
dispatch(
setToolCallArgs({
toolCallId: tcState.toolCallId,
newArgs: result.content.preprocessedArgs,
}),
);
}
} else {
throw new Error(result.error);
}
} catch (e) {
let errorMessage = e instanceof Error ? e.message : `Unknown error`;
dispatch(
errorToolCall({
toolCallId: tcState.toolCallId,
@ -53,6 +59,13 @@ export async function preprocessToolCalls(
],
}),
);
} else if (preprocessedArgs) {
dispatch(
setToolCallArgs({
toolCallId: tcState.toolCallId,
newArgs: preprocessedArgs,
}),
);
}
}),
);

View file

@ -3,6 +3,7 @@ import { requestOptionsSchema } from "../../schemas/models.js";
const baseMcpServerSchema = z.object({
name: z.string(),
serverName: z.string().optional(),
faviconUrl: z.string().optional(),
sourceFile: z.string().optional(), // Added during loading
connectionTimeout: z.number().gt(0).optional(),