mirror of
https://github.com/openshift/openshift-mcp-server.git
synced 2025-10-17 14:27:48 +03:00
Users can now enable or disable different toolsets either by providing a command-line flag or by setting the toolsets array field in the TOML configuration. Downstream Kubernetes API developers can declare toolsets for their APIs by creating a new nested package in pkg/toolsets and registering it in pkg/mcp/modules.go Signed-off-by: Marc Nuri <marc@marcnuri.com>
35 lines
700 B
Go
35 lines
700 B
Go
package core
|
|
|
|
import (
|
|
"slices"
|
|
|
|
"github.com/containers/kubernetes-mcp-server/pkg/api"
|
|
internalk8s "github.com/containers/kubernetes-mcp-server/pkg/kubernetes"
|
|
"github.com/containers/kubernetes-mcp-server/pkg/toolsets"
|
|
)
|
|
|
|
type Toolset struct{}
|
|
|
|
var _ api.Toolset = (*Toolset)(nil)
|
|
|
|
func (t *Toolset) GetName() string {
|
|
return "core"
|
|
}
|
|
|
|
func (t *Toolset) GetDescription() string {
|
|
return "Most common tools for Kubernetes management (Pods, Generic Resources, Events, etc.)"
|
|
}
|
|
|
|
func (t *Toolset) GetTools(o internalk8s.Openshift) []api.ServerTool {
|
|
return slices.Concat(
|
|
initEvents(),
|
|
initNamespaces(o),
|
|
initPods(),
|
|
initResources(o),
|
|
)
|
|
}
|
|
|
|
func init() {
|
|
toolsets.Register(&Toolset{})
|
|
}
|