Skip to content

fix(cli): update mcp sdk - #196

Merged
coryrylan merged 2 commits into
mainfrom
topic-mcp-sdk-update
Jul 28, 2026
Merged

fix(cli): update mcp sdk#196
coryrylan merged 2 commits into
mainfrom
topic-mcp-sdk-update

Conversation

@coryrylan

@coryrylan coryrylan commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator
  • Updated the package dependency in package.json and pnpm-lock.yaml.
  • Modified the NOTICE.md and README.md files to reflect the new server package.
  • Adjusted the MCP server implementation in index.ts to utilize the new server API.
  • Updated tests to ensure compatibility with the new server structure.

Summary by CodeRabbit

  • New Features
    • Enhanced MCP tool/prompt schema handling with Zod validation and standardized tool outputs.
    • Added MCP progress notifications during tool execution.
  • Bug Fixes
    • Improved MCP stdio error handling for more reliable failures.
    • Updated website sitemap generation rules to exclude non-indexable pages such as DESIGN.md.
  • Documentation
    • Refreshed CLI MCP entry guidance and examples, and added an MCP Registry link.
    • Updated site MCP documentation snippet language and added a links section.
  • Chores
    • Refreshed bundled third-party notices and aligned Model Context Protocol package versions.

Copilot AI review requested due to automatic review settings July 28, 2026 20:22
@coryrylan coryrylan self-assigned this Jul 28, 2026
@coryrylan
coryrylan requested review from johnyanarella and removed request for Copilot July 28, 2026 20:22
@github-actions github-actions Bot added scope(ci) scope(cli) dependencies Pull requests that update a dependency file labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: fa7f9dae-d4e6-409f-8c9b-b5e45bd08e17

📥 Commits

Reviewing files that changed from the base of the PR and between 7102625 and f1ba540.

📒 Files selected for processing (3)
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts
  • projects/site/src/docs/mcp/index.md

📝 Walkthrough

Walkthrough

The CLI migrates to @modelcontextprotocol/server v2.0.0, updates MCP registration and stdio handling, and revises related tests and documentation. Sitemap generation now excludes non-page files such as DESIGN.md.

Changes

MCP server migration

Layer / File(s) Summary
MCP API registration and schemas
projects/cli/package.json, projects/cli/src/mcp/index.ts, projects/cli/DEVELOPMENT.md, projects/cli/README.md, NOTICE.md, projects/cli/NOTICE.md, projects/site/src/docs/mcp/index.md
The CLI adopts MCP server and inspector v2.0.0, updates schema conversion, tool and prompt registration, progress notifications, documentation, and notices.
Stdio serving and validation
projects/cli/src/mcp/index.ts, projects/cli/src/mcp/index.test.ts
startMcpServer now uses serveStdio with a server factory and error callback; tests cover request contexts, schemas, progress notifications, and stdio errors.

Sitemap filtering

Layer / File(s) Summary
Sitemap URL selection and validation
projects/site/src/_11ty/plugins/sitemap-xml.js, projects/site/src/_11ty/plugins/sitemap-xml.test.ts
Sitemap eligibility now requires page-like URL suffixes and excludes configured paths; sitemap generation uses publishable results without predefined file entries, including DESIGN.md.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant startMcpServer
  participant serveStdio
  participant ServerFactory
  participant ServerContext
  participant MCPRequest
  MCPClient->>startMcpServer: start MCP server
  startMcpServer->>serveStdio: provide server factory and onerror
  serveStdio->>ServerFactory: create MCP server
  MCPClient->>ServerContext: invoke registered tool
  ServerContext->>MCPRequest: read progressToken
  ServerContext->>MCPRequest: notify progress
Loading

Possibly related PRs

Suggested labels: type(fix)

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: updating the CLI's MCP dependency and related API usage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch topic-mcp-sdk-update

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

projects/site/src/_11ty/plugins/sitemap-xml.js

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

projects/site/src/_11ty/plugins/sitemap-xml.test.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
projects/cli/src/mcp/index.ts (1)

41-54: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Silently swallowed notify() failures make progress-reporting issues undebuggable.

.catch(() => undefined) discards any error from ctx.mcpReq.notify(...) with no trace. If the transport write fails, tool authors/operators get zero signal.

🔧 Proposed fix to log discarded notify errors
     ctx.mcpReq
       .notify({
         method: 'notifications/progress',
         params: { progressToken, progress: progressCount, message }
       })
-      .catch(() => undefined);
+      .catch(error => console.error('Failed to send progress notification:', error));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/cli/src/mcp/index.ts` around lines 41 - 54, Update attachProgress so
failures from ctx.mcpReq.notify are logged instead of silently discarded.
Preserve the existing progress notification behavior and catch handling, but
report the rejected error with sufficient context for diagnosing failed progress
updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@projects/cli/src/mcp/index.ts`:
- Around line 41-54: Update attachProgress so failures from ctx.mcpReq.notify
are logged instead of silently discarded. Preserve the existing progress
notification behavior and catch handling, but report the rejected error with
sufficient context for diagnosing failed progress updates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7cfd584b-d9fe-4c1d-88fd-bdb45fa3fd2a

