Knapcode.SampleMcpServer.linux-musl-x64 0.7.0-beta

Prefix Reserved
This is a prerelease version of Knapcode.SampleMcpServer.linux-musl-x64.
dotnet add package Knapcode.SampleMcpServer.linux-musl-x64 --version 0.7.0-beta
                    
NuGet\Install-Package Knapcode.SampleMcpServer.linux-musl-x64 -Version 0.7.0-beta
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Knapcode.SampleMcpServer.linux-musl-x64" Version="0.7.0-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Knapcode.SampleMcpServer.linux-musl-x64" Version="0.7.0-beta" />
                    
Directory.Packages.props
<PackageReference Include="Knapcode.SampleMcpServer.linux-musl-x64" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Knapcode.SampleMcpServer.linux-musl-x64 --version 0.7.0-beta
                    
#r "nuget: Knapcode.SampleMcpServer.linux-musl-x64, 0.7.0-beta"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Knapcode.SampleMcpServer.linux-musl-x64@0.7.0-beta
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Knapcode.SampleMcpServer.linux-musl-x64&version=0.7.0-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Knapcode.SampleMcpServer.linux-musl-x64&version=0.7.0-beta&prerelease
                    
Install as a Cake Tool

MCP Server - Knapcode.SampleMcpServer

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

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

Checklist before publishing to NuGet.org

  • Test the MCP server locally using the steps below.
  • Update the package metadata in the .csproj file, in particular the <PackageId>.
  • Update .mcp/server.json to declare your MCP server's inputs.
  • Pack the project using dotnet pack.

The bin/Release directory will contain the package file (.nupkg), which can be published to NuGet.org.

Using the MCP Server in VS Code

Once the MCP server package is published to NuGet.org, you can use the following VS Code user configuration to download and install the MCP server package. See Use MCP servers in VS Code (Preview) for more information about using MCP servers in VS Code.

{
  "mcp": {
    "servers": {
      "Knapcode.SampleMcpServer": {
        "type": "stdio",
        "command": "dnx",
        "args": [
          "Knapcode.SampleMcpServer@0.4.0-beta",
          "--yes",
          "--",
          "mcp",
          "start"
        ],
        "env": {
          "WEATHER_CHOICES": "sunny,humid,freezing"
        }
      }
    }
  }
}

Now you can ask Copilot Chat for a random number, for example, Give me 3 random numbers. It should prompt you to use the get_random_number tool on the Knapcode.SampleMcpServer MCP server and show you the results.

Developing locally in VS Code

To test this MCP server from source code (locally) without using a built MCP server package, create a .vscode/mcp.json file (a VS Code workspace settings file) in your project directory and add the following configuration:

{
  "servers": {
    "Knapcode.SampleMcpServer": {
      "type": "stdio",
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "<RELATIVE PATH TO PROJECT DIRECTORY>",
        "--",
        "mcp",
        "start"
      ],
      "env": {
        "WEATHER_CHOICES": "sunny,humid,freezing"
      }
    }
  }
}

Alternatively, you can configure your VS Code user settings to use your local project:

{
  "mcp": {
    "servers": {
      "Knapcode.SampleMcpServer": {
        "type": "stdio",
        "command": "dotnet",
        "args": [
          "run",
          "--project",
          "<FULL PATH TO PROJECT DIRECTORY>"
          "--",
          "mcp",
          "start"
        ]
      },
      "env": {
        "WEATHER_CHOICES": "sunny,humid,freezing"
      }
    }
  }
}

MCP Registry verification

Used for https://github.com/modelcontextprotocol/registry/blob/main/docs/guides/publishing/publish-server.md

mcp-name: io.github.joelverhagen/Knapcode.SampleMcpServer
mcp-name: com.joelverhagen.mcp/Knapcode.SampleMcpServer
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0-beta 90 9/12/2025