Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/angular/cli/src/commands/mcp/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ export default class McpCommandModule extends CommandModule implements CommandMo
alias: 'E',
array: true,
describe: 'Enable an experimental tool.',
choices: [
...EXPERIMENTAL_TOOLS.map(({ name }) => name),
...Object.keys(EXPERIMENTAL_TOOL_GROUPS),
],
hidden: true,
});
}
Expand Down
10 changes: 6 additions & 4 deletions packages/angular/cli/src/commands/mcp/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,24 @@ const STABLE_TOOLS = [
DOC_SEARCH_TOOL,
LIST_PROJECTS_TOOL,
ZONELESS_MIGRATION_TOOL,
RUN_TARGET_TOOL,
...DEVSERVER_TOOLS,
] 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 = [RUN_TARGET_TOOL, ...DEVSERVER_TOOLS] as const;
export const EXPERIMENTAL_TOOLS: readonly AnyMcpToolDeclaration[] = [] as const;

/**
* Experimental tools that are grouped together under a single name.
*
* Used for enabling them as a group.
*/
export const EXPERIMENTAL_TOOL_GROUPS = {
export const EXPERIMENTAL_TOOL_GROUPS: Record<string, readonly AnyMcpToolDeclaration[]> = {
'all': EXPERIMENTAL_TOOLS,
'devserver': DEVSERVER_TOOLS,
'devserver': [],
};

export async function createMcpServer(
Expand Down Expand Up @@ -205,7 +207,7 @@ export function assembleToolDeclarations(
const tool = experimentalToolsMap.get(toolName);
if (tool) {
toolDeclarations.push(tool);
} else {
} else if (!stableDeclarations.some((t) => t.name === toolName)) {
options.logger.warn(`Unknown experimental tool: ${toolName}`);
}
}
Expand Down
10 changes: 3 additions & 7 deletions tests/e2e/tests/mcp/run-target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export default async function () {
);

try {
// 1. Ensure `run_target` is NOT registered by default (stable-only tools registered)
// 1. Ensure `run_target` is registered by default (now stable)
const { stdout: stdoutDefault } = await runInspector('--method', 'tools/list');
assert.doesNotMatch(stdoutDefault, /"run_target"/);
assert.match(stdoutDefault, /"run_target"/);

// 2. Ensure `run_target` is registered when explicitly enabled via experimental-tool flag
// 2. Ensure `run_target` is also registered when using the deprecated experimental-tool flag
const { stdout: stdoutEnabled } = await runInspector(
'-E',
'run_target',
Expand All @@ -44,8 +44,6 @@ export default async function () {

// 3. Call run_target with build target
const { stdout: stdoutCall } = await runInspector(
'-E',
'run_target',
'--method',
'tools/call',
'--tool-name',
Expand All @@ -66,8 +64,6 @@ export default async function () {
// 4. Call run_target with test target (only for esbuild/Vite test runner, as webpack-based Karma fails on this bazel CI headless runner)
if (esbuild) {
const { stdout: stdoutTestCall } = await runInspector(
'-E',
'run_target',
'--method',
'tools/call',
'--tool-name',
Expand Down
Loading