vscode

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func ConfigPath(workspace bool) string

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) AddServer

func (c *Config) AddServer(name string, server Server)

AddServer adds or updates a server in the configuration.

func (*Config) HasServer

func (c *Config) HasServer(name string) bool

HasServer returns true if a server with the given name exists in the configuration.

func (*Config) Print

func (c *Config) Print()

Print displays all configured MCP servers.

func (*Config) RemoveServer

func (c *Config) RemoveServer(name string)

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.

func (Server) Print

func (s Server) Print()

Print displays the server configuration details.

Jump to

Keyboard shortcuts

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