连接器指南阅读约 6 分钟27 个 MCP 工具7 种语言

用 Microsoft Copilot 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

HC作者:HelpCode 团队更新于 6 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Hugging Face

Hugging Face

Let your AI explore the Hugging Face Hub with your own access token: find and compare models, datasets, Spaces, papers and collections, look inside datasets row by row, read files from any repository, and chat with open models through Inference Providers.

个工具

27

区域

INTL

类别

公共数据

身份验证

Bearer Token

所需环境变量

HF_TOKEN
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

摘要

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

引导式设置

2 分钟将 Hugging Face 连接到 Microsoft Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 Hugging Face,再把你的 MCP URL 添加到 Microsoft Copilot。无需代码,也无需自行运行服务器。

无需信用卡 · 7 天试用 · 提供自托管方案

试试这样问

Hugging Face 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Hugging Face · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Hugging Face、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Hugging Face + Microsoft Copilot

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

HF_TOKEN

步骤 1 — 获取凭证

  1. 登录 https://huggingface.co,打开 Settings → Access Tokens(https://huggingface.co/settings/tokens)。
  2. 创建令牌。Read 令牌可以使用除对话和推理之外的全部功能:Hub 搜索、数据集查看器、文件、论文和合集。要与模型对话,请创建 Fine-grained 令牌并勾选 Make calls to Inference Providers;如果使用需申请访问(gated)的模型,还要勾选对公开 gated 仓库的读取权限。Write 令牌也能用,但完全不需要,因为该连接器不会修改 Hub 上的任何内容。
  3. 把令牌(以 hf_ 开头)粘贴到 HF_TOKEN,然后安装连接器。令牌只会发送到 huggingface.co、datasets-server.huggingface.co 和 router.huggingface.co。
  4. 用 huggingface_whoami 检查设置:它是免费的,会显示令牌属于谁、它的角色以及你可以使用的组织。

在 Hugging Face(HF)Hub 上免费:搜索和阅读模型、数据集、Spaces、论文、合集和文件都不收费。

  • 模型:huggingface_search_models 可按名称、任务、作者、库或标签(例如 gguf 或 license:mit)以及 Inference Provider 筛选,并按下载量、点赞数或热度排序;huggingface_get_model 显示许可证、规模和文件。
  • 数据集:huggingface_search_datasets 和 huggingface_get_dataset。要在不下载的情况下查看数据集内容,AI 会使用数据集查看器:huggingface_dataset_splits、huggingface_dataset_first_rows、huggingface_dataset_rows(每页最多 100 行)、huggingface_dataset_search(全文搜索)、huggingface_dataset_filter(类似 SQL 的条件)、huggingface_dataset_size 和 huggingface_dataset_statistics(每列的最小值、最大值、平均值和直方图)。搜索、筛选和统计只适用于查看器已建立索引的数据集;新的或特别大的数据集可能会返回索引仍在加载。
  • Spaces:huggingface_search_spaces 按名称查找,huggingface_semantic_search_spaces 按应用的功能查找,huggingface_get_space 显示运行状态和硬件。
  • 论文:huggingface_daily_papers、huggingface_search_papers、huggingface_get_paper 和 huggingface_read_paper(以文本形式读取整篇论文页面)。
  • 文件和合集:huggingface_list_repo_files 和 huggingface_read_file 读取 README 或 config.json 这类小型文本文件;模型权重和其他大型二进制文件无法读取。huggingface_list_collections 和 huggingface_get_collection 显示精选合集。

对话和推理会产生费用,所以 AI 会先问你:huggingface_chat_completion 和 huggingface_run_inference_task 从你的 Hugging Face 额度中扣费。PRO 账户每月有 2 美元额度;免费账户需要先在 https://huggingface.co/settings/billing 购买额度。每次付费调用前,AI 会告诉你将运行哪个模型并等你同意,未经询问绝不会重复付费调用。huggingface_list_chat_models 显示每百万 token 的价格,huggingface_get_model_providers 显示哪些提供商提供某个模型。

选择提供商:默认由当前可用且最快的提供商回答。在模型 ID 后加上 :cheapest、:fastest、:preferred(你在 Hugging Face 设置中定的顺序)或提供商名称(如 :groq)即可自行选择。也可以由你所在的组织代为付费。huggingface_run_inference_task 在 hf-inference 提供商上运行文本分类、命名实体识别、fill-mask、摘要、翻译、零样本分类、问答、句子相似度和嵌入。

