multica-ai/multica · error
managed cursor mcp_config would overwrite existing…
Error message
managed cursor mcp_config would overwrite existing .cursor/mcp.json
What it means
Fires when a .cursor/mcp.json already exists at the project root. Managed config refuses to overwrite user-owned Cursor configuration, so preparation fails instead of clobbering the user's server list.
Solutions
- Remove or merge the existing .cursor/mcp.json before enabling managed mcp_config.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/internal/daemon/execenv/cursor_mcp.go:75 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/0aa3e5e9fbd59914.
Report an issue: GitHub.
Appendix: source
Thrown at server/internal/daemon/execenv/cursor_mcp.go:75
}
projectRoot := cursorProjectRoot(workDir)
servers, err := parseCursorManagedMcpServers(mcpConfig)
if err != nil {
return "", err
}
cursorDir := filepath.Join(projectRoot, ".cursor")
if err := recordMkdirAll(cursorDir, 0o755, manifest); err != nil {
return "", fmt.Errorf("create .cursor dir: %w", err)
}
configData, err := marshalCursorMcpConfig(servers)
if err != nil {
return "", err
}
if err := recordWriteFile(filepath.Join(cursorDir, "mcp.json"), configData, 0o600, manifest); err != nil {
if errors.Is(err, errPathPreExists) {
return "", fmt.Errorf("managed cursor mcp_config would overwrite existing .cursor/mcp.json")
}
return "", fmt.Errorf("write .cursor/mcp.json: %w", err)
}
cursorDataDir := filepath.Join(envRoot, "cursor-data")
projectDataDir := filepath.Join(cursorDataDir, "projects", cursorSlugifyPath(projectRoot))
if err := os.MkdirAll(projectDataDir, 0o700); err != nil {
return "", fmt.Errorf("create cursor project data dir: %w", err)
}
if err := removeCursorMcpAuthFile(projectDataDir); err != nil {
return "", err
}
approvals, err := cursorMcpApprovalKeys(projectRoot, servers)
if err != nil {
return "", err
}
approvalData, err := json.MarshalIndent(approvals, "", " ")
if err != nil {View on GitHub (pinned to 2c0912b6ec)