mcptools

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 16 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 exposes everything the CLI can do as MCP tools, for the local `goship mcp` server and the hosted one alike. Only the way a client and an organization are found differs between the two, and Clients hides that.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c Clients, version string, o Options) *mcp.Server

New builds a server with every tool registered.

func Register

func Register(s *mcp.Server, c Clients, o Options)

Register adds the tools to s.

Types

type AccessToken added in v0.12.0

type AccessToken struct {
	Token string `json:"token"`
}

type AccessTokenArgs added in v0.12.0

type AccessTokenArgs struct {
	AppArg
	Reveal bool `json:"reveal,omitempty" jsonschema:"true returns the whole token; false (default) returns it masked and unusable as a header"`
}

type AccessUserArgs added in v0.12.0

type AccessUserArgs struct {
	AppArg
	Username string `json:"username" jsonschema:"login name of the person"`
	Password string `json:"password,omitempty" jsonschema:"password to set; omit to have one generated"`
}

type AccessUserList added in v0.12.0

type AccessUserList struct {
	Users []portal.AccessUser `json:"users"`
}

type AccessUserRef added in v0.12.0

type AccessUserRef struct {
	AppArg
	Username string `json:"username" jsonschema:"login name from goship_list_app_access"`
}

type AppArg

type AppArg struct {
	ProjectArg
	App string `json:"app" jsonschema:"app name"`
}

type AppDomainArgs

type AppDomainArgs struct {
	AppArg
	Domain string `json:"domain" jsonschema:"hostname to serve the app at; its registered domain must be verified"`
}

type AppList

type AppList struct {
	Apps []portal.App `json:"apps"`
}

type BilledMessage added in v0.15.0

type BilledMessage struct {
	Message         string     `json:"message"`
	BillingStartsAt *time.Time `json:"billing_starts_at,omitempty"`
}

BilledMessage is the result of a create or a plan change. While an invited trial holds the resource unbilled, the text also says when billing starts and BillingStartsAt carries the date.

type BindDBServerArgs added in v0.19.0

type BindDBServerArgs struct {
	DBServerArg
	Environment string `json:"environment" jsonschema:"environment slug the server joins (goship_list_environments)"`
}

type Clients

type Clients interface {
	Client(ctx context.Context) (*portal.Client, error)
	// Org resolves the organization for a call: override when the tool was
	// given one, else whatever the caller's context selects. The error says
	// how to select one.
	Org(ctx context.Context, override string) (string, error)
	// Project is Org for the project inside org. The error says how to select
	// one.
	Project(ctx context.Context, c *portal.Client, org, override string) (string, error)
	// Environment is Project for the environment of project: override when
	// the tool was given one, else the caller's selection, else the
	// organization's default. The error says how to choose one.
	Environment(ctx context.Context, c *portal.Client, org, project, override string) (string, error)
	// DeploySelection is what goship_deploy weighs after its environment
	// argument and the deployed directory's goship.yml: the environment the
	// caller chose for a target ("" when nothing did), then the default of
	// the organization, from orgs.
	DeploySelection(c *portal.Client) (environment func(deploy.Target) string, orgs deploy.OrgLister)
}

Clients gives each tool call its API client, organization, project and environment. The local server reads them from the config file; the hosted one from the request.

type CloudAccountArg

type CloudAccountArg struct {
	OrgArg
	AccountID string `json:"account_id" jsonschema:"cloud account id from goship_list_cloud_accounts"`
}

type CloudAccountList

type CloudAccountList struct {
	Accounts []portal.CloudAccount `json:"accounts"`
}

type CloudRegionList

type CloudRegionList struct {
	Regions []portal.CloudRegion `json:"regions"`
}

type CloudSizeList

type CloudSizeList struct {
	Sizes []portal.CloudSize `json:"sizes"`
}

type CloudSizesArgs

type CloudSizesArgs struct {
	CloudAccountArg
	Region string `json:"region" jsonschema:"region slug from goship_list_cloud_regions"`
}

type ClusterArg added in v0.14.0

type ClusterArg struct {
	OrgArg
	Cluster string `json:"cluster" jsonschema:"cluster name or id (goship_list_clusters)"`
}

type ClusterList added in v0.14.0

type ClusterList struct {
	Clusters []portal.Cluster `json:"clusters"`
}

type ClusterSizeList added in v0.14.0

