Skip to content

fix(mcp): start the docs server from @igniteui/mcp-server in ai-config - #1870

Merged
kdinev merged 6 commits into
masterfrom
ipetrov/mcp-server-ai-config-entry
Nov 5, 2026
Merged

kdinev merged 6 commits into
masterfrom
ipetrov/mcp-server-ai-config-entry

Conversation

@ivanvpetrov

@ivanvpetrov ivanvpetrov commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1864.
This PR changes the entry ig ai-config writes (part 1); Part 2 is already solved with #1871.

Description

ig ai-config wrote npx -y igniteui-cli mcp, which downloads the whole CLI (140 MB) to run the docs server and starts it as a second process. Cold starts took about 16 s alone and 24 s when sessions start together, close to the 30 s timeout of common MCP clients.

  • ai-config (and the Angular ai-config schematic) now writes npx -y @igniteui/mcp-server: about 8 s cold, one Node process fewer, and a stale global igniteui-cli is no longer picked up.
  • Projects whose package.json lists igniteui-cli keep npx -y igniteui-cli mcp. In a pnpm project, npx finds @igniteui/mcp-server as a transitive dependency but pnpm doesn't link its bin, so the server package can't start there (verified: 'igniteui-mcp' is not recognized). These projects already start from the local copy without a download, and perf(cli): start the MCP server in-process before the CLI loads #1871 brings that path close to the speed of starting the server package directly. Schematic ng new projects list @igniteui/angular-schematics instead and get the new entry.
  • The key stays igniteui-cli, so re-running ai-config updates existing configs instead of adding a second server. It now updates only command and args, so user-added fields such as env survive, and it no longer rewrites a file whose values are unchanged.
  • The MCP server reports its package version in serverInfo instead of a hard-coded 1.0.0.
  • resolvePackage and getUpgradeablePackages handle a package.json without dependencies. Before, every ig command, ig mcp included, crashed in such folders.
  • README and the MCP Specification show the new entry and note the cold-start cost, global install and pinning.

Existing projects get the new entry when they re-run ig ai-config.

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)
  • @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

Follow-up: #1871 handles ig mcp before the CLI loads and runs the server in the same process, with no CLI parent and no child process (the second point of #1864). This halves the warm start of ig mcp, including the npx -y igniteui-cli mcp entry kept for projects that list igniteui-cli, and sends the "Different igniteui-cli global and local version" notice to stderr. The two PRs touch different files and can merge in either order.

The skill files and documentation pages in the framework and documentation repos still show npx -y igniteui-cli mcp and need the same change there. Until then, an agent that follows a skill's MCP setup step after a slow first start may write the old entry back over the new one.

ai-config now writes `npx -y @igniteui/mcp-server` instead of
`npx -y igniteui-cli mcp`, except in projects that list igniteui-cli,
where pnpm can't start the server package directly. Re-running
ai-config updates only command and args, keeping user-added fields.

The server reports its real version in serverInfo, and resolvePackage
and getUpgradeablePackages no longer crash on a package.json without
a dependencies field.
@coveralls

coveralls commented Nov 2, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 95.379% (+0.01%) from 95.368% — ipetrov/mcp-server-ai-config-entry into master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues requiring changes to the standalone docs-server configuration update.

No open issues 🎉

What changed in this PR

This PR addresses #1864 by making ai-config launch the standalone docs server, reducing startup overhead while retaining the CLI-based command for projects that declare igniteui-cli.

Changes:

  • Defaults to npx -y @igniteui/mcp-server, preserves user-added configuration fields, and avoids rewriting unchanged configurations.
  • Reports the server’s package version and handles package manifests without dependencies.
  • Updates configuration documentation and regression tests for CLI and Angular schematic workflows.
File Description
spec/​unit/​packageResolve-spec.ts Tests package resolution without a dependencies field.
spec/​unit/​ai-config-spec.ts Tests command selection, configuration migration, field preservation, and unchanged-file handling.
README.md Documents the new command, CLI fallback, and startup alternatives.
packages/​ng-schematics/​src/​ng-new/​index_spec.ts Updates the expected server command for generated Angular projects.
packages/​ng-schematics/​src/​cli-config/​index_spec.ts Tests the standalone command and project-local CLI fallback.
packages/​igniteui-mcp/​Specification.md Updates MCP configuration examples to use the standalone package.
packages/​igniteui-mcp/​igniteui-doc-mcp/​src/​index.ts Reports the package version in server metadata.
packages/​core/​util/​mcp-config.ts Selects the launch command and updates configuration fields without replacing entire entries.
packages/​core/​update/​package-resolve.ts Defaults missing dependencies to an empty object.

Review effort: Balanced

@ivanvpetrov
ivanvpetrov marked this pull request as ready for review November 2, 2026 08:59
@kdinev
kdinev removed the request for review from radomirchev November 5, 2026 08:46
@kdinev
kdinev enabled auto-merge (squash) November 5, 2026 09:55
@kdinev
kdinev merged commit d5b98ee into master Nov 5, 2026
4 checks passed
@kdinev
kdinev deleted the ipetrov/mcp-server-ai-config-entry branch November 5, 2026 09:59
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.

MCP: the npx -y igniteui-cli mcp entry written by ai-config is the slowest way to start the server

4 participants