mcp

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mcp installs a CDP browser driver and generates the MCP client config that points it at cuttle's browser for a given context and profile seed.

Index

Constants

View Source
const DefaultDriver = "browser-use"

DefaultDriver is used when `cuttle mcp` is invoked without a driver argument.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath(driver string) string

DefaultConfigPath is where a driver's MCP config is written when no explicit path is given: $XDG_CONFIG_HOME/cuttle/mcp/<driver>.json.

func EnsureInstalled

func EnsureInstalled(ctx context.Context, d Driver) error

EnsureInstalled installs the driver via its install command when it is not already on PATH. It is a no-op when the driver is present.

func Marshal

func Marshal(c Config) ([]byte, error)

Marshal renders the config as indented JSON.

func WriteConfig

func WriteConfig(path string, data []byte) error

WriteConfig writes the rendered config to path, creating parent dirs.

Types

type Config

type Config struct {
	MCPServers map[string]serverConfig `json:"mcpServers"`
}

Config is the MCP client config: a map of server name to its launch spec.

func BuildConfig

func BuildConfig(d Driver, cdpURL string) Config

BuildConfig produces the MCP config for a driver pointed at cdpURL (which already carries any ?fingerprint=<seed>).

type Driver

type Driver struct {
	Name       string
	Install    string
	MCPCommand string
	MCPArgs    []string
	EnvVar     string
}

Driver describes a CDP driver that exposes an MCP server. Names and install commands mirror the CLI's driver briefing table; MCPCommand/Args/EnvVar carry the extra bit the briefing does not: how to run the driver as an MCP server and which env var points it at a CDP endpoint.

func Lookup

func Lookup(name string) (Driver, error)

Lookup returns the driver metadata for name.

Jump to

Keyboard shortcuts

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