betki commited on
Commit
0716324
Β·
verified Β·
1 Parent(s): 862df24

Update mcp_client.py

Browse files
Files changed (1) hide show
  1. mcp_client.py +3 -3
mcp_client.py CHANGED
@@ -1,5 +1,5 @@
1
  """
2
- This is only a sample code snippet for a Gradio interface that connects to an MCP server. Server URL is set to local, it won't work on spaces.
3
 
4
  This script initializes a Gradio interface for an agent that uses tools from the MCP server.
5
  It connects to the MCP server, retrieves available tools, and sets up a chat interface where users can interact with the agent.
@@ -15,7 +15,7 @@ from smolagents import InferenceClientModel, CodeAgent, MCPClient
15
  try:
16
  mcp_client = MCPClient(
17
  {
18
- "url": "http://localhost:7860/gradio_api/mcp/sse",
19
  "transport": "sse"
20
  }
21
  )
@@ -29,7 +29,7 @@ try:
29
  fn=lambda message, history: str(agent.run(message)),
30
  type="messages",
31
  title="Agent with MCP Tools",
32
- description="This is a simple MCP Client build with Gradio that uses MCP tools.",
33
  )
34
 
35
  demo.launch()
 
1
  """
2
+ This is a Gradio MCP client that connects to my MCP server (mcp-rag-workflow).
3
 
4
  This script initializes a Gradio interface for an agent that uses tools from the MCP server.
5
  It connects to the MCP server, retrieves available tools, and sets up a chat interface where users can interact with the agent.
 
15
  try:
16
  mcp_client = MCPClient(
17
  {
18
+ "url": "https://agents-mcp-hackathon-mcp-rag-workflow.hf.space/gradio_api/mcp/sse",
19
  "transport": "sse"
20
  }
21
  )
 
29
  fn=lambda message, history: str(agent.run(message)),
30
  type="messages",
31
  title="Agent with MCP Tools",
32
+ description="MCP Client build with Gradio to use (mcp-rag-workflow) MCP tools.",
33
  )
34
 
35
  demo.launch()