File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed
templates/initial-agents-dir/types Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ export const mcpConfigRemoteSchema = z.strictObject({
218218 type : z . enum ( [ 'http' , 'sse' ] ) . default ( 'http' ) ,
219219 url : z . string ( ) ,
220220 params : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
221+ headers : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
221222} )
222223
223224export const mcpConfigSchema = z . union ( [
Original file line number Diff line number Diff line change @@ -62,9 +62,17 @@ export async function getMCPClient(config: MCPConfig): Promise<string> {
6262 url . searchParams . set ( key , value )
6363 }
6464 if ( config . type === 'http' ) {
65- transport = new StreamableHTTPClientTransport ( url )
65+ transport = new StreamableHTTPClientTransport ( url , {
66+ requestInit : {
67+ headers : config . headers ,
68+ } ,
69+ } )
6670 } else if ( config . type === 'sse' ) {
67- transport = new SSEClientTransport ( url )
71+ transport = new SSEClientTransport ( url , {
72+ requestInit : {
73+ headers : config . headers ,
74+ } ,
75+ } )
6876 } else {
6977 config . type satisfies never
7078 throw new Error ( `Internal error: invalid MCP config type ${ config . type } ` )
Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ export const mcpConfigStdioSchema = z.strictObject({
212212 . array ( )
213213 . default ( ( ) => [ ] ) ,
214214 env : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
215+ headers : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
215216} )
216217
217218export const mcpConfigRemoteSchema = z . strictObject ( {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const mcpConfigRemoteSchema = z.strictObject({
1414 type : z . enum ( [ 'http' , 'sse' ] ) . default ( 'http' ) ,
1515 url : z . string ( ) ,
1616 params : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
17+ headers : z . record ( z . string ( ) , z . string ( ) ) . default ( ( ) => ( { } ) ) ,
1718} )
1819
1920export const mcpConfigSchema = z . union ( [
You can’t perform that action at this time.
0 commit comments