← Back to browse

Knapcode.SampleMcpServer

Indexed by com.joelverhagen.mcp

About

A sample MCP server using the MCP C# SDK. Generates random numbers and random weather.

Use this server

Add it to your MCP client. The catalogue lists this config verbatim from its source — it does not run, download, or vouch for the server. Review the command before you run it.

Transportstdio (runs a local command)
Env varsWEATHER_CHOICES
Claude Code
claude mcp add --env WEATHER_CHOICES= knapcode-samplemcpserver -- dnx Knapcode.SampleMcpServer
Cursor

Add to Cursor

If the button doesn't open Cursor, use the JSON below — Cursor accepts the same mcpServers config.

VS Code
code --add-mcp '{"name":"knapcode-samplemcpserver","command":"dnx","args":["Knapcode.SampleMcpServer"],"env":{"WEATHER_CHOICES":""}}'
JSON
{
  "mcpServers": {
    "knapcode-samplemcpserver": {
      "command": "dnx",
      "args": [
        "Knapcode.SampleMcpServer"
      ],
      "env": {
        "WEATHER_CHOICES": ""
      }
    }
  }
}

Environment variables are listed by name only — fill in your own values. Entries never carry secrets.