@@ -285,18 +285,16 @@ const localDenoHandler = async ({
285285
286286 // Strip null/undefined values so that the worker SDK client can fall back to
287287 // reading from environment variables (including any upstreamClientEnvs).
288- const opts : ClientOptions = Object . fromEntries (
289- Object . entries ( {
290- baseURL : client . baseURL ,
291- accessToken : client . accessToken ,
292- clientID : client . clientID ,
293- clientSecret : client . clientSecret ,
294- webhookSecret : client . webhookSecret ,
295- defaultHeaders : {
296- 'X-Stainless-MCP' : 'true' ,
297- } ,
298- } ) . filter ( ( [ _ , v ] ) => v != null ) ,
299- ) as ClientOptions ;
288+ const opts = {
289+ ...( client . baseURL != null ? { baseURL : client . baseURL } : undefined ) ,
290+ ...( client . accessToken != null ? { accessToken : client . accessToken } : undefined ) ,
291+ ...( client . clientID != null ? { clientID : client . clientID } : undefined ) ,
292+ ...( client . clientSecret != null ? { clientSecret : client . clientSecret } : undefined ) ,
293+ ...( client . webhookSecret != null ? { webhookSecret : client . webhookSecret } : undefined ) ,
294+ defaultHeaders : {
295+ 'X-Stainless-MCP' : 'true' ,
296+ } ,
297+ } satisfies Partial < ClientOptions > as ClientOptions ;
300298
301299 const req = worker . request (
302300 'http://localhost' ,
0 commit comments