rahulnamdev commited on
Commit
99ba107
·
verified ·
1 Parent(s): f22bb86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -4,8 +4,11 @@ from smolagents import InferenceClientModel, CodeAgent
4
  from smolagents.mcp_client import MCPClient
5
 
6
  # Use a 'with' block to ensure proper disconnection
7
- with MCPClient({"url": "https://abidlabs-mcp-tools.hf.space/gradio_api/mcp/sse", "transport": "sse"}) as mcp_client:
8
- # Fetch the available tools from the remote MCP server
 
 
 
9
  tools = mcp_client.get_tools()
10
 
11
  # Set up the agent with tools and a default language model
 
4
  from smolagents.mcp_client import MCPClient
5
 
6
  # Use a 'with' block to ensure proper disconnection
7
+ # Use 'with' for safe connection/disconnection
8
+ with MCPClient({
9
+ "url": "https://abidlabs-mcp-tools.hf.space", # Only the base URL
10
+ "transport": "sse" # Explicitly set transport
11
+ }) as mcp_client: # Fetch the available tools from the remote MCP server
12
  tools = mcp_client.get_tools()
13
 
14
  # Set up the agent with tools and a default language model