Changesets · Branches · Tags · Compare
| Changeset | 4d8ba150996e16210ebee05da53ffdbf131d5645d54ecb2f4429e8f7f96b85e5 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-26 14:12 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-26 14:12 -07:00 |
| Parents | 10c5b5803a97 |
2 files changed
modified core/context/mcp/json/loadJsonMcpConfigs.ts +13 −18
| @@ -111,29 +111,24 @@ | ||
| 111 | 111 | ), |
| 112 | 112 | ); |
| 113 | 113 | } |
| 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 | + ); | |
| 128 | 126 | } |
| 129 | 127 | } |
| 130 | 128 | } else { |
| 131 | 129 | const claudeDesktopFileParsed = |
| 132 | 130 | claudeDesktopLikeConfigFileSchema.safeParse(json); |
| 133 | - if ( | |
| 134 | - claudeDesktopFileParsed.success && | |
| 135 | - claudeDesktopFileParsed.data.mcpServers | |
| 136 | - ) { | |
| 131 | + if (claudeDesktopFileParsed.success) { | |
| 137 | 132 | validJsonConfigs.push( |
| 138 | 133 | ...Object.entries(claudeDesktopFileParsed.data.mcpServers).map( |
| 139 | 134 | ([name, mcpJson]) => ({ |
modified packages/config-yaml/src/schemas/mcp/json.ts +7 −9
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | export type McpServersJsonConfigRecord = z.infer<typeof mcpServersRecordSchema>; |
| 32 | 32 | |
| 33 | 33 | export const claudeDesktopLikeConfigFileSchema = z.object({ |
| 34 | - mcpServers: mcpServersRecordSchema.optional(), | |
| 34 | + mcpServers: mcpServersRecordSchema, | |
| 35 | 35 | }); |
| 36 | 36 | export type McpServersJsonConfigFile = z.infer< |
| 37 | 37 | typeof claudeDesktopLikeConfigFileSchema |
| @@ -39,14 +39,12 @@ | ||
| 39 | 39 | |
| 40 | 40 | export const claudeCodeLikeConfigFileSchema = z.object({ |
| 41 | 41 | 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 | + ), | |
| 50 | 48 | }); |
| 51 | 49 | export type claudeCodeLikeConfigFileSchema = z.infer< |
| 52 | 50 | typeof claudeCodeLikeConfigFileSchema |