Elffuss BraidHub

kikocis/continue public

fix: json mcp loading (#8002)

Changeset4d8ba150996e16210ebee05da53ffdbf131d5645d54ecb2f4429e8f7f96b85e5
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-26 14:12 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-26 14:12 -07:00
Parents10c5b5803a97

Browse the files at this changeset

2 files changed

modified core/context/mcp/json/loadJsonMcpConfigs.ts +13 −18
@@ -111,29 +111,24 @@
111111 ),
112112 );
113113 }
114- if (claudeCodeFileParsed.data.projects) {
115- const projectServers = Object.values(
116- claudeCodeFileParsed.data.projects,
117- ).map((v) => v.mcpServers);
118- for (const mcpServers of projectServers) {
119- if (mcpServers) {
120- validJsonConfigs.push(
121- ...Object.entries(mcpServers).map(([name, mcpJson]) => ({
122- name,
123- mcpJson,
124- uri,
125- })),
126- );
127- }
114+ const projectServers = Object.values(
115+ claudeCodeFileParsed.data.projects,
116+ ).map((v) => v.mcpServers);
117+ for (const mcpServers of projectServers) {
118+ if (mcpServers) {
119+ validJsonConfigs.push(
120+ ...Object.entries(mcpServers).map(([name, mcpJson]) => ({
121+ name,
122+ mcpJson,
123+ uri,
124+ })),
125+ );
128126 }
129127 }
130128 } else {
131129 const claudeDesktopFileParsed =
132130 claudeDesktopLikeConfigFileSchema.safeParse(json);
133- if (
134- claudeDesktopFileParsed.success &&
135- claudeDesktopFileParsed.data.mcpServers
136- ) {
131+ if (claudeDesktopFileParsed.success) {
137132 validJsonConfigs.push(
138133 ...Object.entries(claudeDesktopFileParsed.data.mcpServers).map(
139134 ([name, mcpJson]) => ({
modified packages/config-yaml/src/schemas/mcp/json.ts +7 −9
@@ -31,7 +31,7 @@
3131 export type McpServersJsonConfigRecord = z.infer<typeof mcpServersRecordSchema>;
3232
3333 export const claudeDesktopLikeConfigFileSchema = z.object({
34- mcpServers: mcpServersRecordSchema.optional(),
34+ mcpServers: mcpServersRecordSchema,
3535 });
3636 export type McpServersJsonConfigFile = z.infer<
3737 typeof claudeDesktopLikeConfigFileSchema
@@ -39,14 +39,12 @@
3939
4040 export const claudeCodeLikeConfigFileSchema = z.object({
4141 mcpServers: mcpServersRecordSchema.optional(),
42- projects: z
43- .record(
44- z.string(),
45- z.object({
46- mcpServers: mcpServersRecordSchema.optional(),
47- }),
48- )
49- .optional(),
42+ projects: z.record(
43+ z.string(),
44+ z.object({
45+ mcpServers: mcpServersRecordSchema.optional(),
46+ }),
47+ ),
5048 });
5149 export type claudeCodeLikeConfigFileSchema = z.infer<
5250 typeof claudeCodeLikeConfigFileSchema