From 17c5fd9b2078d2ff1d17e8bf12790477e8159f61 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:17:37 -0400 Subject: [PATCH] fix(@angular/cli): skip workspace-specific tools when outside a workspace When the MCP server is initialized outside of an Angular workspace, workspace-specific tools such as should not be registered as they will not function correctly. --- packages/angular/cli/src/commands/mcp/mcp-server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/angular/cli/src/commands/mcp/mcp-server.ts b/packages/angular/cli/src/commands/mcp/mcp-server.ts index 47231ff4e0e4..fe0facfa1fc7 100644 --- a/packages/angular/cli/src/commands/mcp/mcp-server.ts +++ b/packages/angular/cli/src/commands/mcp/mcp-server.ts @@ -54,7 +54,12 @@ export async function createMcpServer( ); registerBestPracticesTool(server); - registerListProjectsTool(server, context); + + // If run outside an Angular workspace (e.g., globally) skip the workspace specific tools. + // Currently only the `list_projects` tool. + if (!context.workspace) { + registerListProjectsTool(server, context); + } await registerDocSearchTool(server);