📥 Commits

Reviewing files that changed from the base of the PR and between 3fcca0d and 4cfc643.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • NOTICE.md
  • projects/cli/DEVELOPMENT.md
  • projects/cli/NOTICE.md
  • projects/cli/README.md
  • projects/cli/package.json
  • projects/cli/src/mcp/index.test.ts
  • projects/cli/src/mcp/index.ts

- Updated the package dependency in package.json and pnpm-lock.yaml.
- Modified the NOTICE.md and README.md files to reflect the new server package.
- Adjusted the MCP server implementation in index.ts to utilize the new server API.
- Updated tests to ensure compatibility with the new server structure.

Signed-off-by: Cory Rylan <crylan@nvidia.com>
Copilot AI review requested due to automatic review settings July 28, 2026 21:44
@coryrylan
coryrylan force-pushed the topic-mcp-sdk-update branch from 4cfc643 to 7560ebe Compare July 28, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 22:06
@coryrylan
coryrylan force-pushed the topic-mcp-sdk-update branch from b65df51 to ea864cc Compare July 28, 2026 22:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/site/src/_11ty/plugins/sitemap-xml.test.ts`:
- Line 42: Update the sitemap test around renderSitemap() to include a
/DESIGN.md fixture in its input before asserting that the generated sitemap
excludes the corresponding URL. Keep the existing non-containment assertion,
ensuring it now verifies the implementation filters an actually provided
DESIGN.md entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: c14e6064-57ee-4fad-8ad1-dc616ddcdf1a

📥 Commits

Reviewing files that changed from the base of the PR and between 7560ebe and ea864cc.

📒 Files selected for processing (2)
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts

);
expect(sitemap).toContain('<loc>https://nvidia.github.io/elements/docs/about/support/</loc>');
expect(sitemap).toContain('<loc>https://nvidia.github.io/elements/DESIGN.md</loc>');
expect(sitemap).not.toContain('<loc>https://nvidia.github.io/elements/DESIGN.md</loc>');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Make the DESIGN.md exclusion assertion meaningful.

renderSitemap() never receives /DESIGN.md in this test, so this assertion passes regardless of whether the implementation includes that URL. Add a /DESIGN.md fixture, or move this into a dedicated test.

Proposed test fix
       {
         content: '<code>{"dateModified":"2026-07-25T00:00:00.000Z"}</code>',
         url: '/docs/about/support/'
+      },
+      {
+        content: '',
+        url: '/DESIGN.md'
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
expect(sitemap).not.toContain('<loc>https://nvidia.github.io/elements/DESIGN.md</loc>');
{
content: '<code>{"dateModified":"2026-07-25T00:00:00.000Z"}</code>',
url: '/docs/about/support/'
},
{
content: '',
url: '/DESIGN.md'
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/plugins/sitemap-xml.test.ts` at line 42, Update the
sitemap test around renderSitemap() to include a /DESIGN.md fixture in its input
before asserting that the generated sitemap excludes the corresponding URL. Keep
the existing non-containment assertion, ensuring it now verifies the
implementation filters an actually provided DESIGN.md entry.

Copilot AI review requested due to automatic review settings July 28, 2026 22:42
@coryrylan
coryrylan force-pushed the topic-mcp-sdk-update branch from ea864cc to 7102625 Compare July 28, 2026 22:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/site/src/docs/mcp/index.md`:
- Line 84: Change the code fence immediately preceding the Codex configuration
snippet in the MCP documentation from shell syntax highlighting to toml, leaving
the TOML content unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0a6d3053-ea9f-4caf-b299-9afaa1464421

📥 Commits

Reviewing files that changed from the base of the PR and between ea864cc and 7102625.

📒 Files selected for processing (3)
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts
  • projects/site/src/docs/mcp/index.md

Comment thread projects/site/src/docs/mcp/index.md
Signed-off-by: Cory Rylan <crylan@nvidia.com>
Copilot AI review requested due to automatic review settings July 28, 2026 22:56
@coryrylan
coryrylan force-pushed the topic-mcp-sdk-update branch from 7102625 to f1ba540 Compare July 28, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coryrylan
coryrylan merged commit 7c9f059 into main Jul 28, 2026
15 checks passed
@coryrylan
coryrylan deleted the topic-mcp-sdk-update branch July 28, 2026 23:14
@coryrylan

Copy link
Copy Markdown
Collaborator Author

🎉 This issue has been resolved in version 2.1.8 🎉

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file released scope(ci) scope(cli) scope(docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants