Skip to content

Commit 7cab2f9

Browse files
authored
Merge pull request #96 from m-dawoud/patch-3
Minor changes in text, URLs, and code comments, to make things less confusing
2 parents 5e9a549 + 958133c commit 7cab2f9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

units/en/unit2/gradio-client.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ Gradio is best suited to the creation of UI clients and MCP servers, but it is a
88

99
</Tip>
1010

11-
We'll connect to the MCP server we created in the previous section and use it to answer questions.
11+
We'll connect to an MCP server similar to the one we created in the previous section but with additional features, and use it to answer questions.
1212

1313
## MCP Client in Gradio
1414

1515
### Connect to an example MCP Server
1616

17-
Let's connect to an example MCP Server that is already running on Hugging Face. We'll use [this one](https://huggingface.co/spaces/abidlabs/mcp-tools2) for this example. It's a space that contains a collection of MCP tools.
17+
Let's connect to an example MCP Server that is already running on Hugging Face. We'll use [this one](https://huggingface.co/spaces/abidlabs/mcp-tool-http) for this example. It's a space that contains a collection of MCP tools.
1818

1919
```python
2020
from smolagents.mcp_client import MCPClient
2121

2222
with MCPClient(
23-
{"url": "https://abidlabs-mcp-tools2.hf.space/gradio_api/mcp/sse"}
23+
{"url": "https://abidlabs-mcp-tool-http.hf.space/gradio_api/mcp/sse"}
2424
) as tools:
2525
# Tools from the remote server are available
2626
print("\n".join(f"{t.name}: {t.description}" for t in tools))
@@ -39,9 +39,9 @@ sepia: Apply a sepia filter to the input image.
3939
</pre>
4040
</details>
4141

42-
### Connect to your MCP Server from Gradio
42+
### Connect to the MCP Server from Gradio
4343

44-
Great, now that you've connected to an example MCP Server, let's connect to your own MCP Server from Gradio.
44+
Great, now that you've connected to an example MCP Server. Now, you need to use it in an example application.
4545

4646
First, we need to install the `smolagents`, Gradio and mcp-client libraries, if we haven't already:
4747

@@ -64,7 +64,7 @@ Next, we'll connect to the MCP Server and get the tools that we can use to answe
6464

6565
```python
6666
mcp_client = MCPClient(
67-
{"url": "http://localhost:7860/gradio_api/mcp/sse"} # This is the MCP Server we created in the previous section
67+
{"url": "https://abidlabs-mcp-tool-http.hf.space/gradio_api/mcp/sse"} # This is the MCP Client we created in the previous section
6868
)
6969
tools = mcp_client.get_tools()
7070
```
@@ -104,7 +104,7 @@ And that's it! We've created a simple Gradio interface that uses the MCP Client
104104

105105
## Complete Example
106106

107-
Here's the complete example of the MCP Client in Gradio:
107+
Here's the complete example of the usage of an MCP Client in Gradio:
108108

109109
```python
110110
import gradio as gr
@@ -115,7 +115,7 @@ from smolagents import InferenceClientModel, CodeAgent, MCPClient
115115

116116
try:
117117
mcp_client = MCPClient(
118-
{"url": "http://localhost:7860/gradio_api/mcp/sse"} # This is the MCP Server we created in the previous section
118+
{"url": "https://abidlabs-mcp-tool-http.hf.space/gradio_api/mcp/sse"}
119119
)
120120
tools = mcp_client.get_tools()
121121

@@ -152,7 +152,7 @@ To deploy your Gradio MCP client to Hugging Face Spaces:
152152

153153
```python
154154
mcp_client = MCPClient(
155-
{"url": "http://localhost:7860/gradio_api/mcp/sse"} # This is the MCP Server we created in the previous section
155+
{"url": "https://abidlabs-mcp-tool-http.hf.space/gradio_api/mcp/sse"}
156156
)
157157
```
158158

0 commit comments

Comments
 (0)