Skip to content

Decouple server.json formatting from VS Code core#1373

Merged
sandy081 merged 9 commits intomicrosoft:mainfrom
joelverhagen:jver/new-schema
Nov 11, 2025
Merged

Decouple server.json formatting from VS Code core#1373
sandy081 merged 9 commits intomicrosoft:mainfrom
joelverhagen:jver/new-schema

Conversation

@joelverhagen
Copy link
Contributor

@joelverhagen joelverhagen commented Oct 16, 2025

Improves on #1268.
Progress on microsoft/vscode#266097.
Pair to microsoft/vscode#271770.

This pushes the server.json -> runtime config mapping to the chat extension. Code is duplicated to decouple the components, based on @sandy081's recommendation.

@joelverhagen joelverhagen changed the title [DRAFT] Move server.json formatting to VS Code core [DRAFT] Decouple server.json formatting from VS Code core Oct 21, 2025
@joelverhagen joelverhagen changed the title [DRAFT] Decouple server.json formatting from VS Code core Decouple server.json formatting from VS Code core Oct 21, 2025
@joelverhagen joelverhagen marked this pull request as ready for review October 21, 2025 19:00
Copilot AI review requested due to automatic review settings October 21, 2025 19:00
Copy link
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 decouples the server.json formatting logic from VS Code core by duplicating the mapping code in the chat extension. The changes enable the extension to independently transform server.json manifests into runtime MCP server configurations without depending on VS Code's internal implementation.

Key Changes:

  • New mapping utilities and types copied from VS Code core for independent server.json processing
  • Updated NuGet package handling to use extension-owned schema constants and simplified manifest preparation
  • Modified command handling to use the new mapping layer instead of directly relying on VS Code types

Reviewed Changes

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

Show a summary per file
File Description
src/extension/mcp/vscode-node/util.ts Added mapServerJsonToMcpServer function to map server.json to MCP server configuration using new mapping utilities
src/extension/mcp/vscode-node/nuget.ts Simplified manifest preparation by removing metadata wrapping logic and schema URL handling, delegating to mapping layer
src/extension/mcp/vscode-node/mapping/mcpPlatformTypes.ts New file defining platform types for MCP server configurations (copied from VS Code core)
src/extension/mcp/vscode-node/mapping/mcpManagementService.ts New file implementing mapping utility to convert gallery manifests to runtime configurations (copied from VS Code core)
src/extension/mcp/vscode-node/mapping/mcpManagement.ts New file defining types for MCP server management and gallery configurations (copied from VS Code core)
src/extension/mcp/vscode-node/mapping/mcpGalleryService.ts New file implementing schema version serializers for different server.json formats (copied from VS Code core)
src/extension/mcp/vscode-node/commands.ts Updated to use new mapping layer, changed configuration types from "vscode"/"server.json" to "assisted"/"mapped"
src/extension/mcp/test/vscode-node/util.spec.ts New test file for mapServerJsonToMcpServer function covering different schema versions
src/extension/mcp/test/vscode-node/nuget.stub.spec.ts Updated test expectations to reflect simplified manifest structure without metadata wrapping
src/extension/mcp/test/vscode-node/mapping/mcpManagementService.spec.ts Comprehensive test suite for mapping service (copied from VS Code core, refactored for vitest)

Copy link
Member

@sandy081 sandy081 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. LGTM

@sandy081 sandy081 enabled auto-merge November 11, 2025 15:56
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 11, 2025
@sandy081 sandy081 added this pull request to the merge queue Nov 11, 2025
Merged via the queue into microsoft:main with commit 344000f Nov 11, 2025
6 checks passed
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.

5 participants