Decouple server.json formatting from VS Code core#1373
Merged
sandy081 merged 9 commits intomicrosoft:mainfrom Nov 11, 2025
Merged
Decouple server.json formatting from VS Code core#1373sandy081 merged 9 commits intomicrosoft:mainfrom
sandy081 merged 9 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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) |
sandy081
requested changes
Oct 24, 2025
sandy081
approved these changes
Nov 11, 2025
Member
sandy081
left a comment
There was a problem hiding this comment.
Thanks for the changes. LGTM
bpasero
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.