Skip to content

Commit 2d753cc

Browse files
committed
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. (cherry picked from commit 193b394)
1 parent 42d72ef commit 2d753cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/angular/cli/src/commands/mcp/mcp-server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export async function createMcpServer(context: {
5050
);
5151

5252
registerBestPracticesTool(server);
53-
registerListProjectsTool(server, context);
53+
54+
// If run outside an Angular workspace (e.g., globally) skip the workspace specific tools.
55+
// Currently only the `list_projects` tool.
56+
if (!context.workspace) {
57+
registerListProjectsTool(server, context);
58+
}
5459

5560
await registerDocSearchTool(server);
5661

0 commit comments

Comments
 (0)