type ClusterSizeList struct {
	Sizes []portal.ResizeOption `json:"sizes"`
}

type CreateAppArgs

type CreateAppArgs struct {
	ProjectArg
	Name     string `json:"name" jsonschema:"app name: lowercase letters, digits and hyphens"`
	Platform string `json:"platform,omitempty" jsonschema:"go, python, nodejs or static; omit for an app built from a Dockerfile"`
	Plan     string `` /* 136-byte string literal not displayed */
	Private  bool   `json:"private,omitempty" jsonschema:"true puts a GoShip login page in front of the app from its first deploy"`
	NoDomain bool   `json:"no_domain,omitempty" jsonschema:"attach no custom domain, even when the project or organization has a default"`
}

type CreateClusterArgs added in v0.14.0

type CreateClusterArgs struct {
	OrgArg
	Name         string   `json:"name" jsonschema:"cluster name"`
	CloudAccount string   `` /* 174-byte string literal not displayed */
	Region       string   `json:"region,omitempty" jsonschema:"cloud region slug (goship_list_cloud_regions)"`
	Size         string   `json:"size,omitempty" jsonschema:"cloud machine size slug (goship_list_cloud_sizes)"`
	Host         string   `json:"host,omitempty" jsonschema:"connect a machine the customer already runs, over SSH: its hostname or IP; needs ssh_key"`
	Port         int      `json:"port,omitempty" jsonschema:"SSH port, default 22"`
	SSHUser      string   `json:"ssh_user,omitempty" jsonschema:"SSH user, default root"`
	SSHKey       string   `json:"ssh_key,omitempty" jsonschema:"the private key itself (not a path) with access to the host"`
	Kubeconfig   string   `` /* 131-byte string literal not displayed */
	Environments []string `` /* 151-byte string literal not displayed */
}

type CreateDBArgs

type CreateDBArgs struct {
	ProjectArg
	Name        string `json:"name" jsonschema:"database name"`
	Plan        string `json:"plan,omitempty" jsonschema:"database plan slug; required on GoShip, ignored on the customer's own server"`
	Description string `json:"description,omitempty"`
	Server      string `` /* 229-byte string literal not displayed */
	SizeLimitMB *int   `` /* 138-byte string literal not displayed */
}

type CreateDBServerArgs added in v0.9.0

type CreateDBServerArgs struct {
	OrgArg
	CloudAccount string `json:"cloud_account" jsonschema:"connected Google Cloud account: id, label or provider (goship_list_cloud_accounts)"`
	Region       string `json:"region" jsonschema:"cloud region slug (goship_list_cloud_regions)"`
	Environment  string `` /* 253-byte string literal not displayed */
	Tier         string `json:"tier,omitempty" jsonschema:"machine size slug (goship_list_database_server_tiers); default db-f1-micro"`
	Name         string `json:"name,omitempty" jsonschema:"server name; default pg-<environment>, or pg-<account label> without an environment"`
	DiskLimitGB  *int   `` /* 138-byte string literal not displayed */
}

type CreateDBUserArgs

type CreateDBUserArgs struct {
	DBArg
	Username   string `json:"username"`
	AccessMode string `json:"access_mode,omitempty" jsonschema:"readwrite (default) or readonly"`
}

type CreateEnvironmentArgs added in v0.14.0

type CreateEnvironmentArgs struct {
	OrgArg
	Slug     string `json:"slug" jsonschema:"environment slug: lowercase letters, digits and hyphens, e.g. staging"`
	Name     string `json:"name,omitempty" jsonschema:"display name; defaults to the slug"`
	Cluster  string `` /* 127-byte string literal not displayed */
	DBServer string `` /* 151-byte string literal not displayed */
}

type CreateTokenArgs

type CreateTokenArgs struct {
	Name          string `json:"name" jsonschema:"what the token is for, e.g. ci"`
	ExpiresInDays int    `json:"expires_in_days,omitempty" jsonschema:"days until it expires; 0 for never"`
}

type CreateVolumeArgs

type CreateVolumeArgs struct {
	ProjectArg
	Name        string `json:"name"`
	Plan        string `json:"plan" jsonschema:"byon-local (the cluster's own disk) or do-block-storage"`
	CapacityGiB int    `json:"capacity_gib" jsonschema:"size in GiB"`
}

type CreateWebhookArgs added in v0.23.0

