{"record":{"id":"3626df58ec0b5093","repo":"angular/angular-cli","slug":"skipping-angular-mcp-server-configuration-for-t","errorCode":null,"errorMessage":"Skipping Angular MCP server configuration for '${toolName}'.\nConfiguration already exists in '${path}'.\n","messagePattern":"Skipping Angular MCP server configuration for '(.+?)'\\.\nConfiguration already exists in '(.+?)'\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/schematics/angular/ai-config/file_utils.ts","lineNumber":98,"sourceCode":"      filter((path) => path.includes('__tomlConfigName__')),\n      applyTemplates({\n        ...strings,\n        tomlConfigName: name,\n      }),\n      move(directory),\n      forEach((file) => {\n        if (!tree.exists(file.path)) {\n          return file;\n        }\n\n        const existingFileBuffer = tree.read(file.path);\n\n        if (existingFileBuffer) {\n          let existing = existingFileBuffer.toString();\n          if (existing.includes(TOML_MCP_SERVERS_PROP)) {\n            const path = `${directory}/${name}`;\n            const toolName = strings.classify(tool);\n            context.logger.warn(\n              `Skipping Angular MCP server configuration for '${toolName}'.\\n` +\n                `Configuration already exists in '${path}'.\\n`,\n            );\n\n            return null;\n          }\n\n          // Add the configuration at the end of the file.\n          const template = file.content.toString();\n          existing = existing.length ? existing + '\\n\\n' + template : template;\n\n          tree.overwrite(file.path, existing);\n\n          return null;\n        }\n\n        return file;\n      }),","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/ai-config/file_utils.ts#L80-L116","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["No action required — the existing MCP configuration is kept; verify it contains the expected Angular MCP server entry.","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.","Regenerate the file entirely (rename the existing file) and re-run the schematic.","Use npx @angular/cli@latest to ensure you are generating the latest recommended configuration."],"exampleFix":"# before\n# ~/.codex/config.toml already contains [mcp_servers.angular]\n$ ng g config ai-config --tool codex\n# -> skipped warning\n# after (manual edit to regenerate)\n# remove the [mcp_servers.angular] table, then:\n$ ng g config ai-config --tool codex","handlingStrategy":"validation","validationCode":"const existing = tree.exists(tomlPath) ? tree.read(tomlPath)!.toString('utf8') : '';\nconst hasMcpBlock = existing.includes('mcp_servers');\nif (!hasMcpBlock) { /* safe to run ai-config schematic */ }","typeGuard":"function isTomlMcpConfigured(content: string): boolean {\n  return /\\[?mcp_servers\\b/.test(content);\n}","tryCatchPattern":null,"preventionTips":["Check the tool's TOML config for an existing mcp_servers section before re-running ai-config.","Keep generated AI config files out of template repos, or commit them deliberately to avoid re-runs.","Re-run the schematic only after intentionally deleting the MCP block you want regenerated."],"tags":["angular","schematics","mcp","ai-config","toml","idempotency"],"backgroundTag":"config-already-exists","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}