Documentation
¶
Overview ¶
Package vscode provides configuration management for VSCode MCP servers.
This package handles:
- VSCode workspace configuration (.vscode/mcp.json)
- VSCode user-level configuration
- Platform-specific configuration file paths (macOS, Linux, Windows)
- MCP server entry management
Platform-specific path functions use build tags to locate VSCode configuration directories on different operating systems.
This is an internal package and should not be imported by users of the cobrax library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns the provided path if non-empty, otherwise returns the platform-specific default path for VSCode configuration. If workspace is true, returns workspace configuration path (.vscode/mcp.json), otherwise returns user-level configuration path.
Types ¶
type Config ¶
type Config struct {
Inputs []Input `json:"inputs,omitempty"`
Servers map[string]Server `json:"servers"`
}
Config represents the structure of VSCode's MCP configuration file.
func (*Config) HasServer ¶
HasServer returns true if a server with the given name exists in the configuration.
func (*Config) RemoveServer ¶
RemoveServer removes a server from the configuration.
type Input ¶
type Input struct {
Type string `json:"type"`
ID string `json:"id"`
Description string `json:"description"`
Password bool `json:"password,omitempty"`
}
Input represents a VSCode input variable configuration.
type Server ¶
type Server struct {
Type string `json:"type,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
}
Server represents an MCP server configuration entry for VSCode.