angular/angular-cli · warning

Skipping Angular MCP server configuration for '${toolName}'.

Error message

Skipping Angular MCP server configuration for '${toolName}'.
Configuration already exists in '${path}'.

What it means

This is a warning logged by the Angular AI-config schematic's addTomlMcpConfig in packages/schematics/angular/ai-config/file_utils.ts when generating MCP server configuration for an AI tool (e.g. Codex/Claude). The library checks the existing TOML file for the TOML_MCP_SERVERS_PROP property and refuses to write a duplicate MCP servers block. It emits this warning and returns null (no changes) instead of appending, to avoid overwriting existing MCP configuration.

Source

Thrown at packages/schematics/angular/ai-config/file_utils.ts:98

      filter((path) => path.includes('__tomlConfigName__')),
      applyTemplates({
        ...strings,
        tomlConfigName: name,
      }),
      move(directory),
      forEach((file) => {
        if (!tree.exists(file.path)) {
          return file;
        }

        const existingFileBuffer = tree.read(file.path);

        if (existingFileBuffer) {
          let existing = existingFileBuffer.toString();
          if (existing.includes(TOML_MCP_SERVERS_PROP)) {
            const path = `${directory}/${name}`;
            const toolName = strings.classify(tool);
            context.logger.warn(
              `Skipping Angular MCP server configuration for '${toolName}'.\n` +
                `Configuration already exists in '${path}'.\n`,
            );

            return null;
          }

          // Add the configuration at the end of the file.
          const template = file.content.toString();
          existing = existing.length ? existing + '\n\n' + template : template;

          tree.overwrite(file.path, existing);

          return null;
        }

        return file;
      }),

View on GitHub (pinned to bb72145f9a)

Solutions

  1. No action required — the existing MCP configuration is kept; verify it contains the expected Angular MCP server entry.
  2. Delete or empty the MCP servers section in the existing TOML file and re-run the ai-config schematic if you want a fresh generated block.
  3. Regenerate the file entirely (rename the existing file) and re-run the schematic.
  4. Use npx @angular/cli@latest to ensure you are generating the latest recommended configuration.

Example fix

# before
# ~/.codex/config.toml already contains [mcp_servers.angular]
$ ng g config ai-config --tool codex
# -> skipped warning
# after (manual edit to regenerate)
# remove the [mcp_servers.angular] table, then:
$ ng g config ai-config --tool codex
Defensive patterns

Strategy: validation

Validate before calling

const existing = tree.exists(tomlPath) ? tree.read(tomlPath)!.toString('utf8') : '';
const hasMcpBlock = existing.includes('mcp_servers');
if (!hasMcpBlock) { /* safe to run ai-config schematic */ }

Type guard

function isTomlMcpConfigured(content: string): boolean {
  return /\[?mcp_servers\b/.test(content);
}

Prevention

When it happens

Trigger: Running `ng generate config ai-config` (or equivalent schematic) with a TOML-based AI tool whose config file already contains the MCP servers property (TOML_MCP_SERVERS_PROP); existingFileBuffer exists and includes TOML_MCP_SERVERS_PROP, so the handler short-circuits with a warning and returns null.

Common situations: Re-running the ai-config schematic after a previous successful run; migrating a project that already has Angular MCP server config added manually; switching tools and re-running while an old TOML config remains in the workspace.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/3626df58ec0b5093. Report an issue: GitHub.