mcpserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mcpserver offers mutti's use cases as tools of a Model Context Protocol server, for AI coding agents: start and inspect environments, run commands and tests in them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(a *app.App, dir, version string) *mcp.Server

New returns the MCP server for the project at dir. Every tool call works on its own copy of a, with output captured for the result: stdout belongs to the protocol.

Types

type Diagnoses added in v0.2.0

type Diagnoses struct {
	Services []app.Diagnosis `json:"services"`
}

Diagnoses are the explanations of the services that are not well.

type Done

type Done struct {
	Instance string `json:"instance"`
}

Done names the instance a tool acted on.

type Empty

type Empty struct{}

Empty is the input of tools that take nothing.

type ExecInput

type ExecInput struct {
	Dir     string            `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Service string            `json:"service" jsonschema:"service to run the command in"`
	Command []string          `` /* 155-byte string literal not displayed */
	Workdir string            `json:"workdir,omitempty" jsonschema:"working directory inside the container"`
	Env     map[string]string `json:"env,omitempty" jsonschema:"extra environment variables"`
	User    string            `json:"user,omitempty" jsonschema:"\"host\" (your user, the default), \"service\" (the image's user) or user[:group]"`
}

ExecInput is a command for a service.

type Exited

type Exited struct {
	ExitCode  int    `json:"exitCode"`
	Output    string `json:"output"`
	Truncated bool   `json:"truncated,omitempty"`
}

Exited is what a command printed and how it ended.

type Instances

type Instances struct {
	Instances []app.Summary `json:"instances"`
}

Instances is the output of list.

type LogsInput

type LogsInput struct {
	Dir      string   `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Services []string `json:"services,omitempty" jsonschema:"services to show; default: all"`
	Tail     int      `json:"tail,omitempty" jsonschema:"lines per service, counted from the end; default 200"`
}

LogsInput selects logs.

type Output

type Output struct {
	Output    string `json:"output"`
	Truncated bool   `json:"truncated,omitempty"`
}

Output is what a command printed, stdout and stderr together. Truncated means only the end of it is there.

type Ran

type Ran struct {
	RunID     string `json:"runId"`
	ExitCode  int    `json:"exitCode"`
	Logs      string `json:"logs" jsonschema:"file with the logs of all services of the run"`
	Output    string `json:"output"`
	Truncated bool   `json:"truncated,omitempty"`
}

Ran is the result of a run.

type RunInput

type RunInput struct {
	Dir      string   `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Command  []string `json:"command" jsonschema:"the command, run on the host with MUTTI_URL and the other MUTTI_* variables set, or in service"`
	Service  string   `json:"service,omitempty" jsonschema:"run the command in a one-off container of this service instead of on the host"`
	Start    []string `json:"start,omitempty" jsonschema:"start only these services and what they depend on; default: all"`
	Overlays []string `json:"overlays,omitempty" jsonschema:"x-mutti overlays to enable"`
	Profiles []string `json:"profiles,omitempty" jsonschema:"Compose profiles to enable"`
}

RunInput is a command for a throwaway environment.

type ServicesInput added in v0.2.0

type ServicesInput struct {
	Dir      string   `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Services []string `json:"services,omitempty" jsonschema:"only these services; default: all"`
}

ServicesInput names services of a worktree's environment.

type Started

type Started struct {
	Instance     string `json:"instance"`
	Hostname     string `json:"hostname"`
	Path         string `json:"path"`
	URL          string `json:"url,omitempty"`
	Bootstrapped bool   `json:"bootstrapped"` // the bootstrap hooks ran (first start)
	Output       string `json:"output"`
	Truncated    bool   `json:"truncated,omitempty"`
}

Started describes a started environment.

type URL

type URL struct {
	URL string `json:"url"`
}

URL is the output of url.

type URLInput

type URLInput struct {
	Dir     string `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Service string `json:"service,omitempty" jsonschema:"service whose URL to return; default: the environment's main URL"`
}

URLInput selects a service.

type UpInput

type UpInput struct {
	Dir      string   `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Services []string `json:"services,omitempty" jsonschema:"start only these services and what they depend on; default: all"`
	Overlays []string `json:"overlays,omitempty" jsonschema:"x-mutti overlays to enable"`
	Profiles []string `json:"profiles,omitempty" jsonschema:"Compose profiles to enable"`
	Build    bool     `json:"build,omitempty" jsonschema:"rebuild images before starting"`
}

UpInput configures up.

type Where

type Where struct {
	Dir string `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
}

Where is the worktree a tool works on.

type Worktree

type Worktree struct {
	Path    string   `json:"path" jsonschema:"pass it as dir to the other tools"`
	Branch  string   `json:"branch"`
	Started *Started `json:"started,omitempty"`
}

Worktree describes a created worktree.

type WorktreeInput

type WorktreeInput struct {
	Dir      string `json:"dir,omitempty" jsonschema:"worktree directory, absolute or relative to where mutti mcp runs; default: that directory"`
	Name     string `json:"name" jsonschema:"name of the worktree, also of its new branch: lower case letters, digits and -"`
	Branch   string `json:"branch,omitempty" jsonschema:"check out this existing branch instead of creating one"`
	From     string `json:"from,omitempty" jsonschema:"base of the new branch; default: the current HEAD"`
	DataFrom string `` /* 141-byte string literal not displayed */
	NoUp     bool   `json:"noUp,omitempty" jsonschema:"only create the worktree, do not start its environment"`
}

WorktreeInput describes a new worktree.

Jump to

Keyboard shortcuts

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