不可信内容:模型卡、数据集行、文件、论文和模型回答都来自第三方。AI 会把其中的指令当作数据,而不是命令。

常见错误:huggingface_whoami 或对话返回 401:令牌错误、已撤销或缺失。仓库返回 401 或 403:仓库是私有的、需申请访问(请先在模型页面接受条件),或你的 fine-grained 令牌不包含它;对于不存在的仓库,Hub 也会返回 401。402 或提示额度不足:额度已用完。对话返回 403:fine-grained 令牌缺少 Make calls to Inference Providers。400 model not supported:没有可用的提供商为该模型提供对话服务。429:速率限制;等一分钟再试。

该连接器不会创建或修改仓库,不上传文件,不管理 Spaces、Inference Endpoints 或 Jobs,也不生成图片。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Microsoft Copilot 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Microsoft Copilot 通过在 Copilot Studio 中构建的智能体使用 MCP 服务器:把 AnythingMCP 作为工具添加到智能体,然后把智能体发布到 Microsoft 365 Copilot 和 Teams。Copilot Studio 从 Microsoft 的云端通过 Streamable HTTP 连接,AnythingMCP 支持这种方式。

  1. 在 Copilot Studio 中打开你的智能体(或新建一个),进入 Tools,选择 Add a tool → New tool → Model Context Protocol。
  2. 填写 Server name(例如 AnythingMCP)、说明连接器用途的 Server description,以及 Server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。Copilot Studio 根据描述决定何时调用该服务器。
  3. 身份验证选择 API key,把 Type 设为 Header,请求头名称填 X-API-Key,然后选择 Create。
  4. 在 Add tool 中选择 Create a new connection,粘贴 AnythingMCP 的 MCP API 密钥(MCP Servers → 你的服务器 → API keys),然后选择 Add to agent。
  5. 在智能体的 Test 窗格中试一试:提出需要用到 Hugging Face 的工具的请求。
  6. 选择 Publish,然后进入 Channels → Microsoft 365 and Microsoft Teams,保持勾选 Make agent available in Microsoft Copilot,再选择 Add channel。See agent in Teams 会为你安装该智能体;在 Microsoft 365 Copilot 中输入 @ 并选择该智能体。

希望每个用户各自登录?请选择 OAuth 2.0 → Dynamic discovery 代替 API 密钥:每个用户会在智能体首次调用时登录 AnythingMCP。

自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Copilot Studio 从 Microsoft 的云端连接,因此 localhost 无法使用。

可用工具

