forked from va/knowledge-search-mcp
Move config validation to top-level
This commit is contained in:
3
main.py
3
main.py
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user