mcptools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcptools defines beszelscope's MCP tools and builds the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(d Deps) *mcp.Server

NewServer returns the MCP server with every tool registered.

Types

type Deps

type Deps struct {
	Hub            Hub
	HubURL         *url.URL
	HubVersion     string    // from the startup check; "" if unknown
	TokenExpiresAt time.Time // zero if unknown
	Logger         *slog.Logger
	Tracer         trace.TracerProvider
	Now            func() time.Time
	Version        string // beszelscope's own version
}

Deps are everything the tools need, built by cmd/beszelscope.

type Hub

type Hub interface {
	Systems(ctx context.Context) ([]hub.System, error)
	Services(ctx context.Context) ([]hub.Service, error)
	Containers(ctx context.Context) ([]hub.Container, error)
	SmartDevices(ctx context.Context) ([]hub.SmartDevice, error)
	ZfsPools(ctx context.Context) ([]hub.ZfsPool, error)
	Monitors(ctx context.Context) ([]hub.Monitor, error)
	SystemDetails(ctx context.Context) ([]hub.SystemDetails, error)
	SystemStats(ctx context.Context, systemID string, t hub.StatType, since time.Time) ([]hub.SystemStats, error)
	ContainerStats(ctx context.Context, systemID string, t hub.StatType, since time.Time) ([]hub.ContainerStats, error)
	LastStatsAt(ctx context.Context, systemID string) (time.Time, error)
	MonitorStats(ctx context.Context, systemID string, t hub.StatType, since time.Time) ([]hub.MonitorStats, error)
	PackageUpdates(ctx context.Context, systemID string) (hub.PackageUpdates, error)
}

Hub is the part of the hub client the tools read from.

Jump to

Keyboard shortcuts

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