|
8 | 8 |
|
9 | 9 | # How to Build an MCP Server in 5 Lines of Python
|
10 | 10 |
|
11 |
| -[Gradio](https://github.com/gradio-app/gradio) is a Python library used by more than 1 million developers each month to build interfaces for machine learning models. Beyond just creating UIs, Gradio also exposes API capabilities and — now! — Gradio apps can be launched as an Model Context Protocol (MCP) servers for LLMs. This means that your Gradio app, whether it's an image generator or tax calculator or something else entirely, can be called as a tool by an LLM. |
| 11 | +[Gradio](https://github.com/gradio-app/gradio) is a Python library used by more than 1 million developers each month to build interfaces for machine learning models. Beyond just creating UIs, Gradio also exposes API capabilities and — now! — Gradio apps can be launched Model Context Protocol (MCP) servers for LLMs. This means that your Gradio app, whether it's an image generator or a tax calculator or something else entirely, can be called as a tool by an LLM. |
12 | 12 |
|
13 | 13 | This guide will show you how to use Gradio to build an MCP server in just a few lines of Python.
|
14 | 14 |
|
@@ -71,7 +71,7 @@ http://your-server:port/gradio_api/mcp/sse
|
71 | 71 |
|
72 | 72 | Gradio automatically converts the `letter_counter` function into an MCP tool that can be used by LLMs. **The docstring of the function is used to generate the description of the tool and its parameters.**
|
73 | 73 |
|
74 |
| -All you need to do is add this URL endpoint to your MCP Client (e.g., Claude Desktop, Cursor, or Cline), which typically means pasting this config in the settings: |
| 74 | +All you need to do is add this URL endpoint to your MCP Client (e.g., Claude Desktop, Cursor, Cline, or [Tiny Agents](https://huggingface.co/blog/tiny-agents)), which typically means pasting this config in the settings: |
75 | 75 |
|
76 | 76 | ```
|
77 | 77 | {
|
@@ -139,4 +139,4 @@ If you want to dive deeper, here are some articles that we recommend:
|
139 | 139 | * [What Is MCP, and Why Is Everyone – Suddenly!– Talking About It?](https://huggingface.co/blog/Kseniase/mcp)
|
140 | 140 | * [An Introduction to the MCP Protocol](https://modelcontextprotocol.io/introduction)
|
141 | 141 | * [Guide: Building an MCP Server with Gradio](https://www.gradio.app/guides/building-mcp-server-with-gradio)
|
142 |
| -* [Bonus Guide: Building an MCP Client with Gradio](https://www.gradio.app/guides/building-an-mcp-client-with-gradio) |
| 142 | +* [Bonus Guide: Building an MCP Client with Gradio](https://www.gradio.app/guides/building-an-mcp-client-with-gradio) |
0 commit comments