SampleMcpServer 0.1.0-beta

This is a prerelease version of SampleMcpServer.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.

                    
dotnet tool install --global SampleMcpServer --version 0.1.0-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 SampleMcpServer --version 0.1.0-beta
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SampleMcpServer&version=0.1.0-beta&prerelease
                    
nuke :add-package SampleMcpServer --version 0.1.0-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

Using the MCP Server in VS Code

Once the MCP server package is published to NuGet.org, you can use the following VS Code with 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": {
      "my-custom-mcp": {
        "type": "stdio",
        "command": "dotnet",
        "args": [
          "tool",
          "exec",
          "<your package ID here>",
          "--version",
          "<your package version here>",
          "--yes",
          "--",
          "start-mcp"
        ],
        "env": {
          "MAX_RANDOM_NUMBER": 100
        }
      }
    }
  }
}

Now you can ask Copilot chat for a random number, for example Give me 3 random numbers. It should prompt to use the GetRandomNumber tool on the my-custom-mcp MCP server and show you the results.

Developing locally

To test this MCP server from source code (locally) without using a built MCP server package, use the following VS Code configuration:

{
  "mcp": {
    "servers": {
      "my-custom-mcp": {
        "type": "stdio",
        "command": "dotnet",
        "args": [
          "run",
          "--project",
          "<PATH TO PROJECT DIRECTORY>",
          "--",
          "start-mcp"
        ],
        "env": {
          "MAX_RANDOM_NUMBER": 100
        }
      }
    }
  }
}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated