server

package
v0.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package server owns routing for the server top-level command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConnectConfig

func BuildConnectConfig(server platformapi.ServerListItem, clientName string) (map[string]any, error)

func BuildImage

func BuildImage(ctx context.Context, logger *zap.Logger, serverName, dockerfile, metadataFile, metadataDir, registryURL, tag, platform, contextDir string) error

BuildImage builds a Docker image and updates MCP metadata for the server.

func DiscoverToolsFromServer

func DiscoverToolsFromServer(serverURL string) ([]string, error)

DiscoverToolsFromServer connects to a running MCP server at serverURL and returns the tool names. They are returned as bare names; callers wrap them into --tool flags or metadata.ToolConfig values.

If the URL has no explicit path, /mcp is appended automatically (the default MCP endpoint path used by the go-sdk).

func New

func New(runtime *core.Runtime) *cobra.Command

New returns the server command.

func NewWithManager

func NewWithManager(mgr *ServerManager) *cobra.Command

NewWithManager returns the server command using the provided manager.

Types

type ServerManager

type ServerManager struct {
	// contains filtered or unexported fields
}

ServerManager handles MCP server operations with injected dependencies.

func DefaultServerManager

func DefaultServerManager(logger *zap.Logger) *ServerManager

DefaultServerManager returns a ServerManager using the default kubectl client.

func NewServerManager

func NewServerManager(kubectl *core.KubectlClient, logger *zap.Logger) *ServerManager

NewServerManager creates a ServerManager with the given dependencies.

func (*ServerManager) ApplyServerFromFile

func (m *ServerManager) ApplyServerFromFile(file string) error

ApplyServerFromFile applies an MCPServer manifest from disk.

func (*ServerManager) BindUseKubeFlag

func (m *ServerManager) BindUseKubeFlag(cmd *cobra.Command)

BindUseKubeFlag wires the shared --use-kube flag onto the command.

func (*ServerManager) ConnectConfig

func (m *ServerManager) ConnectConfig(name, namespace, clientName, output string) error

ConnectConfig prints client connection config for a platform-visible MCP server.

func (*ServerManager) CreateServer

func (m *ServerManager) CreateServer(name, namespace, image, imageTag string) error

CreateServer creates a new MCP server with the given parameters.

func (*ServerManager) CreateServerFromFile

func (m *ServerManager) CreateServerFromFile(file string) error

CreateServerFromFile creates an MCP server from a YAML file.

func (*ServerManager) DeleteServer

func (m *ServerManager) DeleteServer(name, namespace string) error

DeleteServer deletes an MCP server.

func (*ServerManager) DeployServer

func (m *ServerManager) DeployServer(name, namespace, team, scope, image, imageTag string, replicas, port, servicePort int32, metadataFile, metadataDir string, update bool) error

func (*ServerManager) ExportServer

func (m *ServerManager) ExportServer(name, namespace, file string) error

ExportServer exports an MCPServer manifest to stdout or a file.

func (*ServerManager) GenerateManifests

func (m *ServerManager) GenerateManifests(metadataFile, metadataDir, outputDir string) error

GenerateManifests renders MCPServer YAML from .mcp metadata for review, GitOps, or admin workflows. Normal user deploys should call DeployServer.

func (*ServerManager) GetServer

func (m *ServerManager) GetServer(name, namespace string) error

GetServer retrieves details for a specific MCP server.

func (*ServerManager) InitServer

func (m *ServerManager) InitServer(name, metadataDir, image, imageTag, scope, policyMode, defaultDecision string, sessionRequired bool, port int32, tools, toolSpecs []string, toolRisk string, force bool) error

func (*ServerManager) InspectServerPolicy

func (m *ServerManager) InspectServerPolicy(name, namespace string) error

InspectServerPolicy prints the rendered gateway policy ConfigMap content for a server.

func (*ServerManager) ListServers

func (m *ServerManager) ListServers(namespace, team string) error

ListServers lists all MCP servers in the given namespace.

func (*ServerManager) Logger

func (m *ServerManager) Logger() *zap.Logger

Logger exposes the manager logger to foldered command packages.

func (*ServerManager) PatchServer

func (m *ServerManager) PatchServer(name, namespace, patchType, patch, patchFile string) error

PatchServer patches an existing MCPServer resource using merge/json/strategic patch types.

func (*ServerManager) ServerStatus

func (m *ServerManager) ServerStatus(namespace string) error

ServerStatus shows the status of MCP servers in a namespace.

func (*ServerManager) ViewServerLogs

func (m *ServerManager) ViewServerLogs(name, namespace string, follow, previous bool, tail int, since string) error

ViewServerLogs views logs from an MCP server.

Jump to

Keyboard shortcuts

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