refactor: improve lifespan context typing and documentation

- Add proper generic parameter for lifespan context type
- Update README with TypedDict example for strong typing
- Fix context variable initialization in server
- Improve property return type safety
- Remove redundant documentation
- Ensure compatibility with existing tests
This commit is contained in:
David Soria Parra
2025-02-12 22:12:09 +00:00
parent fddba00723
commit 4d3e05f6f6
4 changed files with 22 additions and 16 deletions

View File

@@ -100,7 +100,7 @@ class Settings(BaseSettings, Generic[LifespanResultT]):
lifespan: (
Callable[["FastMCP"], AbstractAsyncContextManager[LifespanResultT]] | None
) = Field(None, description="Lifespan contexte manager")
) = Field(None, description="Lifespan context manager")
def lifespan_wrapper(