chore: add logging for MCPClient initialization
Browse files
src/unpredictable_lord/chat/mcp_client.py
CHANGED
|
@@ -5,12 +5,15 @@ to communicate with the Gradio MCP server.
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
import functools
|
|
|
|
| 8 |
|
| 9 |
from mcp import ClientSession
|
| 10 |
from mcp.client.streamable_http import streamablehttp_client
|
| 11 |
|
| 12 |
from unpredictable_lord.settings import MCP_SERVER_URL
|
| 13 |
|
|
|
|
|
|
|
| 14 |
|
| 15 |
class MCPClient:
|
| 16 |
"""MCP Client using Streamable HTTP transport."""
|
|
@@ -23,6 +26,7 @@ class MCPClient:
|
|
| 23 |
token: Optional authentication token.
|
| 24 |
"""
|
| 25 |
self.url = url or MCP_SERVER_URL
|
|
|
|
| 26 |
self.token = token
|
| 27 |
|
| 28 |
@staticmethod
|
|
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
import functools
|
| 8 |
+
import logging
|
| 9 |
|
| 10 |
from mcp import ClientSession
|
| 11 |
from mcp.client.streamable_http import streamablehttp_client
|
| 12 |
|
| 13 |
from unpredictable_lord.settings import MCP_SERVER_URL
|
| 14 |
|
| 15 |
+
logger = logging.getLogger(__name__)
|
| 16 |
+
|
| 17 |
|
| 18 |
class MCPClient:
|
| 19 |
"""MCP Client using Streamable HTTP transport."""
|
|
|
|
| 26 |
token: Optional authentication token.
|
| 27 |
"""
|
| 28 |
self.url = url or MCP_SERVER_URL
|
| 29 |
+
logger.info(f"MCPClient initialized with URL: {self.url}")
|
| 30 |
self.token = token
|
| 31 |
|
| 32 |
@staticmethod
|