type CreateWebhookArgs struct {
	OrgArg
	URL    string   `json:"url" jsonschema:"https URL that receives the events; it must be reachable from the internet"`
	Events []string `json:"events" jsonschema:"events to be told about, from the events of goship_list_webhooks, e.g. deploy.failed"`
}

type DBArg

type DBArg struct {
	ProjectArg
	Database string `json:"database" jsonschema:"database name"`
}

type DBBindArgs

type DBBindArgs struct {
	DBArg
	App string `json:"app" jsonschema:"app to bind; it gets DATABASE_URL and the PG* variables"`
}

type DBList

type DBList struct {
	Databases []portal.Database `json:"databases"`
}

type DBServerArg added in v0.9.0

type DBServerArg struct {
	OrgArg
	Server string `json:"server" jsonschema:"database server name or id (goship_list_database_servers)"`
}

type DBServerList added in v0.9.0

type DBServerList struct {
	Servers []portal.DatabaseServer `json:"servers"`
}

type DBServerTierList added in v0.9.0

type DBServerTierList struct {
	Tiers []portal.DatabaseServerTier `json:"tiers"`
}

type DBUserList

type DBUserList struct {
	Users []portal.DatabaseUser `json:"users"`
}

type DeleteClusterArgs added in v0.14.0

type DeleteClusterArgs struct {
	ClusterArg
	DestroyServer bool `json:"destroy_server,omitempty" jsonschema:"also destroy the machine at the cloud provider"`
}

type DeleteDBServerArgs added in v0.9.0

type DeleteDBServerArgs struct {
	DBServerArg
	Force bool `` /* 192-byte string literal not displayed */
}

type DeployArgs

type DeployArgs struct {
	ProjectArg
	Path       string            `` /* 142-byte string literal not displayed */
	Image      string            `json:"image,omitempty" jsonschema:"container image to deploy instead of building a directory (public registries only)"`
	App        string            `json:"app,omitempty" jsonschema:"app name; defaults to goship.yml's app, then the directory name"`
	Platform   string            `json:"platform,omitempty" jsonschema:"go, python, nodejs or static; inferred from the files present when omitted"`
	Plan       string            `json:"plan,omitempty" jsonschema:"plan slug for a new app; a free plan is picked only when the org has one"`
	Dockerfile string            `json:"dockerfile,omitempty" jsonschema:"build from this container file instead of a platform"`
	Message    string            `json:"message,omitempty" jsonschema:"release message"`
	Env        map[string]string `json:"env,omitempty" jsonschema:"private variables applied before the build"`
}

type DeployResult

type DeployResult struct {
	deploy.Result
	DurationSeconds float64 `json:"duration_seconds"`
	Steps           []Step  `json:"steps"`
}

DeployResult is a finished deploy, with the steps it went through.

type DomainArg

type DomainArg struct {
	OrgArg
	Domain string `json:"domain" jsonschema:"domain name, e.g. example.com"`
}

type DomainIDArg

type DomainIDArg struct {
	OrgArg
	ID string `json:"id" jsonschema:"domain id from goship_list_domains"`
}

type DomainList

type DomainList struct {
	Domains []portal.OrgDomain `json:"domains"`
}

type EnableDBExtensionArgs added in v0.10.0

type EnableDBExtensionArgs struct {
	DBArg
	Extension string `json:"extension" jsonschema:"extension name from the available list, e.g. postgis"`
}

type EnvList

type EnvList struct {
	Env []portal.EnvVar `json:"env"`
}

type EnvironmentArg added in v0.14.0

type EnvironmentArg struct {
	OrgArg
	Environment string `json:"environment" jsonschema:"environment slug (goship_list_environments)"`
}

type EnvironmentList added in v0.14.0

type EnvironmentList struct {
	Environments []portal.Environment `json:"environments"`
}

type ListReleasesArgs

type ListReleasesArgs struct {
	AppArg
	Limit int `json:"limit,omitempty" jsonschema:"how many, newest first; default 20"`
}

type LogList

type LogList struct {
	Entries []portal.LogEntry `json:"entries"`
}

type LogsArgs

type LogsArgs struct {
	AppArg
	Lines  int      `json:"lines,omitempty" jsonschema:"how many recent lines; default 100, at most 1000"`
	Source string   `json:"source,omitempty" jsonschema:"only lines from this source, e.g. app or router"`
	Units  []string `json:"units,omitempty" jsonschema:"only lines from these unit ids"`
}

