OKtol.WeatherMcpServer 0.1.5

{
  "inputs": [
    {
      "type": "promptString",
      "id": "openweather_api_key",
      "description": "Api key from your https://api.openweathermap.org/ account.",
      "password": true
    }
  ],
  "servers": {
    "OKtol.WeatherMcpServer": {
      "type": "stdio",
      "command": "dnx",
      "args": ["OKtol.WeatherMcpServer@", "--yes"],
      "env": {
        "OpenWeatherOptions__BaseUrl": "https://api.openweathermap.org/",
        "OpenWeatherOptions__ApiKey": "${input:openweather_api_key}"
      }
    }
  }
}
                    
This package contains an MCP Server. The server can be used in VS Code by copying the generated JSON to your VS Code workspace's .vscode/mcp.json settings file.
dotnet tool install --global OKtol.WeatherMcpServer --version 0.1.5
                    
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 OKtol.WeatherMcpServer --version 0.1.5
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OKtol.WeatherMcpServer&version=0.1.5
                    
nuke :add-package OKtol.WeatherMcpServer --version 0.1.5
                    

Real Weather Mcp Server

This is a .NET 10 MCP Server that provides real-time weather data using WeatherAPI.com via the Model Context Protocol (MCP) standard.

It was created as part of the FastMCP assignment and showcases full integration with the .NET MCP Server framework, weather tooling, structured responses, and rich test coverage.

Prerequisites

Using the MCP Server from NuGet.org

Package name: OKtol.WeatherMcpServer

  1. Search for MCP server package on NuGet.org and select it from the list.

  2. View the package details and copy the JSON from the "MCP Server" tab.

  3. Create a mcp configuration file.

    • VS Code: <WORKSPACE DIRECTORY>/.vscode/mcp.json
    • Visual Studio: <SOLUTION DIRECTORY>\.mcp.json

    For both VS Code and Visual Studio, the configuration file uses the following server definition:

  4. In your mcp.json file in the .vscode folder, add the copied JSON, which looks like this:

    {
      "inputs": [
        {
          "type": "promptString",
          "id": "openweather_api_key",
          "description": "Api key from your https://api.openweathermap.org/ account.",
          "password": true
        }
      ],
      "servers": {
        "OKtol.WeatherMcpServer": {
          "type": "stdio",
          "command": "dnx",
          "args": ["OKtol.WeatherMcpServer@", "--yes"],
          "env": {
            "OpenWeatherOptions__BaseUrl": "https://api.openweathermap.org/",
            "OpenWeatherOptions__ApiKey": "${input:openweather_api_key}"
          }
        }
      }
    }
    
  5. Save the file.

  6. Click Restart button in this file.

  7. In GitHub Copilot, select the Select tools icon to verify your WeatherMcpServer is available with the tools listed.

Using the MCP Server locally

  1. Clone the repository:

    git clone <repository_url>
    
  2. Navigate to the project directory:

    cd dotnet-test-assignment/WeatherMcpServer
    
  3. Build the project:

    dotnet build
    
  4. Configuration:

    The API key must be provided via an environment variable:

    OpenWeatherOptions__ApiKey=your_actual_key_here
    

    You can either:

    • Set it globally: export OpenWeatherOptions__ApiKey=... (Linux/macOS) set OpenWeatherOptions__ApiKey=... (Windows)

    • Or use appsettings.json locally(recommended):

    {
      "OpenWeatherOptions": {
        "ApiKey": "your_actual_key_here"
      }
    }
    
  5. You can run the server manually:

    dotnet run --project WeatherMcpServer
    

    Or test it with MCP Inspector:

    npx @modelcontextprotocol/inspector
    
  6. In GitHub Copilot, select the Select tools icon to verify your WeatherMcpServer is available with the tools listed.

Testing the MCP Server

Once configured, you can ask Copilot Chat for a weather, for example, What is the current weather in London? #get_current_weather. It should prompt you to use the GetCurrentWeather tool on the WeatherMcpServer MCP server and show you the results.

More information

.NET MCP servers use the ModelContextProtocol C# SDK. For more information about MCP:

Refer to the VS Code or Visual Studio documentation for more information on configuring and using MCP servers:

👨‍💻 Author Built by OKtol Repo: https://github.com/OKtol/dotnet-test-assignment

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.1.5 91 8/13/2025
0.1.4 92 8/12/2025
0.1.3 167 8/6/2025
0.1.2 186 8/5/2025
0.1.1-beta 157 8/4/2025
0.1.0-beta 160 8/4/2025