File tree Expand file tree Collapse file tree 2 files changed +20
-27
lines changed
packages/config-yaml/src/schemas/mcp Expand file tree Collapse file tree 2 files changed +20
-27
lines changed Original file line number Diff line number Diff line change @@ -111,29 +111,24 @@ export async function loadJsonMcpConfigs(
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 ] ) => ( {
Original file line number Diff line number Diff line change @@ -31,22 +31,20 @@ export const mcpServersRecordSchema = z.record(
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
38
38
> ;
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
You can’t perform that action at this time.
0 commit comments