@@ -67,6 +67,7 @@ Let's build your first MCP server in Python! We'll create a weather server that
6767 from datetime import datetime, timedelta
6868 from collections.abc import Sequence
6969 from functools import lru_cache
70+ from typing import Any
7071
7172 import requests
7273 import asyncio
@@ -78,7 +79,7 @@ Let's build your first MCP server in Python! We'll create a weather server that
7879 TextContent,
7980 ImageContent,
8081 EmbeddedResource,
81- LoggingLevel,
82+ LoggingLevel
8283 )
8384 from pydantic import AnyUrl
8485
@@ -94,13 +95,12 @@ Let's build your first MCP server in Python! We'll create a weather server that
9495 if not API_KEY :
9596 raise ValueError (" OPENWEATHER_API_KEY environment variable required" )
9697
97- API_BASE_URL = " http://api.openweathermap.org/data/2.5"
98- DEFAULT_CITY = " London"
99- CURRENT_WEATHER_ENDPOINT = " weather"
100- FORECAST_ENDPOINT = " forecast"
98+ API_BASE_URL = " http://api.openweathermap.org/data/2.5"
99+ DEFAULT_CITY = " London"
100+ CURRENT_WEATHER_ENDPOINT = " weather"
101+ FORECAST_ENDPOINT = " forecast"
101102
102- async def mcp_server ():
103- # our server implementation will go here
103+ # The rest of our server implementation will go here
104104 ```
105105 </Step >
106106
@@ -803,4 +803,4 @@ uv run pyright src
803803 <Card title = " Python SDK" icon = " python" href = " /api-reference/python/class-reference" >
804804 Read more about the Python SDK
805805 </Card >
806- </CardGroup >
806+ </CardGroup >
0 commit comments