-
Notifications
You must be signed in to change notification settings - Fork 656
Description
Related Problem
It is technically possible today to package an MCP server as a NuGet package.
- Create a CLI tool project
- Use the https://github.com/modelcontextprotocol/csharp-sdk to implement it
- Pack it as a CLI tool nupkg
- Upload to NuGet.org
- Use it in VS Code using https://github.com/Redth/npx-dntx (until Support ephemeral execution for
dotnet tool runsimilar to npx, docker, and uv dotnet/sdk#47517 or Add a one-shot execution mode for .NET tools a la npx dotnet/sdk#31103) are implemented.
However this has a couple of problems:
- 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.
- Single-shot execution is not supported first class in .NET SDK.
- I think this will be solved for .NET 10 per Add a one-shot execution mode for .NET tools a la npx dotnet/sdk#31103 (milestone is set to
.NET 10 SDK backlog)
- I think this will be solved for .NET 10 per Add a one-shot execution mode for .NET tools a la npx dotnet/sdk#31103 (milestone is set to
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.
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
Finally, or (once there is a sufficient "seed" of MCP servers on NuGet.org), make it an option in the package type filter:

Additional Context and Details
- E2E experience spec
- Single-shot tool execution - available on .NET 10 preview 6 (July 8 ETA)
- NuGet.org experience (this issue)
- Ingest
server.jsonwhen PackageType =McpServer - Enrich package details page with VS Code mcp.json, mapped from
server.json - Add
McpServeras a recognized package type for package server
- Ingest
- Tutorial doc + blog
- .NET project template
- Add support for NuGet in MCP Registry
- Add support for NuGet MCP in VS Code
