Support server.json being returned by assisted MCP install #259634
Merged
+65
−16
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.
This works around the lack of #259100 and is progress on #257679. There will be a separate PR on the chat extension to support server.json in NuGet packages.
It enhances the
github.copilot.chat.mcp.setup.flowcommand to have an additionaltypeproperty. When this type property is set to"server.json", the result is treated as an MCP Registry server.json and mapped to the VS Code configuration format. If thetypeproperty is falsey set or set to"vscode", the existing codepath is used.Additionally, I updated the
toScannedMcpServerAndInputsto be a public static method so it can be called after thegithub.copilot.chat.mcp.setup.flowcommand returns.I noticed the resulting
argsandenvplaceholder values had the format{input:foo}, instead of format${input:foo}. Based on https://code.visualstudio.com/docs/reference/variables-reference#_input-variables, it seems like this was a bug in the original implementation, but I may be wrong. @sandy081 - could you confirm?Verified with:
@azure/mcp(old flow, no server.json)mcp-server-fetch(old flow, no server.json)mcp/node-code-sandbox(old flow, no server.json)NuGet.Mcp.Server(new flow),Knacode.SampleMcpServer(new flow, this one has an input)