diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 95a4bdc30..e667415d2 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -9,6 +9,7 @@ import { PackageIdentifier, RegistryClient, Rule, + TEMPLATE_VAR_REGEX, unrollAssistant, validateConfigYaml, } from "@continuedev/config-yaml"; @@ -72,7 +73,7 @@ function convertYamlMcpToContinueMcp( args: server.args ?? [], env: server.env, }, - timeout: server.connectionTimeout + timeout: server.connectionTimeout, }; } @@ -241,6 +242,21 @@ async function configYamlToContinueConfig(options: { rootUrl: doc.rootUrl, faviconUrl: doc.faviconUrl, })); + + config.mcpServers?.forEach((mcpServer) => { + const mcpArgVariables = + mcpServer.args?.filter((arg) => TEMPLATE_VAR_REGEX.test(arg)) ?? []; + + if (mcpArgVariables.length === 0) { + return; + } + + localErrors.push({ + fatal: false, + message: `MCP server "${mcpServer.name}" has unsubstituted variables in args: ${mcpArgVariables.join(", ")}. Please refer to https://docs.continue.dev/hub/secrets/secret-types for managing hub secrets.`, + }); + }); + continueConfig.experimental = { modelContextProtocolServers: config.mcpServers?.map( convertYamlMcpToContinueMcp, @@ -445,7 +461,7 @@ async function configYamlToContinueConfig(options: { args: [], ...server, }, - timeout: server.connectionTimeout + timeout: server.connectionTimeout, })), false, );