(sid string, name string, version string, tools ...ITool)
| 133 | } |
| 134 | |
| 135 | func SetServer(sid string, name string, version string, tools ...ITool) { |
| 136 | ser, has := mcpServer.Get(sid) |
| 137 | if !has { |
| 138 | mcpServer.Set(sid, server.NewMCPServer(name, version, server.WithToolCapabilities(true))) |
| 139 | ser, has = mcpServer.Get(sid) |
| 140 | if !has { |
| 141 | return |
| 142 | } |
| 143 | } |
| 144 | ts := make([]server.ServerTool, 0, len(tools)) |
| 145 | for _, tool := range tools { |
| 146 | ts = append(ts, tool.Tool()) |
| 147 | } |
| 148 | ser.SetTools(ts...) |
| 149 | } |
| 150 | |
| 151 | func DelServer(sid string) { |
| 152 | mcpServer.Del(sid) |
no test coverage detected