Spaces:
Running
Running
Commit
·
761215d
1
Parent(s):
da22b1c
how to use with mcp client
Browse files
README.md
CHANGED
@@ -12,7 +12,6 @@ short_description: 'This space defines a RAG MCP server '
|
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
14 |
|
15 |
-
|
16 |
# Rag MCP server
|
17 |
|
18 |
This is a simple gradio server that allows you to run a RAG (Retrieval-Augmented Generation) model using the
|
@@ -29,22 +28,59 @@ enable the search functionality. You can export it in your shell:
|
|
29 |
export SERPER_API_KEY=your_serper_api_key
|
30 |
```
|
31 |
|
32 |
-
|
33 |
# Installation
|
|
|
34 |
```bash
|
35 |
uv sync
|
36 |
```
|
37 |
|
38 |
# Usage
|
39 |
|
40 |
-
Just run the gradio application:
|
41 |
|
42 |
```bash
|
43 |
uv run gradio app.py
|
44 |
```
|
45 |
|
46 |
-
|
47 |
# Access the server
|
|
|
48 |
Open your browser and go to `http://localhost:7860` to access the RAG MCP server.
|
49 |
|
50 |
-
You can see the [gradio docs](https://www.gradio.app/guides/building-mcp-server-with-gradio) for more information on how
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
14 |
|
|
|
15 |
# Rag MCP server
|
16 |
|
17 |
This is a simple gradio server that allows you to run a RAG (Retrieval-Augmented Generation) model using the
|
|
|
28 |
export SERPER_API_KEY=your_serper_api_key
|
29 |
```
|
30 |
|
|
|
31 |
# Installation
|
32 |
+
|
33 |
```bash
|
34 |
uv sync
|
35 |
```
|
36 |
|
37 |
# Usage
|
38 |
|
39 |
+
Just run the gradio application:
|
40 |
|
41 |
```bash
|
42 |
uv run gradio app.py
|
43 |
```
|
44 |
|
|
|
45 |
# Access the server
|
46 |
+
|
47 |
Open your browser and go to `http://localhost:7860` to access the RAG MCP server.
|
48 |
|
49 |
+
You can see the [gradio docs](https://www.gradio.app/guides/building-mcp-server-with-gradio) for more information on how
|
50 |
+
to use the interface.
|
51 |
+
|
52 |
+
# Using the MCP server with a mpc client
|
53 |
+
|
54 |
+
You can use the tiny-agents client to interact with the MCP server. To do this, you need to install the huggingface_hub
|
55 |
+
package:
|
56 |
+
|
57 |
+
```bash
|
58 |
+
pip install huggingface_hub
|
59 |
+
```
|
60 |
+
|
61 |
+
Then, you can use the following code to interact with the MCP server:
|
62 |
+
|
63 |
+
```bash
|
64 |
+
export HF_TOKEN=your_huggingface_token
|
65 |
+
|
66 |
+
tiny_agents run agent.json
|
67 |
+
```
|
68 |
+
|
69 |
+
The `agent.json` file contains the configuration for the MCP client. Here is an example of how to create this file:
|
70 |
+
|
71 |
+
```json
|
72 |
+
{
|
73 |
+
"model": "meta-llama/Llama-3.3-70B-Instruct",
|
74 |
+
"provider": "cerebras",
|
75 |
+
"servers": [
|
76 |
+
{
|
77 |
+
"type": "sse",
|
78 |
+
"config": {
|
79 |
+
"url": "https://frascuchon-rag-mcp-server.hf.space/gradio_api/mcp/sse"
|
80 |
+
}
|
81 |
+
}
|
82 |
+
]
|
83 |
+
}
|
84 |
+
```
|
85 |
+
|
86 |
+
You can change the server URL to point to your own MCP server if you are running it locally or on a different host.
|