@@ -239,12 +239,12 @@ describe('callTool()', () => {
239239describe ( 'addServer()' , ( ) => {
240240 let loadStub : sinon . SinonStub
241241 let initOneStub : sinon . SinonStub
242- let saveAgentConfigStub : sinon . SinonStub
242+ let saveServerSpecificAgentConfigStub : sinon . SinonStub
243243
244244 beforeEach ( ( ) => {
245245 loadStub = stubAgentConfig ( )
246246 initOneStub = stubInitOneServer ( )
247- saveAgentConfigStub = sinon . stub ( mcpUtils , 'saveAgentConfig ' ) . resolves ( )
247+ saveServerSpecificAgentConfigStub = sinon . stub ( mcpUtils , 'saveServerSpecificAgentConfig ' ) . resolves ( )
248248 } )
249249
250250 afterEach ( async ( ) => {
@@ -268,7 +268,7 @@ describe('addServer()', () => {
268268
269269 await mgr . addServer ( 'newS' , newCfg , 'path.json' )
270270
271- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
271+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
272272 expect ( initOneStub . calledOnceWith ( 'newS' , sinon . match ( newCfg ) ) ) . to . be . true
273273 } )
274274
@@ -301,14 +301,14 @@ describe('addServer()', () => {
301301
302302 await mgr . addServer ( 'httpSrv' , httpCfg , 'http.json' )
303303
304- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
304+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
305305 expect ( initOneStub . calledOnceWith ( 'httpSrv' , sinon . match ( httpCfg ) ) ) . to . be . true
306306 } )
307307} )
308308
309309describe ( 'removeServer()' , ( ) => {
310310 let loadStub : sinon . SinonStub
311- let saveAgentConfigStub : sinon . SinonStub
311+ let saveServerSpecificAgentConfigStub : sinon . SinonStub
312312 let existsStub : sinon . SinonStub
313313 let readFileStub : sinon . SinonStub
314314 let writeFileStub : sinon . SinonStub
@@ -318,7 +318,7 @@ describe('removeServer()', () => {
318318
319319 beforeEach ( ( ) => {
320320 loadStub = stubAgentConfig ( )
321- saveAgentConfigStub = sinon . stub ( mcpUtils , 'saveAgentConfig ' ) . resolves ( )
321+ saveServerSpecificAgentConfigStub = sinon . stub ( mcpUtils , 'saveServerSpecificAgentConfig ' ) . resolves ( )
322322 existsStub = sinon . stub ( fakeWorkspace . fs , 'exists' ) . resolves ( true )
323323 readFileStub = sinon
324324 . stub ( fakeWorkspace . fs , 'readFile' )
@@ -364,7 +364,7 @@ describe('removeServer()', () => {
364364 }
365365
366366 await mgr . removeServer ( 'x' )
367- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
367+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
368368 expect ( ( mgr as any ) . clients . has ( 'x' ) ) . to . be . false
369369 } )
370370
@@ -395,8 +395,8 @@ describe('removeServer()', () => {
395395
396396 await mgr . removeServer ( 'x' )
397397
398- // Verify that saveAgentConfig was called
399- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
398+ // Verify that saveServerSpecificAgentConfig was called
399+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
400400 expect ( ( mgr as any ) . clients . has ( 'x' ) ) . to . be . false
401401
402402 // Verify server was removed from agent config
@@ -472,11 +472,11 @@ describe('mutateConfigFile()', () => {
472472describe ( 'updateServer()' , ( ) => {
473473 let loadStub : sinon . SinonStub
474474 let initOneStub : sinon . SinonStub
475- let saveAgentConfigStub : sinon . SinonStub
475+ let saveServerSpecificAgentConfigStub : sinon . SinonStub
476476
477477 beforeEach ( ( ) => {
478478 initOneStub = stubInitOneServer ( )
479- saveAgentConfigStub = sinon . stub ( mcpUtils , 'saveAgentConfig ' ) . resolves ( )
479+ saveServerSpecificAgentConfigStub = sinon . stub ( mcpUtils , 'saveServerSpecificAgentConfig ' ) . resolves ( )
480480 } )
481481
482482 afterEach ( async ( ) => {
@@ -519,11 +519,11 @@ describe('updateServer()', () => {
519519
520520 const closeStub = sinon . stub ( fakeClient , 'close' ) . resolves ( )
521521 initOneStub . resetHistory ( )
522- saveAgentConfigStub . resetHistory ( )
522+ saveServerSpecificAgentConfigStub . resetHistory ( )
523523
524524 await mgr . updateServer ( 'u1' , { timeout : 999 } , 'u.json' )
525525
526- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
526+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
527527 expect ( closeStub . calledOnce ) . to . be . true
528528 expect ( initOneStub . calledOnceWith ( 'u1' , sinon . match . has ( 'timeout' , 999 ) ) ) . to . be . true
529529 } )
@@ -559,11 +559,11 @@ describe('updateServer()', () => {
559559 const mgr = McpManager . instance
560560
561561 initOneStub . resetHistory ( )
562- saveAgentConfigStub . resetHistory ( )
562+ saveServerSpecificAgentConfigStub . resetHistory ( )
563563
564564 await mgr . updateServer ( 'srv' , { command : undefined , url : 'https://new.host/mcp' } , 'z.json' )
565565
566- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
566+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
567567 expect ( initOneStub . calledOnceWith ( 'srv' , sinon . match ( { url : 'https://new.host/mcp' } ) ) ) . to . be . true
568568 } )
569569} )
@@ -1061,9 +1061,11 @@ describe('listServersAndTools()', () => {
10611061
10621062describe ( 'updateServerPermission()' , ( ) => {
10631063 let saveAgentConfigStub : sinon . SinonStub
1064+ let saveServerSpecificAgentConfigStub : sinon . SinonStub
10641065
10651066 beforeEach ( ( ) => {
10661067 saveAgentConfigStub = sinon . stub ( mcpUtils , 'saveAgentConfig' ) . resolves ( )
1068+ saveServerSpecificAgentConfigStub = sinon . stub ( mcpUtils , 'saveServerSpecificAgentConfig' ) . resolves ( )
10671069 } )
10681070
10691071 afterEach ( async ( ) => {
@@ -1112,8 +1114,8 @@ describe('updateServerPermission()', () => {
11121114 __configPath__ : '/p' ,
11131115 } )
11141116
1115- // Verify saveAgentConfig was called
1116- expect ( saveAgentConfigStub . calledOnce ) . to . be . true
1117+ // Verify saveServerSpecificAgentConfig was called
1118+ expect ( saveServerSpecificAgentConfigStub . calledOnce ) . to . be . true
11171119
11181120 // Verify the tool permission was updated
11191121 expect ( mgr . requiresApproval ( 'srv' , 'tool1' ) ) . to . be . false
0 commit comments