Skip to content

feat(mcp): add provar-nitrox-component-catalog bundled MCP resource#150

Merged
mrdailey99 merged 6 commits into
developfrom
feature/nitrox-component-catalog-resource
May 7, 2026
Merged

feat(mcp): add provar-nitrox-component-catalog bundled MCP resource#150
mrdailey99 merged 6 commits into
developfrom
feature/nitrox-component-catalog-resource

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

Summary

  • Adds provar://nitrox/component-catalog as a bundled MCP resource — catalog of all 9 shipped NitroX (Hybrid Model) base component packages, compiled into the package at build time (same pattern as provar-step-reference)
  • Updates provar_nitrox_generate tool description to prompt agents to read the catalog before generating
  • Adds scripts/generate-nitrox-catalog.cjs — maintainer script to regenerate the catalog when Provar ships updated NitroX packages
  • Documents the new resource in docs/mcp.md and adds MCP Inspector setup to docs/development.md
  • Bumps version to 1.5.0-beta.17

Details

The catalog is a static Markdown file (docs/NITROX_COMPONENT_CATALOG.md, ~2000 lines) committed to the repo and copied to lib/mcp/docs/ at compile time via wireit. The MCP resource reads it via readFileSync at runtime — no dependency on ~/Provar/.nitroX/ on the end-user's machine.

To regenerate when Provar ships new NitroX packages:

node scripts/generate-nitrox-catalog.cjs
# then commit docs/NITROX_COMPONENT_CATALOG.md

Test plan

  • yarn test:only — 895 passing (up from 894; new test asserts provar_nitrox_generate description references the catalog resource)
  • yarn compile — TypeScript clean, lib/mcp/docs/NITROX_COMPONENT_CATALOG.md present in output
  • MCP Inspector: read provar://nitrox/component-catalog resource — returns full Markdown catalog
  • provar_nitrox_generate description in MCP Inspector includes reference to provar-nitrox-component-catalog

🤖 Generated with Claude Code

mrdailey99 and others added 4 commits May 7, 2026 15:08
Adds a bundled static MCP resource at provar://nitrox/component-catalog that catalogs
all 9 shipped NitroX (Hybrid Model) base component packages. Also documents MCP Inspector
setup in docs/development.md.

RCA: The NitroX generate tool had no reference material to guide component generation — agents had to guess naming conventions, type strings, tagNames, and interaction patterns. Additionally no guidance existed for interactive MCP testing via the MCP Inspector.
Fix: Bundle a static catalog of all shipped NitroX packages (generated from local installation, committed to docs/) and register it as a readable MCP resource, mirroring the provar-step-reference pattern. Add MCP Inspector setup guide including port-in-use resolution steps to docs/development.md.

Changes:
- docs/NITROX_COMPONENT_CATALOG.md: committed static catalog (~2000 lines) across common,
  html5, salesforce-lwc, screenflow, experienceCloud, omnistudio, runtimeOmnistudio,
  msdynamics, and vlocityIns packages
- package.json: compile step copies catalog to lib/mcp/docs/; added to wireit files inputs
- src/mcp/server.ts: registers new resource via readFileSync — no runtime dependency on
  local Provar installation
- src/mcp/tools/nitroXTools.ts: provar_nitrox_generate description references the catalog
- scripts/generate-nitrox-catalog.cjs: dev utility to regenerate when packages update
- docs/development.md: MCP Inspector setup guide with port-cleanup commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…og resource

RCA: No assertions verified the generate tool description mentions the
component catalog resource, leaving a gap if the reference was accidentally removed.
Fix: Add MockMcpServer.registrations capture and a describe block that asserts
provar_nitrox_generate description includes provar-nitrox-component-catalog.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RCA: The MCP Resources section in docs/mcp.md still described only one resource
after adding the NitroX component catalog, leaving documentation incomplete.
Fix: Add catalog resource entry to ToC and Resources section; add tip to
NitroX section recommending agents read the catalog before calling generate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RCA: Version bump required on any PR that triggers a publish; this PR adds
the provar-nitrox-component-catalog MCP resource (new user-visible feature).
Fix: Increment beta suffix from 16 to 17 in package.json and server.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 7, 2026 20:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Quality Orchestrator

🟢 LOW · 4 / 100 · All changed files have mapped tests.


🧪 Tests to Run · Running 2 of 41 tests

  • unit/mcp/server.test.ts
  • unit/mcp/nitroXTools.test.ts
▶ Run command
npx playwright test \
  unit/mcp/server.test.ts \
  unit/mcp/nitroXTools.test.ts

⚡ quality-orchestrator  ·  @qo stub <file>  ·  @qo why?  ·  @qo run all

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

Adds a new bundled MCP documentation resource (provar://nitrox/component-catalog) that exposes a compiled-in Markdown catalog of shipped NitroX base component packages, and updates NitroX generation guidance/docs accordingly.

Changes:

  • Register a new MCP resource (provar://nitrox/component-catalog) served from bundled markdown copied into lib/mcp/docs/ at build time.
  • Update provar_nitrox_generate tool description and add a unit test asserting the description references the new catalog resource.
  • Add a maintainer script to regenerate the catalog markdown and update docs/development with MCP Inspector instructions; bump versions to 1.5.0-beta.17.

Reviewed changes

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

Show a summary per file
File Description
test/unit/mcp/nitroXTools.test.ts Extends the mock server to capture tool descriptions and adds an assertion that provar_nitrox_generate references the catalog.
src/mcp/tools/nitroXTools.ts Updates provar_nitrox_generate description to instruct reading the component catalog first.
src/mcp/server.ts Registers the new provar://nitrox/component-catalog MCP resource backed by bundled markdown.
server.json Bumps published MCP server metadata version to 1.5.0-beta.17.
scripts/generate-nitrox-catalog.cjs Adds a developer utility to regenerate docs/NITROX_COMPONENT_CATALOG.md from local NitroX package extraction.
package.json Bumps package version and updates the wireit compile step to copy the new catalog into lib/mcp/docs/.
docs/NITROX_COMPONENT_CATALOG.md Adds the generated NitroX component package catalog markdown content.
docs/mcp.md Documents the new resource and updates guidance to read it before using provar_nitrox_generate.
docs/development.md Adds MCP Inspector setup instructions and improves table formatting.

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

Comment thread src/mcp/server.ts Outdated
Comment on lines +108 to +112
const docsDir = join(dirname(fileURLToPath(import.meta.url)), 'docs');

server.resource(
'provar-nitrox-component-catalog',
'provar://nitrox/component-catalog',
Comment thread docs/development.md
Comment on lines +307 to +309
# Compile first, then launch the Inspector against the dev server
npm run compile
npx @modelcontextprotocol/inspector node bin/dev.js provar mcp start --allowed-paths /absolute/path/to/your/provar/project
mrdailey99 and others added 2 commits May 7, 2026 15:29
RCA: ESLint @typescript-eslint/member-ordering requires public fields before
private fields; the initial test commit had the order reversed, causing CI lint failure.
Fix: Move public registrations declaration above private handlers field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…piled modes

RCA: In dev/ts-node mode the sibling lib/mcp/docs/ path doesn't exist, so both
MCP resources (nitrox-component-catalog and step-reference) always fell through
to the "Catalog not found" fallback text, making them unusable during development.
Fix: Extract resolveDocsDir() that probes the sibling docs/ dir and falls back
to repo-root docs/ when absent; add server.test.ts covering both branches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrdailey99 mrdailey99 merged commit 35facc3 into develop May 7, 2026
4 checks passed
@mrdailey99 mrdailey99 deleted the feature/nitrox-component-catalog-resource branch May 12, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants