This is a test assignment for FastMCP.me - a service for creating and deploying MCP servers.
You are tasked with creating a Real Weather MCP Server using the new .NET MCP (Model Context Protocol) library.
Note: The use of AI development tools like Cursor, Claude Code, GitHub Copilot, and other AI IDEs is welcomed and encouraged for this assignment.
Your task is to create a functional MCP server that provides real weather data through AI assistants like Claude. The server should integrate with actual weather APIs and provide accurate, current weather information.
- Real Weather Data: Integrate with a real weather API (e.g., OpenWeatherMap, AccuWeather, or similar)
- Current Weather: Get current weather conditions for any city/location
- Weather Forecast: Provide weather forecasts (at least 3-day forecast)
- Multiple Locations: Support weather queries for different cities worldwide
- Error Handling: Proper error handling for invalid locations, API failures, etc.
- Use the .NET MCP Server library (
Microsoft.Extensions.AI.Abstractions
) - Implement proper MCP tools using
[McpServerTool]
attributes - Include environment variable configuration for API keys
- Follow .NET best practices and coding standards
- Include proper logging and error handling
GetCurrentWeather
- Get current weather for a specified locationGetWeatherForecast
- Get weather forecast for a specified locationGetWeatherAlerts
- Get weather alerts/warnings for a location (bonus)
- .NET 8.0 or later
- Weather API key (recommend OpenWeatherMap free tier)
-
Install the MCP server template:
dotnet new install Microsoft.Extensions.AI.Templates
-
The basic project structure is already provided in the
WeatherMcpServer
directory -
Get a free API key from a weather service provider
-
Configure your API key as an environment variable
[McpServerTool]
[Description("Gets current weather conditions for the specified city.")]
public async Task<string> GetCurrentWeather(
[Description("The city name to get weather for")] string city,
[Description("Optional: Country code (e.g., 'US', 'UK')")] string? countryCode = null)
{
// Your implementation here
}
Your solution will be evaluated on:
-
Functionality (40%)
- Does it work with real weather data?
- Are all required features implemented?
- How well does it handle edge cases?
-
Code Quality (30%)
- Clean, readable, and maintainable code
- Proper error handling and logging
- Following .NET conventions
-
MCP Integration (20%)
- Proper use of MCP server attributes and patterns
- Good tool descriptions and parameter definitions
- Correct server configuration
-
Documentation & Testing (10%)
- Clear documentation of setup and usage
- Basic testing of functionality
- API key configuration instructions
- MCP .NET Documentation
- MCP .NET Samples
- MCP Server Quickstart Blog
- OpenWeatherMap API (free tier available)
Please provide:
- Complete source code with proper project structure
- Instructions for setup and configuration
- Example usage or demo of the working server
- Brief documentation of your implementation approach
This assignment should take approximately 2-4 hours to complete, depending on your experience level.
Good luck! 🌤️