@@ -140,15 +140,29 @@ describe("resolveMcpTransportConfig", () => {
140140 NODE_OPTIONS : "--require=./evil.js" ,
141141 } ,
142142 } ) ;
143+ const firstCollidingPair = resolveMcpTransportConfig ( "svc" , {
144+ command : "node" ,
145+ env : {
146+ "LD_A:LD_B" : "/tmp/workspace" ,
147+ } ,
148+ } ) ;
149+ const secondCollidingPair = resolveMcpTransportConfig ( "svc:LD_A" , {
150+ command : "node" ,
151+ env : {
152+ LD_B : "/tmp/workspace" ,
153+ } ,
154+ } ) ;
143155
144156 for ( const resolved of [
145157 ...repeatedResolutions ,
146158 sameKeyDifferentServer ,
147159 sameServerDifferentKey ,
160+ firstCollidingPair ,
161+ secondCollidingPair ,
148162 ] ) {
149163 expect ( resolved ) . toEqual ( expect . objectContaining ( { env : { } } ) ) ;
150164 }
151- expect ( logWarn ) . toHaveBeenCalledTimes ( 3 ) ;
165+ expect ( logWarn ) . toHaveBeenCalledTimes ( 5 ) ;
152166 expect ( logWarn ) . toHaveBeenNthCalledWith (
153167 1 ,
154168 'bundle-mcp: server "repeat-server": env "PYTHONPATH" is blocked for stdio startup safety and was ignored.' ,
@@ -161,6 +175,14 @@ describe("resolveMcpTransportConfig", () => {
161175 3 ,
162176 'bundle-mcp: server "repeat-server": env "NODE_OPTIONS" is blocked for stdio startup safety and was ignored.' ,
163177 ) ;
178+ expect ( logWarn ) . toHaveBeenNthCalledWith (
179+ 4 ,
180+ 'bundle-mcp: server "svc": env "LD_A:LD_B" is blocked for stdio startup safety and was ignored.' ,
181+ ) ;
182+ expect ( logWarn ) . toHaveBeenNthCalledWith (
183+ 5 ,
184+ 'bundle-mcp: server "svc:LD_A": env "LD_B" is blocked for stdio startup safety and was ignored.' ,
185+ ) ;
164186 } ) ;
165187
166188 it ( "uses an explicit empty stdio env when all configured env keys are blocked" , ( ) => {
0 commit comments