关于 Huggingface
Huggingface 是用于搜索和查看 Hugging Face Hub 上公开模型、数据集及 Spaces 的 MCP 服务,适合开发者和机器学习研究人员。读取公开内容无需身份验证。
主要功能
- 01搜索模型、数据集和 Spaces
- 02查看仓库详情
- 03列出模型与数据集文件
- 04查看热门模型和数据集
- 05按元数据筛选结果
适用场景
- 01按任务或库查找模型
- 02按语言或类别定位数据集
- 03使用前检查仓库内容
- 04浏览热门 Hub 资源
MCP 相关
通过 Pipeworx 或独立本地 stdio 服务向 MCP 客户端提供 Hugging Face Hub 搜索、查看、文件列表和趋势工具。读取公开内容无需身份验证;提高速率限制及访问受限或私有仓库时可选用令牌。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://gateway.pipeworx.io/huggingface/mcpclaude mcp add --transport http pipeworx-io-huggingface https://gateway.pipeworx.io/huggingface/mcp{"mcpServers":{"pipeworx-io-huggingface":{"type":"http","url":"https://gateway.pipeworx.io/huggingface/mcp"}}}在 Cursor 中打开{"servers":{"pipeworx-io-huggingface":{"type":"http","url":"https://gateway.pipeworx.io/huggingface/mcp"}}}在 VS Code 中打开{"mcpServers":{"pipeworx-io-huggingface":{"type":"http","url":"https://gateway.pipeworx.io/huggingface/mcp"}}}{"mcpServers":{"pipeworx-io-huggingface":{"serverUrl":"https://gateway.pipeworx.io/huggingface/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
@pipeworx/huggingface
Hugging Face Hub MCP — 在最大的开放 ML 仓库中搜索和查看模型、数据集与 Spaces。读取公开内容无需身份验证。
属于 Pipeworx — 一个将 AI Agent 连接到 1881+ 个实时数据源的 MCP 网关。这是独立的非官方集成,与上游提供方无关联、未获其认可,也非由其发布。
工具
search_models(search?, author?, library?, language?, pipeline_tag?, tags?, sort?, direction?, limit?, full?)search_datasets(search?, author?, language?, task_categories?, sort?, direction?, limit?, full?)search_spaces(search?, author?, sdk?, sort?, direction?, limit?, full?)get_model(repo_id, revision?)get_dataset(repo_id, revision?)get_space(repo_id, revision?)list_model_files(repo_id, revision?)/list_dataset_files(repo_id, revision?)trending_models(limit?)/trending_datasets(limit?)
身份验证
读取公开内容无需密钥。更高的速率限制以及受限/私有仓库需要令牌,令牌为可选项:
- 平台密钥(可选): 网关环境变量
PLATFORM_HF_KEY - 自带密钥(可选):
?_apiKey=<hf_token>
数据源
https://huggingface.co/api/ — 公开 REST API。
快速开始
将其添加到你的 MCP 客户端(Claude Desktop、Cursor、Windsurf 等):
{
"mcpServers": {
"huggingface": {
"url": "https://gateway.pipeworx.io/huggingface/mcp"
}
}
}
此端点实际提供的内容
https://gateway.pipeworx.io/huggingface/mcp 上的 tools/list 会返回上表中的工具,以及 Pipeworx 的共享元工具——ask_pipeworx、discover_tools、search_within、remember/recall,还有网关范围内的其他工具。因此,你看到的工具数量会多于此表:目前,单个工具包端点除了自身工具外,还会列出大约 30 个共享工具。连接的 initialize 响应会说明其确切范围,是当天情况的权威依据。
这是有意为之,并非意外的多路复用。元工具让限定范围的连接也能回答此工具包未涵盖的问题——通过 ask_pipeworx 跨整个目录路由——而无需添加第二个 MCP 服务。目前无法挂载不含这些元工具的工具包端点;如果额外的 schema 比路由功能更耗上下文,请只连接一次完整网关,而不是连接多个工具包端点。
或者连接完整的 Pipeworx 网关,直接列出每个工具包的工具,而不只是当前工具包的工具:
{
"mcpServers": {
"pipeworx": {
"url": "https://gateway.pipeworx.io/mcp"
}
}
}
两个 URL 都连接到相同的网关和相同的 1881+ 个数据源。唯一的区别是哪些工具包的工具会被直接列出;从任一端点都可以通过 ask_pipeworx 使用全部工具。
没有 MCP 客户端?通过 HTTP 调用
curl -X POST https://gateway.pipeworx.io/v1/tools/huggingface_search_models \
-H 'Content-Type: application/json' \
-d '{"search":"bert","library":"transformers","limit":20}'
首次调用无需账户。查看任意工具:GET https://gateway.pipeworx.io/v1/tools/huggingface_search_models。查找工具包:使用 {"query":"..."} 执行 POST https://gateway.pipeworx.io/v1/tools/search_packs。
独立运行(无需网关账户)
此软件包也可作为本地 stdio MCP 服务运行——无需 Pipeworx 账户,也无需经过网关:
{
"mcpServers": {
"huggingface": {
"command": "npx",
"args": ["-y", "@pipeworx/mcp-huggingface"]
}
}
}
也可以直接运行,以确认服务能正常启动:
npx -y @pipeworx/mcp-huggingface
它通过 stdin/stdout 使用 MCP 通信,并仅对此工具包的工具响应 initialize/tools/list/tools/call——不包含上述网关连接额外提供的任何共享元工具。数据源相同、工具相同,但不提供 ask_pipeworx 路由。
与 ask_pipeworx 搭配使用
你可以用通俗英语提问,而不是直接调用工具——这不仅适用于上面的工具包端点,也适用于完整网关:
ask_pipeworx({ question: "your question about Huggingface data" })
网关会自动选择合适的工具并填入参数。
更多信息
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。