Hub documentation

Agents on the Hub

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Agents on the Hub

Hugging Face provides tools and protocols to connect AI agents to the Hub ecosystem.

Get Started

Tool What it does
CLI Give your agent the hf CLI with a built-in Skill
MCP Server Connect any MCP-compatible client (Claude, Cursor, VS Code, ChatGPT) to the Hub
Skills Task-specific guidance for AI/ML workflows
SDK Build agents programmatically with Python or JavaScript
Local Agents Run fully local agents with llama.cpp and Pi

See Agents on the Hub for a complete setup walkthrough.

tiny-agents

A lightweight toolkit for running MCP-powered agents on top of Hugging Face Inference. Available in JavaScript (@huggingface/tiny-agents) and Python (huggingface_hub).

# JavaScript
npx @huggingface/tiny-agents run "agent/id"

# Python
pip install "huggingface_hub[mcp]"
tiny-agents run "agent/id"

Create your own agent with an agent.json config:

{
	"model": "Qwen/Qwen2.5-72B-Instruct",
	"provider": "together",
	"servers": [
		{
			"type": "stdio",
			"command": "npx",
			"args": ["@playwright/mcp@latest"]
		}
	]
}

For local LLMs, add an endpointUrl pointing to your server (e.g. http://localhost:1234/v1). Learn more in the SDK guide.

Gradio MCP Server

Turn any Gradio app into an MCP server with a single-line change:

demo.launch(mcp_server=True)

The server exposes each function as a tool, with descriptions auto-generated from docstrings. Connect it to any MCP client. Thousands of MCP-compatible Spaces are available on the Hub. Learn more in the Gradio MCP guide.

smolagents

smolagents is a lightweight Python library for building agents in a few lines of code. It supports CodeAgent (writes actions in Python) and ToolCallingAgent (uses JSON tool calls), works with any model via Inference Providers, and integrates with MCP servers.

smolagent "Plan a trip to Tokyo, Kyoto and Osaka between Mar 28 and Apr 7." \
--model-type "InferenceClientModel" \
--model-id "Qwen/Qwen2.5-Coder-32B-Instruct" \
--tools "web_search"

Agents can be pushed to the Hub as Spaces. Browse community agents here. Learn more in the smolagents documentation.

Update on GitHub