mcpserver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 15 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 mcpserver defines the digest, breaking_changes, outdated, drift and resolve tools and the upgrade_review prompt of `relgap mcp`. The tools never start a process, and they read only the directories inside the server's roots.

Index

Constants

View Source
const Name = "relgap"

Name is the server_info name.

Variables

View Source
var ErrOutsideRoots = errors.New("outside the server's roots")

ErrOutsideRoots is returned for a directory argument outside the server's roots.

Functions

func New

func New(o Options) *mcpkit.Server

New returns the MCP server with every relgap tool and prompt.

func Prompts added in v0.4.0

func Prompts() []string

Prompts lists the prompt names, in registration order.

Types

type Backend

type Backend struct {
	Digest   func(ctx context.Context, a DigestArgs) (*report.ToolDigest, error)
	Outdated func(ctx context.Context, root, base string) (*report.Outdated, []render.Error, error)
	Drift    func(ctx context.Context, a DriftArgs) (*report.Drift, []render.Error, error)
	Resolve  func(ctx context.Context, name string) (*registry.Resolution, error)
}

Backend runs the pipelines of the CLI commands. Errors make the call fail; the returned render.Error lists say what a partial result misses.

type DigestArgs

type DigestArgs struct {
	Tool, From, To     string
	Line               string // empty means the tool's registry line
	IncludePrereleases bool
	MinConfidence      *float64        // nil means the config's policy.min_confidence
	Kinds              []classify.Kind // empty means every kind
}

DigestArgs says what one digest covers.

type DriftArgs

type DriftArgs struct {
	Roots, Tools      []string
	Latest            bool
	IgnoreConstraints bool
	Base              string // name repositories relative to this directory
}

DriftArgs says what a drift report covers. Roots are checked against the server's roots.

type NoExec

type NoExec struct{}

NoExec refuses to start any command, as if none were installed. With it, the registry uses its embedded mise snapshot and the scanner walks directories instead of asking git.

func (NoExec) Run

func (NoExec) Run(_ context.Context, c execx.Cmd) (*execx.Result, error)

Run returns execx.ErrNotFound.

type Options

type Options struct {
	Version  string // relgap's version, for server_info and envelopes
	Logger   *slog.Logger
	Clock    func() time.Time
	MaxBytes int      // see [mcpkit.Options]
	Roots    []string // directories tool paths must be in; empty means the client's roots
	Cwd      string   // the root when neither Roots nor the client name one
	Backend  Backend
}

Options configures New.

Jump to

Keyboard shortcuts

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