Merge pull request #5591 from uinstinct/mcp-unsubstituted

error message when mcp arg has unsubstituted variable
This commit is contained in:
Nate Sesti 2025-05-12 16:02:57 -07:00 • committed by GitHub
commit d7868d65c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
);