mcp

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(svc *Services) *gomcp.Server

NewServer creates and configures an MCP server with all maintenant tools registered.

Types

type AgentLister added in v1.3.0

type AgentLister interface {
	List(ctx context.Context, statusFilter string) ([]*agent.Agent, error)
}

AgentLister lists registered agents.

type K8sReader added in v1.3.4

type K8sReader interface {
	ListNamespaces(ctx context.Context, agentID string) ([]string, error)
	ListWorkloads(ctx context.Context, agentID string, namespaces []string) ([]kubernetes.K8sWorkloadGroup, error)
	ListPods(ctx context.Context, agentID string, namespaces []string, filters kubernetes.PodFilters) ([]kubernetes.K8sPod, error)
	ListNodes(ctx context.Context, agentID string) ([]kubernetes.K8sNode, error)
}

K8sReader exposes the read methods of the Kubernetes store needed by MCP.

type LogFetcher

type LogFetcher interface {
	FetchLogs(ctx context.Context, externalID string, lines int, timestamps bool) ([]string, error)
}

LogFetcher fetches container logs from the runtime.

type Services

type Services struct {
	Containers    *container.Service
	Endpoints     *endpoint.Service
	Heartbeats    *heartbeat.Service
	Certificates  *certificate.Service
	Resources     *resource.Service
	Alerts        alert.AlertStore
	Channels      alert.ChannelStore
	Triggers      alert.TriggerStore
	Escalator     alert.Escalator
	Updates       *update.Service
	Incidents     status.IncidentStore
	Maintenance   status.MaintenanceStore
	Runtime       runtime.Runtime
	LogFetcher    LogFetcher
	EscalationSvc *escalation.Service
	Agents        AgentLister
	Sessions      SessionChecker

	// Security & supply-chain (read-only MCP surface).
	SecuritySvc *security.Service
	Scorer      *security.Scorer
	UpdateStore update.UpdateStore

	// Orchestrators (read-only MCP surface).
	Kubernetes     K8sReader
	SwarmCluster   func() *swarm.SwarmCluster
	SwarmDiscovery func() *swarm.ServiceDiscovery
	SwarmTopology  SwarmTopologyReader
	SwarmNodes     SwarmNodeReader

	Version string
	Logger  *slog.Logger
}

Services holds all dependencies required by MCP tool handlers.

type SessionChecker added in v1.3.0

type SessionChecker interface {
	IsConnected(agentID string) bool
}

SessionChecker reports whether an agent currently has an active gRPC stream.

type SwarmNodeReader added in v1.3.4

type SwarmNodeReader interface {
	ListNodes(ctx context.Context, agentID string) ([]*swarm.SwarmNode, error)
}

SwarmNodeReader exposes the read methods of the Swarm node store.

type SwarmTopologyReader added in v1.3.4

type SwarmTopologyReader interface {
	ListServices(ctx context.Context, agentID string) ([]*swarm.SwarmService, error)
	ListTasks(ctx context.Context, agentID, serviceID string) ([]*swarm.SwarmTask, error)
}

SwarmTopologyReader exposes the read methods of the Swarm topology store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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