Documentation
¶
Overview ¶
Package cursor provides configuration management for Cursor MCP servers.
This package handles:
- Cursor workspace configuration (.cursor/mcp.json)
- Cursor user-level configuration
- Platform-specific configuration file paths (macOS, Linux, Windows)
- MCP server entry management
Platform-specific path functions use build tags to locate Cursor 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 platform-specific default path for Cursor configuration. If workspace is true, returns workspace configuration path (.cursor/mcp.json), otherwise returns user-level configuration path.
Types ¶
type Config ¶
type Config struct {
Inputs []Input `json:"inputs,omitempty"`
Servers map[string]Server `json:"mcpServers"`
}
Config represents the structure of Cursor'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 Cursor 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 Cursor.