Update app.py
Browse files
app.py
CHANGED
|
@@ -7,9 +7,9 @@ from smolagents.mcp_client import MCPClient
|
|
| 7 |
# Initialize the MCP client correctly
|
| 8 |
try:
|
| 9 |
mcp_client = MCPClient(
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
)
|
| 14 |
|
| 15 |
tools = mcp_client.get_tools()
|
|
@@ -28,5 +28,6 @@ try:
|
|
| 28 |
|
| 29 |
finally:
|
| 30 |
# Properly close the MCP client connection
|
| 31 |
-
if 'mcp_client' in locals():
|
| 32 |
-
mcp_client.disconnect()
|
|
|
|
|
|
| 7 |
# Initialize the MCP client correctly
|
| 8 |
try:
|
| 9 |
mcp_client = MCPClient(
|
| 10 |
+
## Try this working example on the hub:
|
| 11 |
+
# {"url": "https://abidlabs-mcp-tools.hf.space/gradio_api/mcp/sse"}
|
| 12 |
+
{"url": "http://localhost:7860/gradio_api/mcp/sse"}
|
| 13 |
)
|
| 14 |
|
| 15 |
tools = mcp_client.get_tools()
|
|
|
|
| 28 |
|
| 29 |
finally:
|
| 30 |
# Properly close the MCP client connection
|
| 31 |
+
# if 'mcp_client' in locals():
|
| 32 |
+
# mcp_client.disconnect()
|
| 33 |
+
mcp_client.disconnect()
|