cursor

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cursor provides an adapter for Cursor IDE MCP configuration.

Cursor uses the same format as Claude Desktop, with config files at:

  • Global: ~/.cursor/mcp.json
  • Project: .cursor/mcp.json

Index

Constants

View Source
const (
	// AdapterName is the identifier for this adapter.
	AdapterName = "cursor"

	// GlobalConfigDir is the global config directory name.
	GlobalConfigDir = ".cursor"

	// ConfigFileName is the config file name.
	ConfigFileName = "mcp.json"
)

Variables

This section is empty.

Functions

func GlobalConfigPath

func GlobalConfigPath() (string, error)

GlobalConfigPath returns the path to the global Cursor config.

func ReadGlobalConfig

func ReadGlobalConfig() (*core.Config, error)

ReadGlobalConfig reads the global ~/.cursor/mcp.json file.

func WriteGlobalConfig

func WriteGlobalConfig(cfg *core.Config) error

WriteGlobalConfig writes to the global ~/.cursor/mcp.json file.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements core.Adapter for Cursor IDE.

func NewAdapter

func NewAdapter() *Adapter

NewAdapter creates a new Cursor adapter.

func (*Adapter) DefaultPaths

func (a *Adapter) DefaultPaths() []string

DefaultPaths returns the default config file paths for Cursor.

func (*Adapter) Marshal

func (a *Adapter) Marshal(cfg *core.Config) ([]byte, error)

Marshal converts canonical config to Cursor format.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the adapter name.

func (*Adapter) Parse

func (a *Adapter) Parse(data []byte) (*core.Config, error)

Parse parses Cursor config data into the canonical format.

func (*Adapter) ReadFile

func (a *Adapter) ReadFile(path string) (*core.Config, error)

ReadFile reads a Cursor config file.

func (*Adapter) WriteFile

func (a *Adapter) WriteFile(cfg *core.Config, path string) error

WriteFile writes canonical config to a Cursor format file.

type Config

type Config = claude.Config

Config is an alias for Claude's config since the format is identical.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Cursor config.

type ServerConfig

type ServerConfig = claude.ServerConfig

ServerConfig is an alias for Claude's server config.

Jump to

Keyboard shortcuts

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