ToolWhat it does
huggingface_whoamiShow who the Hugging Face token belongs to: user name, PRO status, whether the account can pay for inference, the organizations it belongs…
huggingface_search_modelsSearch models on the Hugging Face Hub
huggingface_get_modelRead one model's details from the Hugging Face Hub: task, library, license, base model, parameter count, downloads, likes, gated or…
huggingface_get_model_providersList the Inference Providers that serve a model through Hugging Face (e.g. groq, together, novita, fal-ai, hf-inference), with each…
huggingface_list_chat_modelsList every model available for chat through the Hugging Face router, with each provider's status, context length, price per million input…
huggingface_search_datasetsSearch datasets on the Hugging Face Hub by text in the id, author or organization and tag (e.g. task_categories:text-classification…
huggingface_get_datasetRead one dataset's details from the Hugging Face Hub: license, tasks, languages, size category, downloads, likes, gated or private, last…
huggingface_dataset_splitsList a dataset's subsets (config) and splits (train, validation, test, ...) from the Hugging Face dataset viewer
huggingface_dataset_first_rowsShow the column names and types and the first 20 rows of one split of a Hugging Face dataset, from the dataset viewer
huggingface_dataset_rowsRead a slice of rows (up to 100) from one split of a Hugging Face dataset, starting at offset, to page through the data
huggingface_dataset_searchFull-text search inside one split of a Hugging Face dataset (text columns only) and return the matching rows (up to 100) with the total…
huggingface_dataset_filterFilter the rows of one split of a Hugging Face dataset with an SQL-like condition and optional sort, e.g. where "label"=1 AND "score">0.5…
huggingface_dataset_sizeShow how big a Hugging Face dataset is: number of rows and columns and bytes (original files, Parquet, in memory) for the whole dataset…
huggingface_dataset_statisticsDescriptive statistics for every column of one split of a Hugging Face dataset: for numbers min, max, mean, median, standard deviation and…
huggingface_search_spacesSearch Spaces (hosted AI demo apps) on the Hugging Face Hub by text in the id, author and tag, sorted by likes, trending, creation or last…
huggingface_semantic_search_spacesFind Spaces (hosted AI demo apps) on Hugging Face by describing what they should do, e.g. 'remove image background' or 'transcribe audio'
huggingface_get_spaceRead one Space (hosted AI demo app) on Hugging Face: title, SDK, license, the app URL, the models and datasets it uses, and its runtime…
huggingface_daily_papersList the AI research papers curated on Hugging Face Daily Papers, newest first or by trending, for a day, an ISO week or a month (latest…
huggingface_search_papersSearch AI research papers indexed on Hugging Face by words in the title and abstract
huggingface_get_paperRead one paper's page on Hugging Face by arXiv id: title, authors, abstract, AI summary and keywords, upvotes, and the first models…
huggingface_read_paperRead a paper's full Hugging Face page as markdown by arXiv id (title, abstract and the paper text as Hugging Face renders it), capped at…
huggingface_list_repo_filesList the files and folders in a model, dataset or Space repository on Hugging Face, with sizes, at a branch, tag or commit
huggingface_read_fileRead the start of one text file from a Hugging Face repository (a README, config.json, tokenizer_config.json, a Python script or a small…
huggingface_list_collectionsList curated collections on Hugging Face (groups of models, datasets, Spaces and papers), filtered by owner or by an item they contain…
huggingface_get_collectionRead one Hugging Face collection with all its items (models, datasets, Spaces, papers) and the curator's notes
huggingface_chat_completionChat with an open model through Hugging Face Inference Providers (OpenAI-compatible)
huggingface_run_inference_taskRun a model on the hf-inference provider for a non-chat task: text classification, token classification (named entities), fill-mask…

示例提示

  • “在 Hugging Face 上找出下载量最高的五个中文文本分类模型,比较它们的许可证和规模。”
  • “给我看 stanfordnlp/imdb 的 test split 的前几行,并统计 label 为 1 的评论有多少条。”
  • “这周 Hugging Face Daily Papers 上 upvote 最多的论文是哪些?总结前三篇。”
  • “现在有哪些提供商为 openai/gpt-oss-120b 提供对话服务?每百万 token 多少钱?”
  • “找一个正在运行、可以去除图片背景的 Space,告诉我它用的是哪个模型。”
  • “用 meta-llama/Llama-3.1-8B-Instruct 在最便宜的提供商上总结这段话。运行前先告诉我模型和价格。”

FAQ

这适用于哪个 Copilot? 适用于工作中的 Microsoft 365 Copilot,通过 Copilot Studio 的智能体实现。面向个人账户的 Microsoft Copilot 应用无法添加自己的 MCP 服务器。

我需要什么? 一个可以使用 Copilot Studio 的工作账户(许可证或试用版),用于构建智能体。在 Microsoft 365 Copilot 或 Teams 中使用它的人需要拥有该智能体的访问权限:把它共享给他们,或请管理员为整个组织发布。如果你的组织对 Power Platform 连接器设置了数据策略,这些策略同样适用于 MCP 服务器。

智能体不调用工具。 检查请求头名称是否正好是 X-API-Key,密钥是否属于与 URL 相同的 MCP 服务器,并把 Server description 写得具体:Copilot Studio 根据它决定何时调用服务器。每次修改后重新发布智能体;在已打开的对话中输入 "start over" 即可使用新版本。

下一步

这份指南对你有帮助吗?

2 分钟将 Hugging Face 连接到 Microsoft Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 Hugging Face,再把你的 MCP URL 添加到 Microsoft Copilot。无需代码,也无需自行运行服务器。

相关指南

连接器

用 ChatGPT 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

连接器

用 Claude 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

连接器

用 Cursor 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

连接器

用 Gemini CLI 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

连接器

用 Meta Muse 连接 Hugging Face MCP

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。

连接器

Hugging Face MCP 服务器:模型、数据集与 Spaces

让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。