captain-awesome commited on
Commit
2abf61d
·
verified ·
1 Parent(s): 6a73182

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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
- server_parameters=StdioServerParameters(
11
- url="https://captain-awesome-alquranchapters.hf.space/gradio_api/mcp/sse"
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()