Update agents/mcp/mcp_client.py
Browse files- agents/mcp/mcp_client.py +4 -2
agents/mcp/mcp_client.py
CHANGED
|
@@ -2,13 +2,15 @@
|
|
| 2 |
|
| 3 |
# https://github.com/modelcontextprotocol/python-sdk
|
| 4 |
|
| 5 |
-
import anyio, asyncio
|
| 6 |
from mcp.client.sse import sse_client
|
| 7 |
from mcp.client.session import ClientSession, DEFAULT_CLIENT_INFO
|
| 8 |
|
| 9 |
# Chess position evaluation
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
MCP_TOOL_CHESS_POSITION_EVALUATION = "chess_position_evaluation"
|
| 13 |
|
| 14 |
async def call_mcp_tool_async(mcp_url: str, tool_name: str, arguments: dict, timeout: int = 5) -> str:
|
|
|
|
| 2 |
|
| 3 |
# https://github.com/modelcontextprotocol/python-sdk
|
| 4 |
|
| 5 |
+
import anyio, asyncio, os
|
| 6 |
from mcp.client.sse import sse_client
|
| 7 |
from mcp.client.session import ClientSession, DEFAULT_CLIENT_INFO
|
| 8 |
|
| 9 |
# Chess position evaluation
|
| 10 |
|
| 11 |
+
SPACE_CREATOR_USER_ID = os.getenv("SPACE_CREATOR_USER_ID", "bstraehle")
|
| 12 |
+
|
| 13 |
+
MCP_SSE_URL_CHESS_POSITION_EVALUATION = f"https://{SPACE_CREATOR_USER_ID}-chess.hf.space/gradio_api/mcp/sse"
|
| 14 |
MCP_TOOL_CHESS_POSITION_EVALUATION = "chess_position_evaluation"
|
| 15 |
|
| 16 |
async def call_mcp_tool_async(mcp_url: str, tool_name: str, arguments: dict, timeout: int = 5) -> str:
|