FortisPotensSapiens/mcp_dotnet_csharp
If you are the rightful owner of mcp_dotnet_csharp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a comprehensive overview of a .NET 9 MCP server designed for weather forecasting applications.
Maz Weather MCP Server
Developing locally
To test this MCP server from source code (locally) without using a built MCP server package, you can configure your IDE to run the project directly using dotnet run
.
- VS Code: Create a
<WORKSPACE DIRECTORY>/.vscode/mcp.json
file - Visual Studio: Create a
<SOLUTION DIRECTORY>\.mcp.json
file
For both VS Code and Visual Studio, the configuration file uses the following server definition:
{
"servers": {
"WeatherMcp": {
"type": "stdio",
"command": "dotnet",
"args": [
"run",
"--environment",
"WeatherMcpConfiguration__ApiKey=<OpenWeatherMap API Key>",
"--project",
"WeatherMcp"
]
}
}
}
Testing the MCP Server
Once configured, you can ask Copilot Chat for a weather, for example, What is the weather like in Moscow?
. It should prompt you to use the get_current_weather
tool on the WeatherMcp
MCP server and show you the results. Use agent tools to interact with the MCP server.
Using the MCP Server from NuGet.org
Once the MCP server package is published to NuGet.org, you can configure it in your preferred IDE. Both VS Code and Visual Studio use the dnx
command to download and install the MCP server package from NuGet.org.
- VS Code: Create a
<WORKSPACE DIRECTORY>/.vscode/mcp.json
file - Visual Studio: Create a
<SOLUTION DIRECTORY>\.mcp.json
file
For both VS Code and Visual Studio, the configuration file uses the following server definition:
{
"servers": {
"MazWeatherMcp": {
"type": "stdio",
"command": "dnx",
"args": [
"MazWeatherMcp",
"--version",
"1.0.0",
"--yes"
],
"env": {
"WeatherMcpConfiguration__ApiKey": "<OpenWeatherMap API Key>"
}
}
}
}
Architecture
The project uses a standard hexagonal architecture. Primary adapters are used to invoke our logic from external sources. Secondary adapters are used to call external data sources or generate random data, such as HttpClients and Repositories. In the domain, we have our entities and pure, effect-free functions.