mcpserver

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) *mcp.Server

func SupportedSchemaVersions

func SupportedSchemaVersions() []string

SupportedSchemaVersions returns the action-payload schema versions this server can accept. Re-exported here so MCP-side callers don't need to depend on the contract package directly. Mirrors contract.SupportedSchemaVersions exactly.

Types

type BrowserSessionInput

type BrowserSessionInput struct {
	Endpoint   string `json:"endpoint,omitempty"`
	BrowserBin string `json:"browser_bin,omitempty"`
	Headless   bool   `json:"headless,omitempty"`
	Launch     bool   `json:"launch,omitempty" jsonschema:"start a new Chromium-family browser and return its CDP URL"`
}

type ClickImageInput

type ClickImageInput struct {
	FindImageInput
	Button        string  `json:"button,omitempty"`
	Count         int     `json:"count,omitempty"`
	MinConfidence float64 `json:"min_confidence,omitempty"`
	Strict        bool    `json:"strict,omitempty"`
}

type ClickTextInput

type ClickTextInput struct {
	FindTextInput
	Button string `json:"button,omitempty"`
	Count  int    `json:"count,omitempty"`
	Strict bool   `json:"strict,omitempty" jsonschema:"fail with TARGET_AMBIGUOUS when multiple candidates pass min_confidence"`
}

type ClipboardReadInput

type ClipboardReadInput struct {
	Selection string `json:"selection,omitempty" jsonschema:"clipboard (default) or primary"`
	Mime      string `json:"mime,omitempty" jsonschema:"text/plain (default) or text/uri-list"`
}

type ClipboardWriteInput

type ClipboardWriteInput struct {
	Content   string `json:"content" jsonschema:"content to write"`
	Selection string `json:"selection,omitempty" jsonschema:"clipboard (default), primary, or both"`
	Mime      string `json:"mime,omitempty" jsonschema:"text/plain (default) or text/uri-list"`
}

type FindColorInput

type FindColorInput struct {
	Point     *contract.Point    `json:"point,omitempty" jsonschema:"sample this single pixel"`
	Color     string             `json:"color,omitempty" jsonschema:"hex color #rrggbb to search for"`
	Region    contract.RegionRef `` /* 176-byte string literal not displayed */
	Tolerance int                `json:"tolerance,omitempty" jsonschema:"per-channel tolerance (default 8)"`
	MinArea   int                `json:"min_area,omitempty" jsonschema:"minimum blob area in pixels (default 4)"`
}

type FindImageInput

type FindImageInput struct {
	Region       contract.RegionRef `` /* 231-byte string literal not displayed */
	TemplatePath string             `json:"template_path" jsonschema:"path to a PNG or JPEG template"`
	Threshold    float64            `json:"threshold,omitempty" jsonschema:"match threshold; defaults to 0.9"`
	Scales       []float64          `json:"scales,omitempty" jsonschema:"scale factors to try; gocv backend only"`
}

type FindTextInput

type FindTextInput struct {
	Region        contract.RegionRef `` /* 261-byte string literal not displayed */
	Query         string             `json:"query" jsonschema:"text or regex pattern to look for"`
	Lang          string             `json:"lang,omitempty" jsonschema:"Tesseract language code; defaults to eng"`
	CaseSensitive bool               `json:"case_sensitive,omitempty"`
	Regex         bool               `json:"regex,omitempty" jsonschema:"interpret query as a regular expression"`
	MinConfidence float64            `json:"min_confidence,omitempty" jsonschema:"drop candidates below this OCR confidence (0..1)"`
	Preprocess    string             `` /* 142-byte string literal not displayed */
	PSM           int                `json:"psm,omitempty" jsonschema:"Tesseract page segmentation mode (0..13); 0 omits the flag and uses tesseract default"`
	OEM           int                `json:"oem,omitempty" jsonschema:"Tesseract OCR engine mode (0..3); 0 omits the flag and uses tesseract default"`
}

type KeyInput

type KeyInput struct {
	Key string `json:"key" jsonschema:"key or chord such as enter, ctrl+l, alt+tab"`
}

type ObserveInput

type ObserveInput struct {
	Screenshot bool `json:"screenshot,omitempty" jsonschema:"include a screenshot in the observation"`
}

type Options

type Options struct {
	Version contract.VersionInfo
	Config  config.Effective
}

type PasteInput

type PasteInput struct {
	Selection string `json:"selection,omitempty" jsonschema:"clipboard (default)"`
	Method    string `json:"method,omitempty" jsonschema:"key (ctrl+v, default) or insert (shift+insert)"`
}

type SemanticActionInput

type SemanticActionInput struct {
	ElementID string `json:"element_id" jsonschema:"AT-SPI element id returned by observe"`
	Action    string `json:"action,omitempty" jsonschema:"semantic accessibility action name; empty uses the first exposed action"`
}

type ServerInfo

type ServerInfo struct {
	Name           string   `json:"name"`
	Version        string   `json:"version"`
	SchemaVersions []string `json:"schema_versions"`
}

ServerInfo is the server-identity envelope returned to MCP clients during initialize. SchemaVersions advertises every action-payload schema version the server can accept.

func GetServerInfo

func GetServerInfo(version contract.VersionInfo) ServerInfo

GetServerInfo returns the server identity plus the supported action-payload schema versions. Called by serve handlers that want to advertise version negotiation metadata.

type TextInput

type TextInput struct {
	ElementID string `json:"element_id,omitempty" jsonschema:"AT-SPI element id returned by observe"`
	Text      string `json:"text" jsonschema:"literal text to type or set"`
}

type ToolInfo

type ToolInfo struct {
	Name        string
	Description string
	ReadOnly    bool
	Destructive bool
}

ToolInfo describes one registered MCP tool: its wire name, one-line description, and the read_only / destructive annotations that come from the add() call site. The conventions emit subcommand and the doctor.available_tools field consume this catalog so the tool list has one source of truth (the add() calls inside New()).

func Catalog

func Catalog() []ToolInfo

Catalog returns a defensive copy of the tools registered by the most recent call to New(). If New() has never been invoked the result is empty. Used by `mycomputer conventions emit` to derive the MCP tool inventory from the live binary surface.

type TypeTextInput

type TypeTextInput struct {
	Text string `json:"text" jsonschema:"literal text to type"`
	Via  string `json:"via,omitempty" jsonschema:"routing: xtest, paste, or auto (default auto)"`
}

Jump to

Keyboard shortcuts

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