serverupdate

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package serverupdate implements MCP tools for checking and applying updates to this MCP server binary.

The package uses the autoupdate subsystem and GitHub release metadata rather than a GitLab API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(updater *autoupdate.Updater) []toolutil.ActionSpec

ActionSpecs returns canonical specs for visible server update tools. If updater is nil, auto-update is disabled and no update actions are available.

func FormatApplyMarkdown

func FormatApplyMarkdown(o ApplyOutput) *mcp.CallToolResult

FormatApplyMarkdown renders the apply result as an MCP CallToolResult.

func FormatApplyMarkdownString

func FormatApplyMarkdownString(o ApplyOutput) string

FormatApplyMarkdownString renders the apply result as Markdown.

func FormatCheckMarkdown

func FormatCheckMarkdown(o CheckOutput) *mcp.CallToolResult

FormatCheckMarkdown renders the check result as an MCP CallToolResult.

func FormatCheckMarkdownString

func FormatCheckMarkdownString(o CheckOutput) string

FormatCheckMarkdownString renders the check result as Markdown.

func SetServerInfo

func SetServerInfo(info ServerInfo)

SetServerInfo configures the static metadata included in check results.

Types

type ApplyInput

type ApplyInput struct{}

ApplyInput is the (empty) input for the apply-update tool.

type ApplyOutput

type ApplyOutput struct {
	toolutil.HintableOutput
	Applied         bool   `json:"applied"`
	Deferred        bool   `json:"deferred,omitempty"`
	PreviousVersion string `json:"previous_version"`
	NewVersion      string `json:"new_version,omitempty"`
	StagingPath     string `json:"staging_path,omitempty"`
	ScriptPath      string `json:"script_path,omitempty"`
	Message         string `json:"message"`
}

ApplyOutput describes the result of applying an update.

func Apply

func Apply(ctx context.Context, updater *autoupdate.Updater, _ ApplyInput) (ApplyOutput, error)

Apply downloads and applies the latest server update. On Windows, if the binary cannot be replaced (running exe lock), it falls back to downloading to a staging path with an update script.

type CheckInput

type CheckInput struct{}

CheckInput is the (empty) input for the check-update tool.

type CheckOutput

type CheckOutput struct {
	toolutil.HintableOutput
	UpdateAvailable bool   `json:"update_available"`
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version,omitempty"`
	ReleaseURL      string `json:"release_url,omitempty"`
	ReleaseNotes    string `json:"release_notes,omitempty"`
	Mode            string `json:"mode"`
	Author          string `json:"author,omitempty"`
	Department      string `json:"department,omitempty"`
	Repository      string `json:"repository,omitempty"`
}

CheckOutput describes the result of an update availability check.

func Check

func Check(ctx context.Context, updater *autoupdate.Updater, _ CheckInput) (CheckOutput, error)

Check verifies whether a newer server version is available.

type ServerInfo

type ServerInfo struct {
	Author     string
	Department string
	Repository string
}

ServerInfo holds static project metadata, set via SetServerInfo.

Jump to

Keyboard shortcuts

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