# 에이전트 라이브러리

## tiny-agents

Hugging Face Inference 위에서 MCP 기반 에이전트를 실행하기 위한 경량 툴킷입니다. [JavaScript](https://huggingface.co/docs/huggingface.js/en/tiny-agents/README)(`@huggingface/tiny-agents`) 및 [Python](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/mcp)(`huggingface_hub`)에서 사용할 수 있습니다.

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

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

`agent.json` 설정으로 자체 에이전트를 생성하세요:

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

로컬 LLM의 경우, 서버를 가리키는 `endpointUrl`을 추가하세요(예: `http://localhost:1234/v1`). 자세한 내용은 [SDK 가이드](./agents-sdk)에서 확인하세요.

## Gradio MCP 서버

…

```python
demo.launch(mcp_server=True)
```

서버는 각 함수를 도구로 노출하며, 설명은 docstring에서 자동으로 생성됩니다. 어떤 MCP 클라이언트에도 연결할 수 있습니다. [Hub](https://huggingface.co/spaces?filter=mcp-server)에는 수천 개의 MCP 호환 Spaces가 있습니다. [Gradio MCP 가이드](https://www.gradio.app/guides/building-mcp-server-with-gradio)에서 자세히 알아보세요.

## smolagents

[smolagents](https://github.com/huggingface/smolagents)는 몇 줄의 코드로 에이전트를 구축하기 위한 경량 Python 라이브러리입니다. `CodeAgent`(Python으로 액션을 작성)과 `ToolCallingAgent`(JSON 도구 호출 사용)를 지원하며, [Inference Providers](../inference-providers/index)를 통해 모든 모델과 함께 작동하고 MCP 서버와 통합됩니다.

```bash
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는 Spaces로 Hub에 배포할 수 있습니다. 커뮤니티 Agents를 [여기](https://huggingface.co/spaces?filter=smolagents&sort=likes)에서 둘러보세요. [smolagents 문서](https://huggingface.co/docs/smolagents/tutorials/tools#use-mcp-tools-with-mcpclient-directly)에서 자세히 알아보세요.

