Skip to content

Commit ee54acb

Browse files
johnbikesihrpr
andauthored
The lifespan_context object here is not a dictionary like the other e… (#1002)
Co-authored-by: ihrpr <[email protected]>
1 parent b2d4322 commit ee54acb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ mcp = FastMCP("My App", lifespan=app_lifespan)
204204
def query_db() -> str:
205205
"""Tool that uses initialized resources"""
206206
ctx = mcp.get_context()
207-
db = ctx.request_context.lifespan_context["db"]
207+
db = ctx.request_context.lifespan_context.db
208208
return db.query()
209209
```
210210

0 commit comments

Comments
 (0)