We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5136ec8 commit a630f30Copy full SHA for a630f30
server/server.go
@@ -348,6 +348,14 @@ func (s *MCPServer) AddResources(resources ...ServerResource) {
348
}
349
350
351
+// SetResources replaces all existing resources with the provided list
352
+func (s *MCPServer) SetResources(resources ...ServerResource) {
353
+ s.resourcesMu.Lock()
354
+ s.resources = make(map[string]resourceEntry, len(resources))
355
+ s.resourcesMu.Unlock()
356
+ s.AddResources(resources...)
357
+}
358
+
359
// AddResource registers a new resource and its handler
360
func (s *MCPServer) AddResource(
361
resource mcp.Resource,
0 commit comments