Move config validation to top-level

This commit is contained in:
Anibal Angulo
2026-02-22 16:34:24 +00:00
parent bd107a027a
commit b92a5d5b0e

View File

@@ -310,8 +310,6 @@ class AppContext:
@asynccontextmanager @asynccontextmanager
async def lifespan(_server: FastMCP) -> AsyncIterator[AppContext]: async def lifespan(_server: FastMCP) -> AsyncIterator[AppContext]:
"""Create and configure the vector-search client for the server lifetime.""" """Create and configure the vector-search client for the server lifetime."""
cfg = Settings.model_validate({})
vs = GoogleCloudVectorSearch( vs = GoogleCloudVectorSearch(
project_id=cfg.project_id, project_id=cfg.project_id,
location=cfg.location, location=cfg.location,
@@ -349,6 +347,7 @@ def _parse_args() -> argparse.Namespace:
_args = _parse_args() _args = _parse_args()
cfg = Settings.model_validate({})
mcp = FastMCP( mcp = FastMCP(
"knowledge-search", "knowledge-search",