diff --git a/mcpgateway/main.py b/mcpgateway/main.py index 684c5ac33..e31e7152c 100644 --- a/mcpgateway/main.py +++ b/mcpgateway/main.py @@ -183,6 +183,7 @@ async def lifespan(_app: FastAPI) -> AsyncIterator[None]: if plugin_manager: await plugin_manager.initialize() logger.info(f"Plugin manager initialized with {plugin_manager.plugin_count} plugins") + await tool_service.initialize() await resource_service.initialize() await prompt_service.initialize() diff --git a/mcpgateway/utils/verify_credentials.py b/mcpgateway/utils/verify_credentials.py index 4944f828a..078f273c4 100644 --- a/mcpgateway/utils/verify_credentials.py +++ b/mcpgateway/utils/verify_credentials.py @@ -97,8 +97,8 @@ async def verify_jwt_token(token: str) -> dict: True Test expired token: - >>> import datetime - >>> expired_payload = {'sub': 'bob', 'exp': datetime.datetime.utcnow() - datetime.timedelta(hours=1)} + >>> from datetime import datetime, timezone, timedelta + >>> expired_payload = {'sub': 'bob', 'exp': datetime.now(timezone.utc) - timedelta(hours=1)} >>> expired_token = jwt.encode(expired_payload, 'secret', algorithm='HS256') >>> try: ... asyncio.run(vc.verify_jwt_token(expired_token))