type Message

type Message struct {
	Message string `json:"message"`
}

Message is the result of a call that changes something and returns nothing.

type Options

type Options struct {
	// Deploy adds goship_deploy, which reads a directory on the machine the
	// server runs on. Only the local server can honour it.
	Deploy bool
}

Options selects what the server offers.

type OrgArg

type OrgArg struct {
	Org string `json:"org,omitempty" jsonschema:"organization slug; defaults to the selected organization"`
}

OrgArg is the organization override every org-scoped tool accepts.

type OrgList

type OrgList struct {
	Orgs []portal.Org `json:"orgs"`
}

type PlanList

type PlanList struct {
	Plans []portal.Plan `json:"plans"`
}

type PlansArgs

type PlansArgs struct {
	ProjectArg
	Kind string `json:"kind,omitempty" jsonschema:"app (default) or database"`
}

type ProjectArg added in v0.5.0

type ProjectArg struct {
	OrgArg
	Project     string `json:"project,omitempty" jsonschema:"project slug; defaults to the selected project (goship_list_projects)"`
	Environment string `` /* 139-byte string literal not displayed */
}

ProjectArg is the organization, project and environment overrides every project-scoped tool accepts.

type ProjectDomainApplyResult added in v0.22.0

type ProjectDomainApplyResult struct {
	Message  string                             `json:"message"`
	Attached []string                           `json:"attached"`
	Failed   []portal.ProjectDomainApplyFailure `json:"failed"`
}

type ProjectDomainArg added in v0.22.0

type ProjectDomainArg struct {
	ProjectOnlyArg
	Domain string `json:"domain" jsonschema:"domain name, e.g. example.com (as goship_list_project_domains shows it)"`
}

type ProjectDomainList added in v0.22.0

type ProjectDomainList struct {
	Domains []portal.ProjectDomain `json:"domains"`
}

type ProjectDomainResult added in v0.22.0

type ProjectDomainResult struct {
	Message string                `json:"message"`
	Domain  *portal.ProjectDomain `json:"domain,omitempty"`
}

type ProjectDomainRuleArg added in v0.22.0

type ProjectDomainRuleArg struct {
	ProjectDomainArg
	Environment string `json:"environment" jsonschema:"environment slug the rule applies to, e.g. staging; never defaulted"`
}

type ProjectList added in v0.5.0

type ProjectList struct {
	Projects []portal.Project `json:"projects"`
}

type ProjectOnlyArg added in v0.22.0

type ProjectOnlyArg struct {
	OrgArg
	Project string `json:"project,omitempty" jsonschema:"project slug; defaults to the selected project (goship_list_projects)"`
}

ProjectOnlyArg is the organization and project overrides of a tool that acts on the project as a whole, with no environment.

type ReleaseList

type ReleaseList struct {
	Releases []portal.Deploy `json:"releases"`
}

type ReleaseLog added in v0.23.0

type ReleaseLog struct {
	App     string `json:"app"`
	Version string `json:"version,omitempty"`
	Failed  bool   `json:"failed"`
	Error   string `json:"error,omitempty"`
	// Log is the end of what the release wrote; Truncated says earlier lines
	// were left out, by this tool or because the stored log was cut.
	Log       string `json:"log"`
	Truncated bool   `json:"truncated"`
	// Note explains an empty log.
	Note string `json:"note,omitempty"`
}

type ReleaseLogArgs added in v0.23.0

type ReleaseLogArgs struct {
	AppArg
	Version string `` /* 137-byte string literal not displayed */
	Lines   int    `json:"lines,omitempty" jsonschema:"how many lines from the end of the log; default 200, at most 2000"`
}

type RenameDBServerArgs added in v0.21.0

type RenameDBServerArgs struct {
	DBServerArg
	Name string `json:"name" jsonschema:"the new name: 3-40 lowercase letters, digits and hyphens, unique in the organization"`
}

type ResizeClusterArgs added in v0.14.0

type ResizeClusterArgs struct {
	ClusterArg
	Size string `json:"size" jsonschema:"machine size slug from goship_list_cluster_sizes"`
}

type ResizeDBServerArgs added in v0.20.0

type ResizeDBServerArgs struct {
	DBServerArg
	Tier string `json:"tier" jsonschema:"new machine size slug (goship_list_database_server_sizes)"`
}

type RollbackArgs

