client

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VendorGordon = "gordon"

	VendorCodex = "codex"
)
View Source
const (
	DockerMCPCatalog = "MCP_DOCKER"
)

Variables

View Source
var ErrCodexOnlySupportsGlobalConfiguration = errors.New("codex only supports global configuration. Re-run with --global or -g")
View Source
var (
	ErrNotInGitRepo = errors.New("could not find root project root (use --global flag to update global configuration)")
)

Functions

func Connect

func Connect(ctx context.Context, dao db.DAO, cwd string, config Config, vendor string, global bool, workingSet string) error

func ConnectCodex

func ConnectCodex(_ context.Context, workingSet string) error

ConnectCodex configures docker mcp gateway in Codex by editing config.toml

func ConnectGordon

func ConnectGordon(ctx context.Context, workingSet string) error

func Disconnect

func Disconnect(ctx context.Context, cwd string, config Config, vendor string, global bool) error

func DisconnectCodex

func DisconnectCodex(_ context.Context) error

DisconnectCodex removes docker mcp gateway from Codex by editing config.toml

func DisconnectGordon

func DisconnectGordon(ctx context.Context) error

func FindClientsByProfile

func FindClientsByProfile(ctx context.Context, profileID string) map[string]any

func FindGitProjectRoot

func FindGitProjectRoot(dir string) string

func GetSupportedMCPClients

func GetSupportedMCPClients(cfg Config) []string

func IsSupportedMCPClient

func IsSupportedMCPClient(cfg Config, vendor string, global bool) bool

func ReadGordonProfile added in v0.31.0

func ReadGordonProfile() (string, error)

Types

type CfgError

type CfgError struct {
	Type string `json:"type"` // permission|unknown
	Err  string `json:"error"`
}

type Config

type Config struct {
	System  map[string]globalCfg `yaml:"system"`
	Project map[string]localCfg  `yaml:"project"`
}

func ReadConfig

func ReadConfig() *Config

type ErrVendorNotFound

type ErrVendorNotFound struct {
	// contains filtered or unexported fields
}

func (*ErrVendorNotFound) Error

func (e *ErrVendorNotFound) Error() string

type FileConfig added in v0.31.0

type FileConfig struct {
	Profile string `json:"profile"`
}

type GlobalCfgProcessor

type GlobalCfgProcessor struct {
	// contains filtered or unexported fields
}

func NewGlobalCfgProcessor

func NewGlobalCfgProcessor(g globalCfg) (*GlobalCfgProcessor, error)

func (*GlobalCfgProcessor) GetPathsForCurrentOS

func (c *GlobalCfgProcessor) GetPathsForCurrentOS() []string

func (*GlobalCfgProcessor) ParseConfig

func (c *GlobalCfgProcessor) ParseConfig() MCPClientCfg

func (*GlobalCfgProcessor) Update

func (c *GlobalCfgProcessor) Update(key string, server *MCPServerSTDIO) error

type LocalCfgProcessor

type LocalCfgProcessor struct {
	// contains filtered or unexported fields
}

func NewLocalCfgProcessor

func NewLocalCfgProcessor(cfg localCfg, projectRoot string) (*LocalCfgProcessor, error)

func (*LocalCfgProcessor) Parse

func (*LocalCfgProcessor) Update

func (c *LocalCfgProcessor) Update(key string, server *MCPServerSTDIO) error

type MCPClientCfg

type MCPClientCfg struct {
	MCPClientCfgBase
	IsInstalled   bool `json:"isInstalled"`
	IsOsSupported bool `json:"isOsSupported"`
}

func GetCodexSetup

func GetCodexSetup(ctx context.Context) MCPClientCfg

GetCodexSetup returns the configuration status for Codex

func GetGordonSetup

func GetGordonSetup(ctx context.Context) MCPClientCfg

type MCPClientCfgBase

type MCPClientCfgBase struct {
	DisplayName           string    `json:"displayName"`
	Source                string    `json:"source"`
	Icon                  string    `json:"icon"`
	ConfigName            string    `json:"configName"`
	IsMCPCatalogConnected bool      `json:"dockerMCPCatalogConnected"`
	WorkingSet            string    `json:"profile"`
	Err                   *CfgError `json:"error"`

	Cfg *MCPJSONLists
}

type MCPJSONLists

type MCPJSONLists struct {
	STDIOServers []MCPServerSTDIO
	SSEServers   []MCPServerSSE
	HTTPServers  []MCPServerHTTP
}

func UnmarshalMCPJSONList

func UnmarshalMCPJSONList(data []byte) (*MCPJSONLists, error)

type MCPServerConfig

type MCPServerConfig struct {
	Command string   `toml:"command"`
	Args    []string `toml:"args"`
}

MCPServerConfig represents the structure of an MCP server in config.toml

type MCPServerHTTP

type MCPServerHTTP struct {
	Name    string            `json:"name"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
}

func (*MCPServerHTTP) String

func (c *MCPServerHTTP) String() string

type MCPServerSSE

type MCPServerSSE struct {
	Name    string            `json:"name"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
}

func (*MCPServerSSE) String

func (c *MCPServerSSE) String() string

type MCPServerSTDIO

type MCPServerSTDIO struct {
	Name    string            `json:"name,omitempty"`
	Command string            `json:"command"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`
}

func (*MCPServerSTDIO) GetWorkingSet

func (c *MCPServerSTDIO) GetWorkingSet() string

func (*MCPServerSTDIO) String

func (c *MCPServerSTDIO) String() string

type Paths

type Paths struct {
	Linux   []string `yaml:"linux"`
	Darwin  []string `yaml:"darwin"`
	Windows []string `yaml:"windows"`
}

type PreprocessFunc

type PreprocessFunc func([]byte) ([]byte, error)

type ProfilesFile added in v0.31.0

type ProfilesFile = map[string]FileConfig

Currently only used for Gordon.

type ProjectMCPClientCfg

type ProjectMCPClientCfg struct {
	MCPClientCfgBase
	IsConfigured bool `json:"isConfigured"`
}

type Updater

type Updater func(key string, server *MCPServerSTDIO) error

type YQ

type YQ struct {
	List string `yaml:"list"`
	Set  string `yaml:"set"`
	Del  string `yaml:"del"`
}

Jump to

Keyboard shortcuts

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