diff --git a/omnara/sdk/async_client.py b/omnara/sdk/async_client.py index 454e808..28df347 100644 --- a/omnara/sdk/async_client.py +++ b/omnara/sdk/async_client.py @@ -1,10 +1,12 @@ """Async client for interacting with the Omnara Agent Dashboard API.""" import asyncio +import ssl from typing import Optional, Dict, Any from urllib.parse import urljoin import aiohttp +import certifi from aiohttp import ClientTimeout from .exceptions import AuthenticationError, TimeoutError, APIError @@ -54,8 +56,14 @@ class AsyncOmnaraClient: async def _ensure_session(self): """Ensure aiohttp session exists.""" if self.session is None or self.session.closed: + # Create SSL context using certifi's certificate bundle + # This fixes SSL verification issues with aiohttp on some systems + ssl_context = ssl.create_default_context(cafile=certifi.where()) + self.session = aiohttp.ClientSession( - headers=self.headers, timeout=self.timeout + headers=self.headers, + timeout=self.timeout, + connector=aiohttp.TCPConnector(ssl=ssl_context) ) async def close(self): diff --git a/pyproject.toml b/pyproject.toml index a9ed7a2..8242601 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ "requests>=2.25.0", "urllib3>=1.26.0", "aiohttp>=3.8.0", + "certifi>=2020.6.20", "fastmcp==2.9.2", "fastapi>=0.100.0", "uvicorn>=0.20.0", diff --git a/servers/mcp_server/stdio_server.py b/servers/mcp_server/stdio_server.py index 0c3b8c0..1affb6a 100644 --- a/servers/mcp_server/stdio_server.py +++ b/servers/mcp_server/stdio_server.py @@ -37,8 +37,10 @@ def get_client() -> AsyncOmnaraClient: return client -# Create FastMCP server -mcp = FastMCP("Omnara Agent Dashboard MCP Server") +# Create FastMCP server and metadata +mcp = FastMCP( + "Omnara Agent Dashboard MCP Server", +) @mcp.tool(name="log_step", description=LOG_STEP_DESCRIPTION)