Skip to content

refactor(ai-config): shared MCP server config logic w/ jsonc-parser#1648

Merged
damyanpetev merged 8 commits intomasterfrom
mstoyanova/jsonc-parser
Apr 21, 2026
Merged

refactor(ai-config): shared MCP server config logic w/ jsonc-parser#1648
damyanpetev merged 8 commits intomasterfrom
mstoyanova/jsonc-parser

Conversation

@Marina-L-Stoyanova
Copy link
Copy Markdown
Contributor

…or AI config handling

Description

Created util method that reads and modifies files with jsonc.

Related Issue

Closes #1646

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

Affected Packages

  • igniteui-cli (packages/cli)
  • [ x] @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

Additional Context

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Issue #1646 by preventing ai-config (CLI and Angular schematics) from overwriting existing .vscode/mcp.json content, instead merging Ignite UI MCP server entries into existing JSON/JSONC while preserving comments.

Changes:

  • Added a shared addMcpServers() utility (jsonc-based) and centralized IGNITEUI_MCP_SERVERS in @igniteui/cli-core.
  • Updated Angular schematics addAIConfig() to merge MCP servers into an existing .vscode/mcp.json (or create it when missing).
  • Updated CLI ai-config to use the shared jsonc-based merge logic; moved jsonc-parser dependency from ng-schematics to cli-core.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ng-schematics/src/cli-config/index.ts Switches MCP config handling to shared merge utility to avoid overwriting existing mcp.json.
packages/ng-schematics/package.json Removes direct jsonc-parser dependency (now provided by @igniteui/cli-core).
packages/core/util/index.ts Exports the new MCP config utility module.
packages/core/util/McpConfig.ts Introduces addMcpServers() and IGNITEUI_MCP_SERVERS shared constants.
packages/core/package.json Adds jsonc-parser dependency to @igniteui/cli-core.
packages/cli/lib/commands/ai-config.ts Uses shared MCP merge logic so existing mcp.json servers aren’t lost.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/util/mcp-config.ts
Comment thread packages/core/util/mcp-config.ts
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 21, 2026

Coverage Status

coverage: 86.296% (-0.04%) from 86.335% — mstoyanova/jsonc-parser into master

@damyanpetev damyanpetev changed the title feat: integrate MCP server configuration with jsonc-parser and refact… refactor(ai-config): shared MCP server config logic w/ jsonc-parser Apr 21, 2026
Comment thread packages/cli/lib/commands/ai-config.ts Outdated

if (!modified) {
Util.log(` Ignite UI MCP servers already configured in ${configPath}`);
Util.log(` Ignite UI MCP servers already configured`);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, my bad, bit overzealous with the moving of all consts to the core util. Still like the path here, so I'll revert it as an exported const and param

@damyanpetev damyanpetev force-pushed the mstoyanova/jsonc-parser branch from abb7b8a to ae8d4d1 Compare April 21, 2026 17:37
@damyanpetev damyanpetev force-pushed the mstoyanova/jsonc-parser branch from ae8d4d1 to b3bcd7d Compare April 21, 2026 17:40
@damyanpetev damyanpetev merged commit e5ccaa7 into master Apr 21, 2026
3 checks passed
@damyanpetev damyanpetev deleted the mstoyanova/jsonc-parser branch April 21, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ai-config rewrites mcp.json file if existing

5 participants