Skip to content

Conversation

@joelverhagen
Copy link
Contributor

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.flow command to have an additional type property. 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 the type property is falsey set or set to "vscode", the existing codepath is used.

Additionally, I updated the toScannedMcpServerAndInputs to be a public static method so it can be called after the github.copilot.chat.mcp.setup.flow command returns.

I noticed the resulting args and env placeholder 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:

  • npm: @azure/mcp (old flow, no server.json)
  • Python: mcp-server-fetch (old flow, no server.json)
  • Docker: mcp/node-code-sandbox (old flow, no server.json)
  • NuGet: NuGet.Mcp.Server (new flow), Knacode.SampleMcpServer (new flow, this one has an input)

@joelverhagen joelverhagen changed the title Support server.json being returned by assisted install Support server.json being returned by assisted MCP install Aug 4, 2025
@connor4312 connor4312 merged commit 3c25740 into microsoft:main Aug 12, 2025
17 checks passed
}

protected toScannedMcpServerAndInputs(manifest: IMcpServerManifest, packageType?: PackageType): { config: IMcpServerConfiguration; inputs?: IMcpServerVariable[] } {
static toScannedMcpServerAndInputs(manifest: IMcpServerManifest, packageType?: PackageType): { config: IMcpServerConfiguration; inputs?: IMcpServerVariable[] } {
Copy link
Member

Choose a reason for hiding this comment

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

@joelverhagen wondering why this is made public and static? This is an internal implementation of handling gallery mcp server installations. Now it is being reused for other installation flows which will make difficult to do any changes/enhancements for gallery installation flows.

Copy link
Member

Choose a reason for hiding this comment

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

Our general guideline is to use expose APIs(methods) on services instead of such static functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @sandy081, apologies that I didn't follow that guideline. I was looking for a way to perform the mapping from server.json to VS Code mcp.json and this seemed like the simplest way to get it done. It sounds like what you're saying is that this metho should be made public but not static, and some implementation of AbstractMcpResourceManagementService is injected via DI instead? Or am I misunderstanding?

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants