Skip to content

[NuGet MCP] Use the server.json inside the .nupkg if available instead of the README (AI-assisted MCP) #257679

@joelverhagen

Description

@joelverhagen

NuGet MCP server packages contain a .mcp/server.json file in the artifact. This can be used to further enhance the AI-assisted workflow for MCP server installation, since more context is available.

npm, Python, and Docker use an AI loop to get the MCP client configuration from the README. NuGet does this too, but could be even better by using the server.json, if present.

Suggested workflow:

  1. Search for the package on NuGet.org as we do today: https://github.com/microsoft/vscode-copilot-chat/blob/d755e97b1e7dbd389eb87ccda5479d089cf37715/src/extension/mcp/vscode-node/commands.ts#L208-L257
  2. If the package as an McpServer package type, and after the user says "yes" to the install prompt, install the tool to a temporary directory using dotnet tool install --tool-path.
  3. Look in this temp directory for the .mcp/server.json
  4. If found, use the IMcpServerManifest and associated mapping code to reliably construct a client MCP configuration JSON.
    • I think this code needs to become accessible to the Copilot extension, perhaps by lifting some function or types to index.d.ts?
  5. Clean up the temporary directory

This flow will "prime" the NuGet package cache so the subsequent dnx execution is very fast.

Using the server.json info which is better than guessing from the README.

The NuGet-specific code here should be moved out into its own module since it will get bigger.
https://github.com/microsoft/vscode-copilot-chat/blob/d755e97b1e7dbd389eb87ccda5479d089cf37715/src/extension/mcp/vscode-node/commands.ts#L208-L257

Open questions:

  • How should the server.json to mcp.json mapping code be made available to the Copilot extension?
  • What is the recommended way to run shell commands (dotnet tool install) in the background, with a temp directory, and reliable cleanup?
  • Should the server.json handling still use the LLM tool calling loop? I think no, since this can be more like a future MCP Registry acquisition flow using a server.json instead of needing AI to handle schema-less README.md.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions