Skip to content

fix(mcp): stop get_doc aliases from serving the wrong doc - #1904

Merged
kdinev merged 3 commits into
masterfrom
fix/mcp-get-doc-aliases
Nov 19, 2026
Merged

kdinev merged 3 commits into
masterfrom
fix/mcp-get-doc-aliases

Conversation

@dkalinovInfra

Copy link
Copy Markdown
Contributor

Description

Found while sanity-checking the MCP server in the published igniteui-cli@16.0.0.

The get_doc alias table still mapped combo names to a doc called overview. Since the documentation database was rebuilt on the igniteui-documentation layout, overview is the Themes page and the Combo doc is combo-overview. The alias was applied before the exact name was tried, and no "closest match" note was shown.

Request (16.0.0) Returned
React combo, combo-box, IgrCombo Themes overview
React combo-overview (the doc's exact name) Themes overview, so the React Combo doc was unreachable
Web Components combo, IgcComboComponent Themes overview
Blazor combo, IgbCombo Themes overview
virtual-scroll in Angular, React, Web Components Grid virtualization, hiding the real Virtual Scroll doc

Changes in src/tools/doc-tools.ts:

  • resolveDoc tries the requested name first and uses the alias only when no doc has that name.
  • combo, combo-box, combobox point to combo-overview in every framework; Angular gains the bare combo alias.
  • Removed the React combo-overview alias and the virtual-scroll alias for Angular, React and Web Components. Blazor keeps virtual-scroll, as it has no Virtual Scroll doc.
  • Repointed aliases whose targets no longer exist: React themes/theme → overview, theming-grid → grid-theming (React, Web Components, Blazor), Angular radio-group → radio and range-slider → slider-slider. These already landed on the right doc through the search fallback, but with a "closest match" note.

Related Issue

None filed.

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

The root npm run test and npm run lint were not run. What was run:

  • npx vitest run in packages/igniteui-mcp/igniteui-doc-mcp: 21 files, 484 tests pass.
  • npx tsc --noEmit in the same package: clean.
  • The rebuilt server over stdio: the requests in the table above now return the Combo and Virtual Scroll docs, and the repointed aliases resolve without the "closest match" note.

New tests in src/__tests__/tools/doc-tools.test.ts:

  • Against the bundled db/igniteui-docs.db: every alias points to an existing doc, and no alias renames an existing doc. This would have failed when the database was rebuilt.
  • Combo names resolve to the doc titled "Combo" in each framework.
  • An exact doc name is served even when an alias exists for it; the alias is used otherwise.

Remote mode goes through the same resolveDoc, so it now also asks the backend for the exact name first. That was not exercised against a remote backend.

CHANGELOG.md is not updated, as its top section is the released 16.0.0. Suggested line for the next patch release:

* **fix(mcp):** get_doc no longer returns the Themes overview for combo names (combo, IgrCombo, IgbCombo, IgcComboComponent) or grid virtualization for virtual-scroll; an exact doc name now takes precedence over an alias.

🤖 Generated with Claude Code

The alias table still mapped combo names to a doc called "overview".
Since the documentation database was rebuilt, that name belongs to the
Themes page, so get_doc returned Themes for combo, IgrCombo, IgbCombo
and IgcComboComponent, and the React combo-overview doc was unreachable.
The virtual-scroll alias also hid the real Virtual Scroll doc.

An exact doc name now wins over an alias, and the aliases point to the
current doc names. A test checks every alias against the bundled
database.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 15:32

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.

🟡 Changes recommended

The tool description and README still advertise virtual-scroll as a grid-virtualization alias, directing Angular, React, and Web Components clients to the wrong component’s documentation.

1 open issue
What changed in this PR

This PR corrects document lookup in the Ignite UI MCP server so get_doc aliases no longer override exact document names or route Combo requests to Themes documentation.

Changes:

  • Try normalized document names before falling back to aliases.
  • Correct outdated alias targets and remove Virtual Scroll aliases where standalone documentation exists.
  • Add database-backed alias checks and regression tests for exact-name precedence and Combo resolution.
File Description
packages/​igniteui-mcp/​igniteui-doc-mcp/​src/​tools/​doc-tools.ts Corrects alias mappings and prioritizes exact document names.
packages/​igniteui-mcp/​igniteui-doc-mcp/​src/​__tests__/​tools/​doc-tools.test.ts Validates aliases against the bundled database and tests lookup precedence.

Review effort: Balanced

@coveralls

coveralls commented Nov 18, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 95.657%. remained the same — fix/mcp-get-doc-aliases into master

kdinev
kdinev previously approved these changes Nov 18, 2026
React, Angular and Web Components have a Virtual Scroll doc, so the
"-ing" form resolves there instead of grid-virtualization. The get_doc
description and README no longer advertise the removed
virtual-scroll alias.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

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

No active review issues remain, with the exact-name resolution fix supported by regression tests and bundled-database validation.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@kdinev
kdinev enabled auto-merge (squash) November 19, 2026 09:01
@kdinev
kdinev merged commit 9890a93 into master Nov 19, 2026
4 checks passed
@kdinev
kdinev deleted the fix/mcp-get-doc-aliases branch November 19, 2026 09:05
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.

4 participants