hf-mcp
$
npx mdskill add huggingface/skills/hf-mcpSearch, inspect, and utilize models, datasets, and tools directly from the Hugging Face Hub.
- Find suitable models, datasets, and interactive AI applications for specific tasks.
- Integrates with the Hugging Face Hub via a dedicated MCP server connection.
- Executes searches, retrieves repository metadata, and runs compute jobs on demand.
- Delivers structured results including documentation, model details, and functional Spaces.
SKILL.md
.github/skills/hf-mcpView on GitHub ↗
---
name: hf-mcp
description: Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run compute jobs, and use Gradio Spaces as AI tools. Available when connected to the HF MCP server.
---
# Hugging Face MCP Server
Connect AI assistants to the Hugging Face Hub. Setup: https://huggingface.co/settings/mcp
## Use Cases & Examples
### Find the Best Model for a Task
```
User: "Find the best model for code generation"
1. model_search(task="text-generation", query="code", sort="trendingScore", limit=10)
2. hub_repo_details(repo_ids=["top-result-id"], include_readme=true)
```
### Compare Models from Different Providers
```
User: "Compare Llama vs Qwen for text generation"
1. model_search(author="meta-llama", task="text-generation", sort="downloads", limit=5)
2. model_search(author="Qwen", task="text-generation", sort="downloads", limit=5)
3. hub_repo_details(repo_ids=["meta-llama/Llama-3.2-1B", "Qwen/Qwen3-8B"], include_readme=true)
```
### Find Training Datasets
```
User: "Find datasets for sentiment analysis in English"
1. dataset_search(query="sentiment", tags=["language:en", "task_categories:text-classification"], sort="downloads")
2. hub_repo_details(repo_ids=["top-dataset-id"], repo_type="dataset", include_readme=true)
```
### Discover AI Tools (MCP Spaces)
```
User: "Find a tool that can remove image backgrounds"
1. space_search(query="background removal", mcp=true)
2. dynamic_space(operation="view_parameters", space_name="result-space-id")
3. dynamic_space(operation="invoke", space_name="result-space-id", parameters="{...}")
```
### Generate Images
```
User: "Create an image of a robot reading a book"
1. dynamic_space(operation="discover") # See available tasks
2. gr1_flux1_schnell_infer(prompt="a robot sitting in a library reading a book, warm lighting, detailed")
```
### Research a Topic
```
User: "What are the latest papers on RLHF?"
1. paper_search(query="reinforcement learning from human feedback", results_limit=10)
2. hub_repo_details(repo_ids=["paper-linked-model"], include_readme=true) # If paper links to models
```
### Learn How to Use a Library
```
User: "How do I fine-tune with LoRA using PEFT?"
1. hf_doc_search(query="LoRA fine-tuning", product="peft")
2. hf_doc_fetch(doc_url="https://huggingface.co/docs/peft/...")
```
### Run a Quick GPU Job
```
User: "Run this Python script on a GPU"
hf_jobs(operation="uv", args={
"script": "# /// script\n# dependencies = [\"torch\"]\n# ///\nimport torch\nprint(torch.cuda.is_available())",
"flavor": "t4-small"
})
```
### Train a Model on Cloud GPU
```
User: "Run my training script on an A10G"
hf_jobs(operation="run", args={
"image": "pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime",
"command": ["/bin/sh", "-lc", "pip install transformers trl && python train.py"],
"flavor": "a10g-small",
"secrets": {"HF_TOKEN": "$HF_TOKEN"}
})
```
### Check Job Status
```
User: "What's happening with my training job?"
1. hf_jobs(operation="ps")
2. hf_jobs(operation="logs", args={"job_id": "job-xxxxx"})
```
### Explore What's Trending
```
User: "What models are trending right now?"
model_search(sort="trendingScore", limit=20)
```
### Get Model Card Details
```
User: "Tell me about Mistral-7B"
hub_repo_details(repo_ids=["mistralai/Mistral-7B-v0.1"], include_readme=true)
```
### Find Quantized Models
```
User: "Find GGUF versions of Llama 3"
model_search(query="Llama 3 GGUF", sort="downloads", limit=10)
```
### Use a Gradio Space as a Tool
```
User: "Transcribe this audio file"
1. space_search(query="speech to text transcription", mcp=true)
2. dynamic_space(operation="view_parameters", space_name="openai/whisper")
3. dynamic_space(operation="invoke", space_name="openai/whisper", parameters="{\"audio\": \"...\"}")
```
### Schedule Recurring Jobs
```
User: "Run this data sync every day at midnight"
hf_jobs(operation="scheduled uv", args={
"script": "...",
"cron": "0 0 * * *",
"flavor": "cpu-basic"
})
```
## Tool Selection Guide
| Goal | Tool |
|------|------|
| Find models | `model_search` |
| Find datasets | `dataset_search` |
| Find Spaces/apps | `space_search` |
| Find papers | `paper_search` |
| Get repo README/details | `hub_repo_details` |
| Learn library usage | `hf_doc_search` → `hf_doc_fetch` |
| Run code on GPU/CPU | `hf_jobs` |
| Use Gradio apps as tools | `dynamic_space` |
| Generate images | `gr1_flux1_schnell_infer` or `dynamic_space` |
| Check auth | `hf_whoami` |
## Tips
- Use `sort="trendingScore"` to find what's popular now
- Use `sort="downloads"` to find battle-tested options
- Set `mcp=true` in `space_search` to find Spaces usable as tools
- Use `include_readme=true` in `hub_repo_details` for full model/dataset documentation
- For jobs accessing private repos, always include `secrets: {"HF_TOKEN": "$HF_TOKEN"}`
- Use `dynamic_space(operation="discover")` to see all available Space-based tasks
More from huggingface/skills
- hf-cliHugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`.
- hf-memHugging Face CLI to estimate the required memory to load Safetensors or GGUF model weights for inference from the Hugging Face Hub
- huggingface-best>
- huggingface-community-evalsRun evaluations for Hugging Face Hub models using inspect-ai and lighteval on local hardware. Use for backend selection, local GPU evals, and choosing between vLLM / Transformers / accelerate. Not for HF Jobs orchestration, model-card PRs, .eval_results publication, or community-evals automation.
- huggingface-datasetsUse this skill for Hugging Face Dataset Viewer API workflows that fetch subset/split metadata, paginate rows, search text, apply filters, download parquet URLs, and read size or statistics.
- huggingface-gradioBuild Gradio web UIs and demos in Python. Use when creating or editing Gradio apps, components, event listeners, layouts, or chatbots.
- huggingface-llm-trainerTrain or fine-tune language and vision models using TRL (Transformer Reinforcement Learning) or Unsloth with Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, model selection/leaderboards and model persistence. Use for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face Jobs without local GPU setup.
- huggingface-local-modelsUse to select models to run locally with llama.cpp and GGUF on CPU, Mac Metal, CUDA, or ROCm. Covers finding GGUFs, quant selection, running servers, exact GGUF file lookup, conversion, and OpenAI-compatible local serving.
- huggingface-lora-space-builderBuild and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other diffusion base models. Also triggers when someone describes a LoRA they trained or hosts on the Hub and wants to share it. Covers picking the right base pipeline and `diffusers` inference recipe, designing a UI tailored to the LoRA's task and inputs (Union/multi-task control, edit, video, image, etc.), respecting model-card recommendations (trigger words, steps, guidance, LoRA scale, example inputs), and shipping to ZeroGPU hardware as a private Space by default.
- huggingface-paper-publisherPublish and manage research papers on Hugging Face Hub. Supports creating paper pages, linking papers to models/datasets, claiming authorship, and generating professional markdown-based research articles.