Skip to content

Commit 1c06b16

Browse files
clydinalan-agius4
authored andcommitted
feat(@angular/cli): add builder info to list_projects MCP tool
The `list_projects` tool is enhanced to include the primary builder for each project, providing more specific metadata about its function. The builder is extracted from the project's 'build' target and added as an optional 'builder' field to the output. This allows users and other tools to quickly determine a project's type (e.g., application, library) by inspecting its builder string. The tool's description has also been updated to reflect this new capability.
1 parent f4555df commit 1c06b16

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/angular/cli/src/commands/mcp/tools/projects.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const listProjectsOutputSchema = {
3434
.enum(['application', 'library'])
3535
.optional()
3636
.describe(`The type of the project, either 'application' or 'library'.`),
37+
builder: z
38+
.string()
39+
.optional()
40+
.describe('The primary builder for the project, typically from the "build" target.'),
3741
root: z
3842
.string()
3943
.describe('The root directory of the project, relative to the workspace root.'),
@@ -90,6 +94,7 @@ their types, and their locations.
9094
* Determining if a project is an \`application\` or a \`library\`.
9195
* Getting the \`selectorPrefix\` for a project before generating a new component to ensure it follows conventions.
9296
* Identifying the major version of the Angular framework for each workspace, which is crucial for monorepos.
97+
* Determining a project's primary function by inspecting its builder (e.g., '@angular-devkit/build-angular:browser' for an application).
9398
</Use Cases>
9499
<Operational Notes>
95100
* **Working Directory:** Shell commands for a project (like \`ng generate\`) **MUST**
@@ -253,6 +258,7 @@ async function loadAndParseWorkspace(
253258
projects.push({
254259
name,
255260
type: project.extensions['projectType'] as 'application' | 'library' | undefined,
261+
builder: project.targets.get('build')?.builder,
256262
root: project.root,
257263
sourceRoot: project.sourceRoot ?? path.posix.join(project.root, 'src'),
258264
selectorPrefix: project.extensions['prefix'] as string,

0 commit comments

Comments
 (0)