{"record":{"id":"0c686c6ca6419e7b","repo":"multica-ai/multica","slug":"env-root-is-required-for-managed-cursor-mcp-config","errorCode":null,"errorMessage":"env root is required for managed cursor mcp_config","messagePattern":"env root is required for managed cursor mcp_config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/cursor_mcp.go","lineNumber":56,"sourceCode":"\tEnv     json.RawMessage `json:\"env,omitempty\"`\n\tCwd     json.RawMessage `json:\"cwd,omitempty\"`\n}\n\ntype cursorRemoteMcpApprovalServer struct {\n\tType    json.RawMessage `json:\"type,omitempty\"`\n\tURL     json.RawMessage `json:\"url\"`\n\tHeaders json.RawMessage `json:\"headers,omitempty\"`\n}\n\n// prepareCursorMcpConfig writes the Cursor-native MCP sidecars for agents that\n// have an explicit managed mcp_config saved. A nil/null mcp_config means \"let\n// Cursor behave normally\", so no .cursor/mcp.json or CURSOR_DATA_DIR is created.\nfunc prepareCursorMcpConfig(envRoot, workDir string, mcpConfig json.RawMessage, mcpAuthSource string, manifest *sidecarManifest) (string, error) {\n\tif !hasManagedCursorMcpConfig(mcpConfig) {\n\t\treturn \"\", nil\n\t}\n\tif envRoot == \"\" {\n\t\treturn \"\", fmt.Errorf(\"env root is required for managed cursor mcp_config\")\n\t}\n\n\tprojectRoot := cursorProjectRoot(workDir)\n\tservers, err := parseCursorManagedMcpServers(mcpConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcursorDir := filepath.Join(projectRoot, \".cursor\")\n\tif err := recordMkdirAll(cursorDir, 0o755, manifest); err != nil {\n\t\treturn \"\", fmt.Errorf(\"create .cursor dir: %w\", err)\n\t}\n\tconfigData, err := marshalCursorMcpConfig(servers)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := recordWriteFile(filepath.Join(cursorDir, \"mcp.json\"), configData, 0o600, manifest); err != nil {\n\t\tif errors.Is(err, errPathPreExists) {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/cursor_mcp.go#L38-L74","documentation":"Error \"env root is required for managed cursor mcp_config\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/cursor_mcp.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the environment root before configuring managed cursor mcp_config."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}