Documentation
¶
Overview ¶
Package client provides utilities for managing client configurations and interacting with MCP servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateMCPServerURL ¶
GenerateMCPServerURL generates the URL for an MCP server
func Upsert ¶ added in v0.0.32
func Upsert(cf ConfigFile, name string, url string) error
Upsert updates/inserts an MCP server in a client configuration file It is a wrapper around the ConfigUpdater.Upsert method. Because the ConfigUpdater is different for each client type, we need to handle the different types of McpServer objects. For example, VSCode and ClaudeCode allows for a `type` field, but Cursor and others do not. This allows us to build up more complex MCP server configurations for different clients without leaking them into the CMD layer.
Types ¶
type ConfigFile ¶
type ConfigFile struct { Path string ClientType MCPClient ConfigUpdater ConfigUpdater Extension Extension }
ConfigFile represents a client configuration file
func FindClientConfigs ¶
func FindClientConfigs() ([]ConfigFile, error)
FindClientConfigs searches for client configuration files in standard locations
type ConfigUpdater ¶ added in v0.0.32
type ConfigUpdater interface { Upsert(serverName string, data MCPServer) error Remove(serverName string) error }
ConfigUpdater defines the interface for types which can edit MCP client config files.
type Extension ¶ added in v0.0.32
type Extension string
Extension is extension of the client config file.
const ( // JSON represents a JSON extension. JSON Extension = "json" )
type JSONConfigUpdater ¶ added in v0.0.32
JSONConfigUpdater is a ConfigUpdater that is responsible for updating JSON config files.
func (*JSONConfigUpdater) Remove ¶ added in v0.0.32
func (jcu *JSONConfigUpdater) Remove(serverName string) error
Remove removes an MCP server from the MCP client config file
type MCPClient ¶
type MCPClient string
MCPClient is an enum of supported MCP clients.
const ( // RooCode represents the Roo Code extension for VS Code. RooCode MCPClient = "roo-code" // Cursor represents the Cursor editor. Cursor MCPClient = "cursor" // VSCodeInsider represents the VS Code Insiders editor. VSCodeInsider MCPClient = "vscode-insider" // VSCode represents the standard VS Code editor. VSCode MCPClient = "vscode" // ClaudeCode represents the Claude Code CLI. ClaudeCode MCPClient = "claude-code" )
type MCPServerConfig ¶
type MCPServerConfig struct {
URL string `json:"url,omitempty"`
}
MCPServerConfig represents an MCP server configuration in a client config file