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}" } } } }
.vscode/mcp.json
settings file.
dotnet tool install --global OKtol.WeatherMcpServer --version 0.1.5
dotnet new tool-manifest
dotnet tool install --local OKtol.WeatherMcpServer --version 0.1.5
#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
- .NET 10.0 SDK
- Free openweathermap.org account
Using the MCP Server from NuGet.org
Package name: OKtol.WeatherMcpServer
Search for MCP server package on NuGet.org and select it from the list.
View the package details and copy the JSON from the "MCP Server" tab.
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:
- VS Code:
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}" } } } }
Save the file.
Click
Restart
button in this file.In GitHub Copilot, select the Select tools icon to verify your
WeatherMcpServer
is available with the tools listed.
Using the MCP Server locally
Clone the repository:
git clone <repository_url>
Navigate to the project directory:
cd dotnet-test-assignment/WeatherMcpServer
Build the project:
dotnet build
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" } }
You can run the server manually:
dotnet run --project WeatherMcpServer
Or test it with MCP Inspector:
npx @modelcontextprotocol/inspector
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 | Versions 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. |
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 |