Skip to content

[Feature]: Add support for an MCP server package type #10461

@joelverhagen

Description

@joelverhagen

Related Problem

It is technically possible today to package an MCP server as a NuGet package.

However this has a couple of problems:

  1. These are just CLI tools on NuGet.org so they aren't discoverable as MCP servers.
    • This can be solved by defining a package type for MCP server packages.
  2. Single-shot execution is not supported first class in .NET SDK.

We can implement the UI changes on NuGet.org behind a feature flag/flight for internal testing until single shot execution is supported. Or we can use the npx-dntx for now.

If VS Code supports microsoft/vscode#249370, then we could perhaps avoid the single-shot command requirement, but I'm not sure.

The Elevator Pitch

First, define a package type for MCP server (work with .NET MCP folks for this), McpServer. In .NET 10, this can be added to the existing DotnetTool package type using <PackageType>MyCustomPackageType</Package>, via dotnet/sdk#48039. This is also possible with <= .NET 9 with an MSBuild workaround mentioned here: NuGet/Home#14220.

Second, make package details page aware of it.

Image

To enrich the command palette (copy-pastable JSON), we will read a server.json from the root of the .nupkg which describes the parameters used to start the tool. The schema of server.json is defined by the MCP registry (shape, sample).

Third, make the search experience recognize the type, so this does not appear:
https://www.nuget.org/packages?packagetype=McpServer

Image

Finally, or (once there is a sufficient "seed" of MCP servers on NuGet.org), make it an option in the package type filter:
Image

Additional Context and Details

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions