Merge pull request #5591 from uinstinct/mcp-unsubstituted
error message when mcp arg has unsubstituted variable
This commit is contained in:
commit
d7868d65c5
1 changed files with 18 additions and 2 deletions
|
|
@ -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,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue