You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: units/en/unit1/mcp-clients.mdx
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ For local servers using stdio transport, the configuration includes the command
90
90
"transport": {
91
91
"type": "stdio",
92
92
"command": "python",
93
-
"args": ["/path/to/file_explorer_server.py"]
93
+
"args": ["/path/to/file_explorer_server.py"]// This is an example, we'll use a real server in the next unit
94
94
}
95
95
}
96
96
]
@@ -237,26 +237,32 @@ Tiny Agent can run MCP servers with a command line environment. To do this, we w
237
237
238
238
Let's install `npx` with `npm`. If you don't have `npm` installed, check out the [npm documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
239
239
240
+
### Setup
241
+
242
+
First, we will need to install `npx` if you don't have it installed. You can do this with the following command:
243
+
240
244
```bash
241
245
# install npx
242
246
npm install -g npx
243
247
```
244
248
245
-
<hfoptionsid="language">
246
-
<hfoptionid="python">
247
-
248
-
First, install the tiny agents package:
249
+
Then, we will need to install the huggingface_hub package with the MCP support. This will allow us to run MCP servers and clients.
249
250
250
251
```bash
251
252
pip install "huggingface_hub[mcp]>=0.32.0"
252
253
```
253
254
254
-
First, let's login to the Hugging Face Hub. You will need a [login token](https://huggingface.co/docs/huggingface_hub/v0.32.3/en/quick-start#authentication) to do this.
255
+
Then, we will need to log in to the Hugging Face Hub to access the MCP servers. You can do this with the `huggingface-cli` command line tool. You will need a [login token](https://huggingface.co/docs/huggingface_hub/v0.32.3/en/quick-start#authentication) to do this.
255
256
256
257
```bash
257
258
huggingface-cli login
258
259
```
259
260
261
+
<hfoptionsid="language">
262
+
<hfoptionid="python">
263
+
264
+
### Connecting to MCP Servers
265
+
260
266
Now, let's create an agent configuration file `agent.json`.
261
267
262
268
```json
@@ -291,6 +297,8 @@ First, install the tiny agents package with [npm](https://docs.npmjs.com/downloa
291
297
npm install @huggingface/tiny-agents
292
298
```
293
299
300
+
### Connecting to MCP Servers
301
+
294
302
Make an agent project directory and create an `agent.json` file.
Copy file name to clipboardExpand all lines: units/en/unit2/gradio-client.mdx
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,38 @@ We'll connect to the MCP server we created in the previous section and use it to
12
12
13
13
## MCP Client in Gradio
14
14
15
-
First, we need to install the `smolagents`, gradio and mcp-client libraries, if we haven't already:
15
+
### Connect to an example MCP Server
16
+
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.
0 commit comments