Documentation
¶
Overview ¶
Package manager provides configuration management for MCP servers across platforms.
This package contains shared functionality for managing MCP server configurations for Claude Desktop and VSCode. It provides generic configuration management, loading and saving JSON config files, and common utilities.
This is an internal package and should not be imported by users of the cobrax library.
Index ¶
- func DeriveServerName(executablePath string) string
- func GetCmdPath(cmd *cobra.Command, commandName string) ([]string, error)
- type Config
- type Manager
- func NewClaudeManager(configPath string) (*Manager[claude.Server, *claude.Config], error)
- func NewCursorManager(configPath string, workspace bool) (*Manager[cursor.Server, *cursor.Config], error)
- func NewVSCodeManager(configPath string, workspace bool) (*Manager[vscode.Server, *vscode.Config], error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveServerName ¶
DeriveServerName extracts the server name from an executable path.
func GetCmdPath ¶
GetCmdPath builds the command path to the cobrax command. It returns the slice of command names from after the root command up to and including the command identified by commandName.
Example: for command path "myapp agent claude enable" with commandName "agent", returns ["agent"].
The returned slice can be used as arguments when invoking the executable. Returns an error if commandName is not found in the command path.
Types ¶
type Config ¶
type Config[S Server] interface { HasServer(name string) bool AddServer(name string, server S) RemoveServer(name string) Print() }
Config represents MCP server configuration that can be managed.
type Manager ¶
Manager provides generic configuration management for MCP servers. It handles loading, saving, and modifying MCP server configurations. It is not thread-safe.
func NewClaudeManager ¶
NewClaudeManager creates a new Manager configured for Claude Desktop MCP servers.
func NewCursorManager ¶
func NewCursorManager(configPath string, workspace bool) (*Manager[cursor.Server, *cursor.Config], error)
NewCursorManager creates a new Manager configured for Cursor MCP servers. If workspace is true, uses workspace configuration (.cursor/mcp.json), otherwise uses user-level configuration.
func NewVSCodeManager ¶
func NewVSCodeManager(configPath string, workspace bool) (*Manager[vscode.Server, *vscode.Config], error)
NewVSCodeManager creates a new Manager configured for VSCode MCP servers. If workspace is true, uses workspace configuration (.vscode/mcp.json), otherwise uses user-level configuration.
func (*Manager[S, C]) DisableServer ¶
DisableServer removes an MCP server from the configuration.
func (*Manager[S, C]) EnableServer ¶
EnableServer adds or updates an MCP server in the configuration.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package claude provides configuration management for Claude Desktop MCP servers.
|
Package claude provides configuration management for Claude Desktop MCP servers. |
|
Package cursor provides configuration management for Cursor MCP servers.
|
Package cursor provides configuration management for Cursor MCP servers. |
|
Package vscode provides configuration management for VSCode MCP servers.
|
Package vscode provides configuration management for VSCode MCP servers. |