mcp

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MCPServerName    = "cluster-health-mcp-server"
	MCPServerTitle   = "Cluster Health Analyzer MCP Server"
	MCPServerVersion = "0.0.1"
)
View Source
var (
	MCPCmd = &cobra.Command{
		Use:   "mcp",
		Short: "Run the MCP server providing tools reporting the cluster health data",
		Run: func(cmd *cobra.Command, args []string) {

			if promURL == "" {
				if value, ok := os.LookupEnv("PROM_URL"); ok {
					promURL = value
				} else {
					promURL = "http://localhost:9090"
				}
			}

			if alertManagerURL == "" {
				if value, ok := os.LookupEnv("ALERTMANAGER_URL"); ok {
					alertManagerURL = value
				} else {
					alertManagerURL = "http://localhost:9093"
				}
			}

			serverCfg := newMCPHealthServerConfig()

			server, err := mcp.NewMCPHealthServer(serverCfg)
			if err != nil {
				slog.Error("Failed to initialize the MCP server", "error", err)
				return
			}

			err = server.Start()
			if err != nil {
				slog.Error("Failed to start the MCP server", "error", err)
				return
			}
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL