Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

fix smart_home example: HueAttributes schema and deprecated prefix (#2818)

nate nowackaea8f3b0dca1
diff --git a/examples/smart_home/src/smart_home/hub.py b/examples/smart_home/src/smart_home/hub.py
index 09fd3dd84..1840327bd 100644
--- a/examples/smart_home/src/smart_home/hub.py
+++ b/examples/smart_home/src/smart_home/hub.py
@@ -7,8 +7,8 @@ from smart_home.settings import settings
hub_mcp = FastMCP("Smart Home Hub (phue2)")
-# Mount the lights service under the 'hue' prefix
-hub_mcp.mount(lights_mcp, prefix="hue")
+# Mount the lights service under the 'hue' namespace
+hub_mcp.mount(lights_mcp, namespace="hue")
# Add a status check for the hub
diff --git a/examples/smart_home/src/smart_home/lights/server.py b/examples/smart_home/src/smart_home/lights/server.py
index cbe615a51..db4c41a6a 100644
--- a/examples/smart_home/src/smart_home/lights/server.py
+++ b/examples/smart_home/src/smart_home/lights/server.py
@@ -22,6 +22,16 @@ class HueAttributes(TypedDict, total=False):
on: NotRequired[Annotated[bool, Field(description="on/off state")]]
bri: NotRequired[Annotated[int, Field(ge=0, le=254, description="brightness")]]
hue: NotRequired[
+ Annotated[
+ int,
+ Field(
+ ge=0,
+ le=65535,
+ description="hue (color wheel position)",
+ ),
+ ]
+ ]
+ sat: NotRequired[
Annotated[
int,
Field(