Knapcode2.SampleMcpServer 0.0.1-beta

This is a prerelease version of Knapcode2.SampleMcpServer.

                    
dotnet tool install --global Knapcode2.SampleMcpServer --version 0.0.1-beta
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Knapcode2.SampleMcpServer --version 0.0.1-beta
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Knapcode2.SampleMcpServer&version=0.0.1-beta&prerelease
                    
nuke :add-package Knapcode2.SampleMcpServer --version 0.0.1-beta
                    

MCP Server

This README was created using the .NET MCP server template project. It demonstrates how you can easily create an MCP server using .NET and then package it in a NuGet package.

See aka.ms/nuget/mcp/guide for the full guide.

Checklist before publishing to NuGet.org

  • Update package metadata in the .csproj file
  • Update the .mcp/server.json to declare your MCP server's inputs
  • Test the MCP server locally using the steps below

Developing locally

To test this MCP server from source code (locally) without using a built MCP server package, use the following MCP configuration in VS Code. See Use MCP servers in VS Code (Preview) for more information about using MCP servers in VS Code.

{
  "mcp": {
    "servers": {
      "my-custom-mcp": {
        "type": "stdio",
        "command": "dotnet",
        "args": [
          "run",
          "--project",
          "<PATH TO PROJECT DIRECTORY>",
          "--",
          "start-mcp"
        ],
        "env": {
          "MAX_RANDOM_NUMBER": 100
        }
      }
    }
  }
}

Then ask the Copilot chat for a random number. It should prompt to use the GetRandomNumber tool on the my-custom-mcp MCP server.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.0.1-beta 0 1/23/2026