hf-mcp: Using Hugging Face Hub via MCP in Agents

Introduction

When doing model selection, finding datasets, or checking Hub documentation, the common path involves repeatedly searching in the browser, copying repository IDs, and switching back to the IDE to write code. On the Agent side, if you want to string together “Find model -> Read README -> Run a small experiment” into a chain, relying solely on internet search often fails to get the Hub’s structured metadata and cannot directly call Gradio Spaces or HF Jobs.

The hf-mcp introduced below is an Agent-facing Skill: it guides the assistant to select tools exposed by the Hugging Face MCP server based on tasks, completing retrieval, document reading, computation tasks, and Space calls within the conversation. The Skill comes from the SkillHub enterprise source, and the content is consistent with the same-named SKILL in the Hugging Face official skills repository, focusing on “how to select tools and compose steps.”

What is this

hf-mcp (coordinate @org-02qudk26/hf-mcp, current version 1.0.0) is released by Zhiyu Technology, categorized as ai-agent, and marked as enterprise. Official entry points:

  • API: https://api.skillhub.cn/org-02qudk26/hf-mcp
  • SkillHub Page: https://www.skillhub.cn/skills/org-02qudk26/hf-mcp

The description is consistent with the page: using Hugging Face Hub tools via the MCP server—searching models, datasets, Spaces, papers; getting repository details and documentation; running computation tasks; treating Gradio Spaces as callable tools. (The SkillHub description is truncated on the page; see the upstream SKILL for the full description.)

The Skill tag contains requires_api_key=true: when connecting to Hub, the client needs to be configured according to Hugging Face MCP Settings, and credentials like HF_TOKEN should be used when accessing private resources or Jobs.

Core Capabilities

The following capabilities come from verified SKILL documentation and the SkillHub description.

Retrieval & Details

Target Tool
Find model model_search
Find dataset dataset_search
Find Spaces / apps space_search
Find papers paper_search
Repo README & Details hub_repo_details

Documentation & Learning

Target Tool
Search in HF docs hf_doc_search
Fetch specific doc page hf_doc_fetch

Compute & Space

Target Tool
Run GPU/CPU tasks on HF hf_jobs
Call Gradio Space as a tool dynamic_space
Image generation (example tool) gr1_flux1_schnell_infer
Check login status hf_whoami

Installation & Enablement

Installation consists of two layers: installing the Skill into the Agent’s skills directory and connecting the Agent to the Hugging Face MCP server.

1. Install SkillHub CLI (if not installed)

First, check if the CLI is already installed:

command -v skillhub && skillhub --version

If not installed, follow SkillHub Installation Documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install hf-mcp to the current Agent

When installing, you must use --dir to point to the skills directory that the current Agent will read. See https://skillhub.cn/install/skillhub.md for details.

Cursor example:

skillhub install @org-02qudk26/hf-mcp --dir ~/.cursor/skills/

Claude Code example:

skillhub install @org-02qudk26/hf-mcp --dir ~/.claude/skills/

Codex can choose either user-level or project-level directory:

skillhub install @org-02qudk26/hf-mcp --dir ~/.codex/skills/
# or
skillhub install @org-02qudk26/hf-mcp --dir ./.agents/skills/

After installation, refresh or restart according to the requirements of each Agent. The SkillHub page suggests that AI can install @org-02qudk26/hf-mcp by following https://skillhub.cn/install/skillhub.md.

3. Connect Hugging Face MCP Server

The SKILL specifies using the tools mentioned above after connecting to the HF MCP server. Configuration entry:

https://huggingface.co/settings/mcp

Select the client on the page, copy the MCP configuration into the client settings, and restart. When accessing private repositories or submitting Jobs, you can set:

export HF_TOKEN="hf_..."

When Jobs access private resources, secrets: {"HF_TOKEN": "$HF_TOKEN"} needs to be passed.

Typical Usage

The following is excerpted from the upstream SKILL, showing how the assistant combines tools.

Find a model and read README by 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)

Find English sentiment analysis dataset

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)

Find background removal tools using MCP Space

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="{...}")

Check PEFT / LoRA documentation

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 script quickly on GPU

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"
})

Doc Tips: sort="trendingScore" to see popularity; space_search set to mcp=true to filter Spaces that can be used as tools; hub_repo_details set to include_readme=true to get the full model card at once.

Suitable Scenarios & Notes

Who is it for: Developers using Agents in environments like Cursor, Claude Code, Codex, etc., who want to complete Hub retrieval, document reading, Space trials, and submitting short Jobs within the conversation.

Notes:

  1. The Skill provides tool selection and steps; tools are unavailable without connecting to the MCP configured at huggingface.co/settings/mcp.
  2. requires_api_key=true: The threshold for public retrieval is low; private repositories and hf_jobs require a valid HF_TOKEN.
  3. Jobs and some Spaces may consume Hub resources; refer to Hugging Face’s current policies.
  4. SkillHub scraping data: Score 100000, Downloads 738, Installs 0; refer to the latest statistics on the page.

Conclusion

hf-mcp organizes the MCP capabilities of the Hugging Face Hub into executable retrieval, documentation, Jobs, and Space paths for Agents. After installing the Skill, please complete the client connection on the HF MCP settings page.

  • SkillHub: https://www.skillhub.cn/skills/org-02qudk26/hf-mcp
  • Official API: https://api.skillhub.cn/org-02qudk26/hf-mcp
  • MCP Configuration: https://huggingface.co/settings/mcp
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye