@@ -20,9 +20,10 @@ const createServerConfigSchema = () => {
2020 args : z . array ( z . string ( ) ) . optional ( ) ,
2121 cwd : z . string ( ) . default ( ( ) => vscode . workspace . workspaceFolders ?. at ( 0 ) ?. uri . fsPath ?? process . cwd ( ) ) ,
2222 env : z . record ( z . string ( ) ) . optional ( ) ,
23- // Ensure no SSE fields are present
23+ // Ensure no HTTP fields are present
2424 url : z . undefined ( ) . optional ( ) ,
2525 headers : z . undefined ( ) . optional ( ) ,
26+ sessionId : z . undefined ( ) . optional ( ) ,
2627 } )
2728 . transform ( ( data ) => ( {
2829 ...data ,
@@ -35,6 +36,7 @@ const createServerConfigSchema = () => {
3536 type : z . enum ( [ "sse" ] ) . optional ( ) ,
3637 url : z . string ( ) . url ( "URL must be a valid URL format" ) ,
3738 headers : z . record ( z . string ( ) ) . optional ( ) ,
39+ sessionId : z . undefined ( ) . optional ( ) ,
3840 // Ensure no stdio fields are present
3941 command : z . undefined ( ) . optional ( ) ,
4042 args : z . undefined ( ) . optional ( ) ,
@@ -46,6 +48,26 @@ const createServerConfigSchema = () => {
4648 type : "sse" as const ,
4749 } ) )
4850 . refine ( ( data ) => data . type === undefined || data . type === "sse" , { message : typeErrorMessage } ) ,
51+
52+ // Streamable HTTP config (has url field and optional sessionId)
53+ BaseConfigSchema . extend ( {
54+ type : z . enum ( [ "streamable-http" ] ) . optional ( ) ,
55+ url : z . string ( ) . url ( "URL must be a valid URL format" ) ,
56+ headers : z . record ( z . string ( ) ) . optional ( ) ,
57+ sessionId : z . string ( ) . optional ( ) ,
58+ // Ensure no stdio fields are present
59+ command : z . undefined ( ) . optional ( ) ,
60+ args : z . undefined ( ) . optional ( ) ,
61+ cwd : z . undefined ( ) . optional ( ) ,
62+ env : z . undefined ( ) . optional ( ) ,
63+ } )
64+ . transform ( ( data ) => ( {
65+ ...data ,
66+ type : "streamable-http" as const ,
67+ } ) )
68+ . refine ( ( data ) => data . type === undefined || data . type === "streamable-http" , {
69+ message : typeErrorMessage ,
70+ } ) ,
4971 ] )
5072}
5173
0 commit comments