{"record":{"id":"a677a286d67d9fb3","repo":"angular/angular-cli","slug":"workspace-path-does-not-exist-workspacepathinpu","errorCode":null,"errorMessage":"Workspace path does not exist: ${workspacePathInput}. You can use 'list_projects' to find available workspaces.","messagePattern":"Workspace path does not exist: (.+?)\\. You can use 'list_projects' to find available workspaces\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/mcp/workspace-utils.ts","lineNumber":152,"sourceCode":"  projectNameInput,\n  mcpWorkspace,\n}: {\n  host: Host;\n  server?: McpToolContext['server'];\n  workspacePathInput?: string;\n  projectNameInput?: string;\n  mcpWorkspace?: AngularWorkspace;\n}): Promise<{\n  workspace: AngularWorkspace;\n  workspacePath: string;\n  projectName: string;\n}> {\n  let workspacePath: string;\n  let workspace: AngularWorkspace;\n\n  if (workspacePathInput) {\n    if (!host.existsSync(workspacePathInput)) {\n      throw new Error(\n        `Workspace path does not exist: ${workspacePathInput}. ` +\n          \"You can use 'list_projects' to find available workspaces.\",\n      );\n    }\n    if (!host.existsSync(join(workspacePathInput, 'angular.json'))) {\n      throw new Error(\n        `No angular.json found at ${workspacePathInput}. ` +\n          \"You can use 'list_projects' to find available workspaces.\",\n      );\n    }\n    if (server) {\n      if (!(await isAllowedWorkspacePath(server, workspacePathInput))) {\n        throw new Error(\n          `Workspace path is outside the allowed MCP roots: ${workspacePathInput}. ` +\n            \"You can use 'list_projects' to find available workspaces.\",\n        );\n      }\n    }","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/workspace-utils.ts#L134-L170","documentation":"resolveWorkspaceAndProject resolves the Angular workspace for MCP tools. When a workspacePathInput is supplied, it first checks host.existsSync(workspacePathInput); if the path is absent it throws with a hint to use the 'list_projects' MCP tool to discover valid workspace paths.","triggerScenarios":"Calling any MCP tool that accepts a workspacePath with a path that does not exist on the host filesystem (existsSync fails) — e.g. { workspacePath: '/wrong/dir', projectName: 'app' } hitting workspace-utils.ts:152.","commonSituations":"Typos in the workspace path; passing a path relative to a different cwd than the MCP server's; workspace directory renamed or deleted; hardcoding a path from a different machine in agent configuration.","solutions":["Call the 'list_projects' MCP tool to get valid workspace paths and use one of those","Verify the path exists on the machine where the MCP server runs (not the client)","Pass an absolute path to the directory containing angular.json","Omit workspacePath entirely if only one workspace exists so it can be auto-discovered"],"exampleFix":"// before\nawait resolveWorkspaceAndProject(host, { workspacePath: './my-app' });\n// after\nconst p = '/home/user/projects/my-app'; // absolute, verified to exist\nif (!host.existsSync(p)) throw new Error(`No such dir: ${p}`);\nawait resolveWorkspaceAndProject(host, { workspacePath: p });","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(workspacePath)) {\n  throw new Error(`Workspace path does not exist: ${workspacePath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await resolveWorkspaceAndProject(host, { workspacePath });\n} catch (e) {\n  if ((e as Error).message.includes('Workspace path does not exist')) {\n    const projects = await listProjects(); // discover valid workspace paths\n    console.error(`Use one of: ${projects.map((p) => p.path).join(', ')}`);\n  } else throw e;\n}","preventionTips":["Resolve workspace paths with the 'list_projects' tool rather than hardcoding","Remember the path is checked on the MCP server host, not the client machine","Use absolute paths to avoid cwd-dependent resolution"],"tags":["filesystem","invalid-input","path-resolution","angular-workspace"],"backgroundTag":"file-or-directory-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}