windsurf

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package windsurf provides an adapter for Windsurf (Codeium) MCP configuration.

Windsurf uses a format similar to Claude, but with one key difference: HTTP servers use "serverUrl" instead of "url".

File location: ~/.codeium/windsurf/mcp_config.json

Index

Constants

View Source
const (
	// AdapterName is the identifier for this adapter.
	AdapterName = "windsurf"

	// ConfigDir is the config directory relative to home.
	ConfigDir = ".codeium/windsurf"

	// ConfigFileName is the config file name.
	ConfigFileName = "mcp_config.json"
)

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the default Windsurf config path.

func ReadConfig

func ReadConfig() (*core.Config, error)

ReadConfig reads the Windsurf config file.

func WriteConfig

func WriteConfig(cfg *core.Config) error

WriteConfig writes to the Windsurf config file.

Types

type Adapter

type Adapter struct{}

Adapter implements core.Adapter for Windsurf.

func NewAdapter

func NewAdapter() *Adapter

NewAdapter creates a new Windsurf adapter.

func (*Adapter) DefaultPaths

func (a *Adapter) DefaultPaths() []string

DefaultPaths returns the default config file paths for Windsurf.

func (*Adapter) FromCore

func (a *Adapter) FromCore(cfg *core.Config) *Config

FromCore converts canonical config to Windsurf format.

func (*Adapter) Marshal

func (a *Adapter) Marshal(cfg *core.Config) ([]byte, error)

Marshal converts canonical config to Windsurf format.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the adapter name.

func (*Adapter) Parse

func (a *Adapter) Parse(data []byte) (*core.Config, error)

Parse parses Windsurf config data into the canonical format.

func (*Adapter) ReadFile

func (a *Adapter) ReadFile(path string) (*core.Config, error)

ReadFile reads a Windsurf config file.

func (*Adapter) ToCore

func (a *Adapter) ToCore(windsurfCfg *Config) *core.Config

ToCore converts Windsurf config to canonical format.

func (*Adapter) WriteFile

func (a *Adapter) WriteFile(cfg *core.Config, path string) error

WriteFile writes canonical config to a Windsurf format file.

type Config

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

Config represents the Windsurf MCP configuration.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Windsurf config.

type ServerConfig

type ServerConfig struct {
	// Type specifies the transport type.
	Type string `json:"type,omitempty"`

	// --- STDIO Server Fields ---
	Command string            `json:"command,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`

	// --- HTTP Server Fields ---
	// Note: Windsurf uses "serverUrl" instead of "url"
	ServerURL string            `json:"serverUrl,omitempty"`
	Headers   map[string]string `json:"headers,omitempty"`

	// --- Tool Control ---
	DisabledTools []string `json:"disabledTools,omitempty"`
}

ServerConfig represents a Windsurf MCP server configuration. Note: Windsurf uses "serverUrl" for HTTP servers instead of "url".

Jump to

Keyboard shortcuts

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