angular/angular-cli · error · Error

Project '${projectName}' not found in workspace path ${works

Error message

Project '${projectName}' not found in workspace path ${workspacePath}. You can use 'list_projects' to find available projects.

What it means

The Angular CLI MCP server throws this in resolveWorkspaceAndProject when a projectName argument is supplied but no project with that exact name exists in the workspace loaded from workspacePath (checked via workspace.projects.has). It is a guard against acting on a non-existent project, and it points users to the list_projects tool to discover valid names.

Source

Thrown at packages/angular/cli/src/commands/mcp/workspace-utils.ts:211

      throw new Error(
        `The current directory resolves to a workspace outside the allowed MCP roots: ${found}. ` +
          "You can use 'list_projects' to find available workspaces.",
      );
    }

    workspacePath = found;
    const configPath = join(workspacePath, 'angular.json');
    try {
      workspace = await AngularWorkspace.load(configPath);
    } catch (e) {
      throw new Error(`Failed to load workspace configuration at ${configPath}.`, { cause: e });
    }
  }

  let projectName = projectNameInput;
  if (projectName) {
    if (!workspace.projects.has(projectName)) {
      throw new Error(
        `Project '${projectName}' not found in workspace path ${workspacePath}. ` +
          "You can use 'list_projects' to find available projects.",
      );
    }
  } else {
    projectName = getDefaultProjectName(workspace);
  }

  if (!projectName) {
    throw new Error(
      `No project name provided and no default project found in workspace path ${workspacePath}. ` +
        'Please provide a project name or set a default project in angular.json. ' +
        "You can use 'list_projects' to find available projects.",
    );
  }

  return { workspace, workspacePath, projectName };
}

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Call list_projects (or inspect angular.json 'projects' section) to get exact project names.
  2. Correct the projectName argument to match exactly (case-sensitive).
  3. Verify workspacePath points at the directory containing the intended angular.json.

Example fix

// before
find_project({ workspacePath: '/repo', projectName: 'my-app' })
// after
find_project({ workspacePath: '/repo', projectName: 'my-app-client' }) // exact name from angular.json
Defensive patterns

Strategy: validation

Validate before calling

import { getWorkspace } from './utilities/workspace';
const workspace = await getWorkspace('angular.json');
if (!workspace.projects.has(projectName)) {
  throw new Error(`Unknown project '${projectName}'. Available: ${[...workspace.projects.keys()].join(', ')}`);
}

Type guard

function isKnownProject(workspace: { projects: { has(n: string): boolean } }, name: string): boolean {
  return workspace.projects.has(name);
}

Prevention

When it happens

Trigger: Calling any MCP tool with { workspacePath, projectName } where projectName is not a key in the workspace's angular.json 'projects' map (typo, renamed project, stale config).

Common situations: Typos in project names; project was renamed or removed from angular.json; pointing workspacePath at the wrong repository; IDE autocomplete of stale names; multi-project repos where names differ from directory names.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/d41d415239ce4f53. Report an issue: GitHub.