Skip to content

MCP cannot find angular.json #32219

@begrs

Description

@begrs

Which @angular/* package(s) are the source of the bug?

angular/cli

Is this a regression?

No

Description

The MCP tool list-projects cannot find the angular.json.
Using Windsurf, I have configured the MCP server, which is running and returning examples just fine.

When I try to list the projects,
"Ran with these arguments:
{}
Output
No Angular workspace found. An angular.json file, which marks the root of a workspace, could not be located in the current directory or any of its parent directories."

Yet, there is an angular.json (this is NOT a monorepo, the project was created using the angular cli) in the directory opened with Windsurf (or VSCode) as the root project.
It is also the ONLY angular project in the file tree. The angular.json is at the same level as the .vscode and .angular folders (default), which is also the top level opened in the IDE.

I uninstalled and re-installed the angular-cli, still not working.
I uninstalled any other angular-cli (ng) and verified that ng was completely gone and no longer found as a command in the terminal, before reinstalling.
(previously I had a cli version installed with --save-dev instead of globally)
I even tried setting the full path of the cli from node_modules in the project as the command for the mcp config.

Full reproduction:

  • install angular-cli via npm install -g @angular/cli@latest
  • run npx @angular/cli mcp
  • edit mcp_config.json via Windsurf UI, located at C:\Users....codeium\windsurf\mcp_config.json
  • Windsurf shows angular-cli mcp as up and running with 6 tools. find_examples works perfectly.
  • Model SWE-1.5 Prompt: "use angular-cli mcp to list all projects "
  • (I also tried paid models, e.g. Sonnet)

{ "mcpServers": { "angular-cli": { "args": [ "-y", "@angular/cli", "mcp" ], "command": "npx", "disabled": false } } }
The mcp_config.json is correct, as other things I tried there always failed to start the mcp server afterwards.

I assume the global cli does not correctly use the current folder its run from?

If this is not a bug, any help would be greatly appreciated.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Ran with these arguments:
{}
Output
No Angular workspace found. An angular.json file, which marks the root of a workspace, could not be located in the current directory or any of its parent directories."

Please provide the environment you discovered this bug in (run ng version)

Angular CLI       : 21.0.4
Angular           : 21.0.6
Node.js           : 24.11.1
Package Manager   : npm 11.6.3
Operating System  : win32 x64

┌───────────────────────────────────┬───────────────────┬───────────────────┐
│ Package                           │ Installed Version │ Requested Version │
├───────────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/core              │ 21.0.4            │ ^21.0.4           │
│ @angular/animations               │ 21.0.6            │ ^21.0.6           │
│ @angular/build                    │ 21.0.4            │ ^21.0.4           │
│ @angular/common                   │ 21.0.6            │ ^21.0.6           │
│ @angular/compiler                 │ 21.0.6            │ ^21.0.6           │
│ @angular/compiler-cli             │ 21.0.6            │ ^21.0.6           │
│ @angular/core                     │ 21.0.6            │ ^21.0.6           │
│ @angular/forms                    │ 21.0.6            │ ^21.0.6           │
│ @angular/platform-browser         │ 21.0.6            │ ^21.0.6           │
│ @angular/platform-browser-dynamic │ 21.0.6            │ ^21.0.6           │
│ @angular/router                   │ 21.0.6            │ ^21.0.6           │
│ rxjs                              │ 7.8.2             │ ~7.8.0            │
│ typescript                        │ 5.9.3             │ ~5.9.3            │
│ zone.js                           │ 0.15.1            │ ^0.15.0           │
└───────────────────────────────────┴───────────────────┴───────────────────┘

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions