MCPcopy Create free account
hub / github.com/VersusControl/devops-ai-guidelines / NewServer

Function NewServer

02-mcp-for-devops/code/07/pkg/mcp/server.go:39–54  ·  view source on GitHub ↗

NewServer wires everything but does not start any background goroutines.

(clusters *multicluster.Manager)

Source from the content-addressed store, hash-verified

37
38// NewServer wires everything but does not start any background goroutines.
39func 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.
57func (s *Server) Serve(ctx context.Context) error {

Callers

nothing calls this directly

Calls 1

registerToolsMethod · 0.95

Tested by

no test coverage detected