hf-mcp/skills/hf-mcp/SKILL.md
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.
npx skillsauth add huggingface/skills hf-mcpInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Connect AI assistants to the Hugging Face Hub. Setup: https://huggingface.co/settings/mcp
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)
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)
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)
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="{...}")
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")
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
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/...")
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"
})
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"}
})
User: "What's happening with my training job?"
1. hf_jobs(operation="ps")
2. hf_jobs(operation="logs", args={"job_id": "job-xxxxx"})
User: "What models are trending right now?"
model_search(sort="trendingScore", limit=20)
User: "Tell me about Mistral-7B"
hub_repo_details(repo_ids=["mistralai/Mistral-7B-v0.1"], include_readme=true)
User: "Find GGUF versions of Llama 3"
model_search(query="Llama 3 GGUF", sort="downloads", limit=10)
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\": \"...\"}")
User: "Run this data sync every day at midnight"
hf_jobs(operation="scheduled uv", args={
"script": "...",
"cron": "0 0 * * *",
"flavor": "cpu-basic"
})
| 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 |
sort="trendingScore" to find what's popular nowsort="downloads" to find battle-tested optionsmcp=true in space_search to find Spaces usable as toolsinclude_readme=true in hub_repo_details for full model/dataset documentationsecrets: {"HF_TOKEN": "$HF_TOKEN"}dynamic_space(operation="discover") to see all available Space-based taskstools
Hugging 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`.
development
AI demos and GPU compute with Gradio Spaces and Hugging Face Spaces ZeroGPU. Use when writing or reviewing code that uses `@spaces.GPU`, configuring `python_version` or `requirements.txt` for a ZeroGPU Space, or handling ZeroGPU-specific code constraints — pickle-based process isolation, `gr.State` semantics across the worker boundary, no `torch.compile` (use AoTI instead), CUDA wheel-only builds (no `nvcc` at build or runtime), large vs xlarge sizing, and dynamic duration callables. Make sure to use this skill whenever the user mentions ZeroGPU, `@spaces.GPU`, or the `spaces` Python package, or hits ZeroGPU-specific code errors like `PicklingError` across the worker boundary, `illegal duration`, or `flash-attn` wheel-build failures — even when the user does not explicitly ask for ZeroGPU coding guidance. Trigger on `import spaces` or `@spaces.GPU` in code.
development
Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder; dense or static embedding model; for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker; pair scoring for two-stage retrieval / pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.
development
Use 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.