Tiny Agents in Python: a MCP-powered agent in ~70 lines of code
read at source ↗ huggingface.co
Tiny Agents in Python: a MCP-powered agent in ~70 lines of code
Source: HuggingFace Date: 2025-05-23 URL: https://huggingface.co/blog/python-tiny-agents
Summary
Library update: huggingface_hub[mcp]>=0.32.0 adds an MCPClient class enabling MCP-powered agents in ~70 lines of Python. Agents are defined by agent.json (model, provider, MCP server list) with automatic tool discovery and execution. Supports stdio (local), http, and sse MCP transports. Demo: Playwright browser agent and FLUX.1 image generation via HF Space MCP. “An Agent is a while loop built right on top of an MCP Client.”
Implications
Thread: HF as open-source ML hub / agentic patterns. The huggingface_hub SDK growing MCP support makes MCP-based agents a first-class HF pattern — previously it was smolagents or custom code. The 70-line framing is positioning: MCP reduces agentic boilerplate dramatically, and HF is the entry point for model access. The Playwright + HF Space MCP combination is particularly useful: browser automation + AI model as tool, all in one agent.json config. Watch whether the tiny-agents dataset becomes a community resource for sharing and discovering agent configurations.