From 6e08972fc9c5c5c3ebbb0f0c5a05a2c7ebf56ead Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:37:13 -0400 Subject: [PATCH 1/2] fix(@angular/cli): correct boolean parsing in MCP example front matter This commit fixes a bug in the `parseFrontmatter` utility where boolean values (true/false) were being incorrectly parsed as strings. The Zod schema validator for the `experimental` flag would reject these string values, causing the example database generation to fail. The parser has been updated to explicitly check for "true" and "false" strings and convert them to their corresponding boolean types, ensuring that the front matter is parsed correctly. This fix is applied to both the build-time database generator and the runtime tool. --- packages/angular/cli/src/commands/mcp/tools/examples.ts | 9 ++++++++- tools/example_db_generator.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/angular/cli/src/commands/mcp/tools/examples.ts b/packages/angular/cli/src/commands/mcp/tools/examples.ts index 445ff04667e8..bccedc0ed44a 100644 --- a/packages/angular/cli/src/commands/mcp/tools/examples.ts +++ b/packages/angular/cli/src/commands/mcp/tools/examples.ts @@ -404,7 +404,14 @@ function parseFrontmatter(content: string): Record { isArray = value.trim() === ''; if (!isArray) { - data[currentKey] = value.trim(); + const trimmedValue = value.trim(); + if (trimmedValue === 'true') { + data[currentKey] = true; + } else if (trimmedValue === 'false') { + data[currentKey] = false; + } else { + data[currentKey] = trimmedValue; + } } } else { const arrayItemMatch = line.match(/^\s*-\s*(.*)/); diff --git a/tools/example_db_generator.js b/tools/example_db_generator.js index 784ff52128dd..dc1f7ba8e3be 100644 --- a/tools/example_db_generator.js +++ b/tools/example_db_generator.js @@ -48,7 +48,14 @@ function parseFrontmatter(content) { isArray = value.trim() === ''; if (!isArray) { - data[currentKey] = value.trim(); + const trimmedValue = value.trim(); + if (trimmedValue === 'true') { + data[currentKey] = true; + } else if (trimmedValue === 'false') { + data[currentKey] = false; + } else { + data[currentKey] = trimmedValue; + } } } else { const arrayItemMatch = line.match(/^\s*-\s*(.*)/); From 626518a163f91d73b726c980b340769c7d21a135 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:40:46 -0400 Subject: [PATCH 2/2] feat(@angular/cli): promote MCP `find_examples` tool to a stable tool The `find_examples` MCP tool has undergone significant enhancements, including the implementation of a structured relational database, advanced filtering, weighted search ranking, and snippet support. Given its maturity, robustness, and utility, the tool is now considered stable and is promoted to the default set of enabled tools for the MCP server. It is moved from the experimental list to the stable list. --- packages/angular/cli/src/commands/mcp/mcp-server.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/angular/cli/src/commands/mcp/mcp-server.ts b/packages/angular/cli/src/commands/mcp/mcp-server.ts index 52375a8a0b38..abba8b185a70 100644 --- a/packages/angular/cli/src/commands/mcp/mcp-server.ts +++ b/packages/angular/cli/src/commands/mcp/mcp-server.ts @@ -23,17 +23,18 @@ import { AnyMcpToolDeclaration, registerTools } from './tools/tool-registry'; * The set of tools that are enabled by default for the MCP server. * These tools are considered stable and suitable for general use. */ -const STABLE_TOOLS = [BEST_PRACTICES_TOOL, DOC_SEARCH_TOOL, LIST_PROJECTS_TOOL] as const; +const STABLE_TOOLS = [ + BEST_PRACTICES_TOOL, + DOC_SEARCH_TOOL, + FIND_EXAMPLE_TOOL, + LIST_PROJECTS_TOOL, +] as const; /** * The set of tools that are available but not enabled by default. * These tools are considered experimental and may have limitations. */ -export const EXPERIMENTAL_TOOLS = [ - FIND_EXAMPLE_TOOL, - MODERNIZE_TOOL, - ZONELESS_MIGRATION_TOOL, -] as const; +export const EXPERIMENTAL_TOOLS = [MODERNIZE_TOOL, ZONELESS_MIGRATION_TOOL] as const; export async function createMcpServer( options: {