Hugging Face has released Tiny Agents in Python, a Model Context Protocol-powered agent built in about 70 lines of code. The implementation extends the huggingface_hub client SDK to act as an MCP client, pulling tools from MCP servers and passing them to LLMs during inference. Users can load agents from the Hugging Face Hub or configure custom local setups.
Inspired by Tiny Agents in JS , we ported the idea to Python 🐍 and extended the huggingface_hub client SDK to act as a MCP Client so it can pull tools from MCP servers and pass them to the LLM during inference.
MCP ( Model Context Protocol ) is an open protocol that standardizes how Large Language Models (LLMs) interact with external tools and APIs. Essentially, it removed the need to write custom integrations for each tool, making it simpler to plug new capabilities into your LLMs.
In this blog post, we'll show you how to get started with a tiny Agent in Python connected to MCP servers to unlock powerful tool capabilities. You'll see just how easy it is to spin up your own Agent and start building!
Modern LLMs are built for function calling (or tool use), which enables users to easily build applications tailored to specific use cases and real-world tasks.
Spoiler : An Agent is essentially a while loop built right on top of an MCP Client!
This section walks you through how to use existing Tiny Agents. We'll cover the setup and the commands to get an agent running.
First, you need to install the latest version of huggingface_hub with the mcp extra to get all the necessary components.
By leveraging the Model Context Protocol in a minimal codebase, developers can easily plug new tool capabilities into Large Language Models without writing custom integrations for each tool.