File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -320,11 +320,11 @@ func (s *MCPServer) AddResource(
320
320
}
321
321
322
322
s .resourcesMu .Lock ()
323
- defer s .resourcesMu .Unlock ()
324
323
s .resources [resource .URI ] = resourceEntry {
325
324
resource : resource ,
326
325
handler : handler ,
327
326
}
327
+ s .resourcesMu .Unlock ()
328
328
329
329
// When the list of available resources changes, servers that declared the listChanged capability SHOULD send a notification
330
330
if s .capabilities .resources .listChanged {
@@ -365,11 +365,11 @@ func (s *MCPServer) AddResourceTemplate(
365
365
366
366
367
367
s .resourcesMu .Lock ()
368
- defer s .resourcesMu .Unlock ()
369
368
s .resourceTemplates [template .URITemplate .Raw ()] = resourceTemplateEntry {
370
369
template : template ,
371
370
handler : handler ,
372
371
}
372
+ s .resourcesMu .Unlock ()
373
373
374
374
// When the list of available resources changes, servers that declared the listChanged capability SHOULD send a notification
375
375
if s .capabilities .resources .listChanged {
@@ -394,9 +394,9 @@ func (s *MCPServer) AddPrompt(prompt mcp.Prompt, handler PromptHandlerFunc) {
394
394
}
395
395
396
396
s .promptsMu .Lock ()
397
- defer s .promptsMu .Unlock ()
398
397
s .prompts [prompt .Name ] = prompt
399
398
s .promptHandlers [prompt .Name ] = handler
399
+ s .promptsMu .Unlock ()
400
400
401
401
// When the list of available resources changes, servers that declared the listChanged capability SHOULD send a notification.
402
402
if s .capabilities .prompts .listChanged {
You can’t perform that action at this time.
0 commit comments