NewServer wires everything but does not start any background goroutines.
(clusters *multicluster.Manager)
| 37 | |
| 38 | // NewServer wires everything but does not start any background goroutines. |
| 39 | func NewServer(clusters *multicluster.Manager) *Server { |
| 40 | s := &Server{ |
| 41 | clusters: clusters, |
| 42 | cache: cache.New(2048, 30*time.Second), |
| 43 | helm: helm.New(), |
| 44 | watchers: make(map[string]*watch.Watcher), |
| 45 | mcp: server.NewMCPServer( |
| 46 | "k8s-mcp-advanced", |
| 47 | "1.0.0", |
| 48 | server.WithResourceCapabilities(true, true), |
| 49 | server.WithToolCapabilities(true), |
| 50 | ), |
| 51 | } |
| 52 | s.registerTools() |
| 53 | return s |
| 54 | } |
| 55 | |
| 56 | // Serve runs stdio transport until ctx is cancelled. |
| 57 | func (s *Server) Serve(ctx context.Context) error { |
nothing calls this directly
no test coverage detected