type RollbackArgs struct {
	AppArg
	Version string `json:"version" jsonschema:"release to run again, e.g. v12 (goship_list_releases shows them)"`
}

type RollbackResult

type RollbackResult struct {
	App             string  `json:"app"`
	Version         string  `json:"version"`
	DurationSeconds float64 `json:"duration_seconds"`
	Steps           []Step  `json:"steps"`
}

type RunArgs

type RunArgs struct {
	AppArg
	Command  string `json:"command" jsonschema:"shell command to run inside the app's image, e.g. python manage.py migrate"`
	Once     bool   `json:"once,omitempty" jsonschema:"run in one unit only (default: every unit)"`
	Isolated bool   `json:"isolated,omitempty" jsonschema:"run in a fresh unit instead of the running ones"`
}

type RunResult

type RunResult struct {
	Output string `json:"output"`
}

type ScaleArgs

type ScaleArgs struct {
	AppArg
	Units int `json:"units" jsonschema:"number of units to run"`
}

type SetDBServerDiskLimitArgs added in v0.14.0

type SetDBServerDiskLimitArgs struct {
	DBServerArg
	DiskLimitGB int `` /* 146-byte string literal not displayed */
}

type SetDBSizeLimitArgs added in v0.14.0

type SetDBSizeLimitArgs struct {
	DBArg
	SizeLimitMB int `json:"size_limit_mb" jsonschema:"size limit in MB (minimum 10); 0 removes the limit"`
}

type SetEnvArgs

type SetEnvArgs struct {
	AppArg
	Env       map[string]string `json:"env" jsonschema:"variables to set, name to value"`
	Public    bool              `json:"public,omitempty" jsonschema:"mark them public (visible in the dashboard); secrets stay private by default"`
	NoRestart bool              `json:"no_restart,omitempty" jsonschema:"apply without restarting the app"`
}

type SetPlanArgs

type SetPlanArgs struct {
	AppArg
	Plan string `json:"plan" jsonschema:"plan slug from goship_list_plans"`
}

type SetProjectDomainArgs added in v0.22.0

type SetProjectDomainArgs struct {
	ProjectDomainRuleArg
	Subdomain string `` /* 144-byte string literal not displayed */
}

type Step

type Step struct {
	Name   string `json:"name"`
	Detail string `json:"detail,omitempty"`
}

type TokenIDArg

type TokenIDArg struct {
	ID string `json:"id" jsonschema:"token id from goship_list_api_tokens"`
}

type TokenList

type TokenList struct {
	Tokens []portal.APIToken `json:"tokens"`
}

type UnsetEnvArgs

type UnsetEnvArgs struct {
	AppArg
	Names     []string `json:"names" jsonschema:"variable names to remove"`
	NoRestart bool     `json:"no_restart,omitempty" jsonschema:"apply without restarting the app"`
}

type VisibilityArgs added in v0.12.0

type VisibilityArgs struct {
	AppArg
	Visibility string `json:"visibility" jsonschema:"public or private"`
}

type VolumeArg

type VolumeArg struct {
	ProjectArg
	Volume string `json:"volume" jsonschema:"volume name"`
}

type VolumeBindArgs

type VolumeBindArgs struct {
	VolumeArg
	App        string `json:"app"`
	MountPoint string `json:"mount_point" jsonschema:"absolute path inside the app, e.g. /data"`
	ReadOnly   bool   `json:"read_only,omitempty"`
}

type VolumeList

type VolumeList struct {
	Volumes []portal.Volume `json:"volumes"`
}

type WebhookDeliveriesArgs added in v0.23.0

type WebhookDeliveriesArgs struct {
	WebhookIDArg
	Limit int `json:"limit,omitempty" jsonschema:"how many deliveries to return; 0 for the default"`
}

type WebhookDeliveryList added in v0.23.0

type WebhookDeliveryList struct {
	Deliveries []portal.WebhookDelivery `json:"deliveries"`
}

type WebhookIDArg added in v0.23.0

type WebhookIDArg struct {
	OrgArg
	ID string `json:"id" jsonschema:"webhook id from goship_list_webhooks"`
}

type WebhookList added in v0.23.0

type WebhookList struct {
	Webhooks []portal.Webhook `json:"webhooks"`
	Events   []string         `json:"events" jsonschema:"the events a webhook can subscribe to"`
}

Jump to

Keyboard shortcuts

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