From 4bddadeb646c8b4fb19dfc5a79abb5146ec50231 Mon Sep 17 00:00:00 2001 From: johnbikes <474683+johnbikes@users.noreply.github.com> Date: Sun, 22 Jun 2025 06:11:41 -0400 Subject: [PATCH] The lifespan_context object here is not a dictionary like the other example without a dataclass --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8a2db2b6..37ac01003 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ mcp = FastMCP("My App", lifespan=app_lifespan) def query_db() -> str: """Tool that uses initialized resources""" ctx = mcp.get_context() - db = ctx.request_context.lifespan_context["db"] + db = ctx.request_context.lifespan_context.db return db.query() ```