feat: agent-agnostic MCP config — add Cursor support, remove hardcoded template files#1674
Draft
Copilot wants to merge 3 commits intocopilot/update-ai-config-agent-agnosticfrom
Draft
Conversation
…remove hardcoded template files Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/7a391e28-8cf3-4d80-ab1a-66f2e40b9c66 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/7a391e28-8cf3-4d80-ab1a-66f2e40b9c66 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extend MCP configuration for multiple AI tools
feat: agent-agnostic MCP config — add Cursor support, remove hardcoded template files
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mcp-config.tsonly handled VS Code's.vscode/mcp.json. This PR makes MCP configuration agent-aware (matching the skills/instructions approach from #1664) and removes the staticmcp.jsonfiles from project templates.Core changes
mcp-config.tsaddMcpServers()gains an optionalserversKeyparam (default"servers") to handle differing root keys per toolAI_AGENT_MCP_CONFIGSmap — associates agent targets with their project-level MCP config path and root key:configureMcpForAgents(agents, additionalServers?)— always writes.vscode/mcp.jsonas the VS Code baseline, additionally writes.cursor/mcp.json(withmcpServerskey) whencursoris in the agents listCURSOR_MCP_PATHalongside the existingVS_CODE_MCP_PATHCall-site updates
ai-config.ts: removesconfigureMCP(),configure()now callsconfigureMcpForAgents(agents)ng-schematics/cli-config/index.ts:aiConfig()usesconfigureMcpForAgents(agents, angularCliServer)— writes cursor config when cursor is selectedPromptSession.ts:configureAI()usesconfigureMcpForAgents([])Template cleanup
Deleted hardcoded
__dot__vscode/mcp.jsonfrom all three project templates (angular/react/webcomponents) — these are now generated dynamically by theconfigure()flow. Empty__dot__vscodedirs in react and webcomponents templates removed too.Tests
ai-config-spec.ts: migrated fromconfigureMCPtoconfigureMcpForAgents; added cursor-specific assertions (two writes, correct paths,mcpServersroot key)PromptSession-spec.ts: spy updated tomcpConfigModule.configureMcpForAgentsvia leaf-module requireng-schematics/index_spec.ts: new test verifies.cursor/mcp.jsonis created withmcpServerskey when cursor agent is selectedWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.google-analytics.com/usr/local/bin/node node packages/cli/bin/execute.js new --help de_modules/.bin/tsx(dns block)/usr/local/bin/node node packages/cli/bin/execute.js config --help(dns block)/usr/local/bin/node node packages/cli/bin/execute.js generate --help ui/m��(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Context
PR #1664 (
copilot/update-ai-config-agent-agnosticbranch) madeig ai-configagent-agnostic for skills and instruction files. However, the MCP server configuration inpackages/core/util/mcp-config.tsstill only handles VS Code's.vscode/mcp.json. The hardcoded__dot__vscode/mcp.jsonfiles also still exist in project templates.This PR should extend the MCP configuration logic to support multiple AI tools and remove the static template files.
Requirements
1. Extend
mcp-config.tsto support agent-specific MCP config paths and formatsBased on the
mcp-setup.mdreference file (atpackages/igx-templates/igx-ts/projects/ai-config/skills/igniteui-angular-theming/references/mcp-setup.md), different tools use different MCP config files and JSON structures:.vscode/mcp.jsonservers.cursor/mcp.jsonmcpServersClaude Desktop and WebStorm/JetBrains use global config files (not project-level), so they should NOT be auto-configured by the CLI.
Add to
mcp-config.ts:AI_AGENT_MCP_CONFIGSmapping fromAIAgentTargetto{ path: string; serversKey: string }(only for agents that use project-level MCP config files: currentlyvscode-equivalent targets andcursor).configureMcpForAgents(agents: AIAgentTarget[], additionalServers?: Record<string, McpServerEntry>): voidfunction that:.vscode/mcp.json(withserverskey) since VS Code is the baseline.cursor/mcp.json(withmcpServerskey) ifcursoris in the agents listaddMcpServerslogic internally, but adapted to handle the different root keys (serversvsmcpServers)addMcpServersto accept an optionalserversKeyparameter (default"servers") so it can handle bothserversandmcpServersroot keys.2. Remove hardcoded
__dot__vscode/mcp.jsonfrom ALL project templatesDelete these files (they will now be generated dynamically by the
configure()flow):packages/igx-templates/igx-ts/projects/_base/files/__dot__vscode/mcp.jsonpackages/cli/templates/react/igr-ts/projects/_base/files/__dot__vscode/mcp.jsonpackages/cli/templates/webcomponents/igc-ts/projects/_base/files/__dot__vscode/mcp.jsonIf the
__dot__vscodedirectories become empty after removingmcp.json, remove the directories too.3. Update
configure()inpackages/cli/lib/commands/ai-config.tsReplace the
configureMCP()call (which only does VS Code) with the newconfigureMcpForAgents(agents, ...)call. The angular-cli additional server should be passed when the project framework is angular.4. Update schematics in
packages/ng-schematics/src/cli-config/index.tsThe
aiConfig()function currently callsaddMcpServers(VS_CODE_MCP_PATH, angularCliServer)directly. Update it to use the newconfigureMcpForAgents(agents, angularCliServer)function instead, so the MCP config is also written to.cursor/mcp.jsonwhen cursor is selected.5. Update the
configure()call inpackages/cli/lib/PromptSession.tsThe
configureAI()method currently callsconfigureMCP(). It should use the new agent-aware MCP configuration. The PromptSession already collects the agents list instart()- pass it through or use the new function.Also in
start(), afterprocess.chdir(projectName), theconfigure(agents)call should handle MCP config for the selected agents.6. Adjust/add tests
spec/unit/ai-config-spec.ts: Update tests to verify MCP is configured for selected agents (not just VS Code)spec/unit/ai-skills-spec.tsor a newspec/unit/mcp-config-spec.ts: Add tests for:configureMcpForAgentswrites.vscode/mcp.jsonalwaysconfigureMcpForAgentswrites.cursor/mcp.jsonwhen cursor is in agents.cursor/mcp.jsonusesmcpServersas root key (notservers)addMcpServerswith customserversKeyparameterconfigureMCP()to use the new patternKey implementation notes
addMcpServersfunction signature should become:addMcpServers(mcpFilePath: string, additionalServers?: Record<string, McpServerEntry>, serversKey?: string): booleanwhereserversKeydefaults to"servers".addMcpServers, use{ [serversKey]: servers }instead of{ servers }.parsed[serversKey] ?? {}instead ofparsed.servers ?? {}.[serversKey, key]path instead of["servers", key].configureMcpForAgentsfrom@igniteui/cli-corebarrel.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: The
ai-configcommand, shared logic and schematic now add both skills and agent instructions for the selected AI tool. There's al...This pull request was created from Copilot chat.