From 9e1412c48487929e7cb7398fe2a47adae34b5978 Mon Sep 17 00:00:00 2001 From: "continue[bot]" Date: Wed, 26 Nov 2025 19:13:31 +0000 Subject: [PATCH] docs: document MCP secret resolution fallback behavior Adds documentation explaining how the CLI resolves secrets for MCP servers, including the fallback from org/package secrets to local environment variables. This documents the fix from PR #8899 that allows env vars to override inaccessible org secrets in devboxes and restricted environments. Co-authored-by: nate Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- extensions/cli/spec/mcp.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/extensions/cli/spec/mcp.md b/extensions/cli/spec/mcp.md index aefd19608..1ba40eb5f 100644 --- a/extensions/cli/spec/mcp.md +++ b/extensions/cli/spec/mcp.md @@ -4,6 +4,24 @@ Model Context Protocol is a protocol for giving models access to resources and tools. MCP servers can run locally (stdio) or be remote (http/streamable/etc). See https://modelcontextprotocol.io/specification. The Continue CLI uses MCP to extend model's capabilities with MCP prompts and tools. MCP server configurations are stored in the `mcpServers` field of an assistant/config.yaml configuration. +## Secret Resolution + +MCP server configurations often require secrets (API keys, tokens, etc.) referenced using template variables like `${{ secrets.API_KEY }}`. The CLI resolves these secrets in the following order: + +1. **Organization/Package Secrets**: First attempts to resolve secrets through the Continue API for organization or package-level secrets +2. **Local Environment Variables**: Falls back to local environment variables if: + - The API secret exists but isn't accessible locally (e.g., in devboxes or restricted environments) + - The secret isn't found in organization/package secrets + +Local environment variables are checked in this priority order: + +- `process.env` (runtime environment variables) +- `~/.continue/.env` +- `/.continue/.env` +- `/.env` + +This fallback mechanism ensures MCP servers can start successfully in environments where organization secrets aren't accessible, such as development containers or CI/CD pipelines, by allowing environment variables to provide the required credentials. + ## MCP Service The CLI has an MCP Service should manage connections to MCP servers and provide state to the terminal app regarding MCP server connections.