Help us shape the future of Go! Take the 2026 Go Developer Survey

mcpserver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mcpserver is lockfile's MCP server: one tool per agent command, each a thin adapter over clientcmd. Its outputs are the CLI's: the closed values of docs/security-model.md, as text and as structured content.

Index

Constants

View Source
const (
	ToolStatus  = "lockfile_status"
	ToolSources = "lockfile_sources"
	ToolPlugins = "lockfile_plugins"
	ToolPlan    = "lockfile_plan"
	ToolRun     = "lockfile_run"
	ToolAnswers = "lockfile_answers"
	ToolRelease = "lockfile_release"
)

Tool names.

View Source
const RunningMessage = "running in the lockfile console"

RunningMessage is the one progress text of a run: constant, so that the notifications say nothing the response time does not (docs/security-model.md).

Variables

View Source
var Instructions string

Functions

func Names

func Names() []string

Names lists every tool.

func New

func New(pinned string) *mcp.Server

New returns the server; pinned pins it to one profile (`lockfile mcp --profile P`).

func Serve

func Serve(ctx context.Context, pinned string, r io.Reader, w io.Writer) error

Serve runs the server on the agent's stdin and stdout.

Types

type HandleIn

type HandleIn struct {
	Profile string `json:"profile,omitempty" jsonschema:"profile of the console; may be left out when exactly one console runs"`
	Handle  string `json:"handle" jsonschema:"handle of a result"`
}

type NoIn

type NoIn struct{}

type PlanIn

type PlanIn struct {
	Profile string   `json:"profile,omitempty" jsonschema:"profile of the console; may be left out when exactly one console runs"`
	Key     string   `json:"key,omitempty" jsonschema:"exact object key, as the user gave it (or handle, not both)"`
	Handle  string   `json:"handle,omitempty" jsonschema:"handle of a file already fetched, for follow-up questions (or key, not both)"`
	Plugins []string `json:"plugins" jsonschema:"plugins to run, from lockfile_plugins"`
	Intent  string   `json:"intent,omitempty" jsonschema:"one line telling the user why, at most 200 bytes"`
}

type PlanOut

type PlanOut struct {
	PlanID  string        `json:"plan_id,omitempty"`
	Answers int           `json:"answers,omitempty"`
	Refusal *refusal.Info `json:"refusal,omitempty"`
	// contains filtered or unexported fields
}

type PluginsOut

type PluginsOut struct {
	Plugins []rpc.PluginInfo `json:"plugins"`
	Refusal *refusal.Info    `json:"refusal,omitempty"`
}

type ProfileIn

type ProfileIn struct {
	Profile string `json:"profile,omitempty" jsonschema:"profile of the console; may be left out when exactly one console runs"`
}

type ReleaseOut

type ReleaseOut struct {
	Released bool          `json:"released"`
	Refusal  *refusal.Info `json:"refusal,omitempty"`
}

type ResultOut

type ResultOut struct {
	Handle  string           `json:"handle,omitempty"`
	Answers []answers.Answer `json:"answers"`
	Refusal *refusal.Info    `json:"refusal,omitempty"`
	// contains filtered or unexported fields
}

ResultOut is answers.Result plus the refusal.

type RunIn

type RunIn struct {
	Profile string `json:"profile,omitempty" jsonschema:"profile of the console; may be left out when exactly one console runs"`
	PlanID  string `json:"plan_id" jsonschema:"plan id returned by lockfile_plan, or the ticket of a pending plan once it is decided"`
}

type SourcesOut

type SourcesOut struct {
	Sources []rpc.Source `json:"sources"`
}

type StatusOut

type StatusOut struct {
	Consoles []clientcmd.StatusEntry `json:"consoles"`
}

Jump to

Keyboard shortcuts

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