FastMCP City Weather Resource Template Example
A teaching resource template for testing city-parameterized MCP reads and JSON responses, using fixed demonstration weather rather than live forecasts.
About this listing
This example in FastMCP's official resources guide registers weather://{city}/current. The city parameter is passed to a Python handler, which capitalizes the supplied city name and returns a JSON string containing the city, temperature, condition and unit.
The weather values are fixed demonstration data: 22 degrees Celsius and Sunny. It does not retrieve forecasts or connect to a weather provider. The component is useful for learning parameter-to-handler mapping and checking that an MCP client can read a templated resource and interpret its JSON content. It is a documentation example to run in your own server, not a hosted weather endpoint.
Free refers to the Apache-2.0-licensed FastMCP code and example. Separately selected clients, models and hosting can incur costs. This is an original explanatory summary, not a reproduction of the implementation.