跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Hugging Face,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
AnythingMCP 已收录在 Claude 的连接器目录中:一键添加到 Claude (在新标签页中打开),然后登录并选择 Claude 可以使用哪些 MCP 服务器。
摘要
让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。
试试这样问
Hugging Face 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Hugging Face、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Hugging Face + Claude
让你的 AI 用你自己的访问令牌探索 Hugging Face Hub:查找和比较模型、数据集、Spaces、论文和合集,逐行查看数据集内容,读取任意仓库中的文件,并通过 Inference Providers 与开源模型对话。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
HF_TOKEN
步骤 1 — 获取凭证
- 登录
https://huggingface.co,打开 Settings → Access Tokens(https://huggingface.co/settings/tokens)。 - 创建令牌。Read 令牌可以使用除对话和推理之外的全部功能:Hub 搜索、数据集查看器、文件、论文和合集。要与模型对话,请创建 Fine-grained 令牌并勾选 Make calls to Inference Providers;如果使用需申请访问(gated)的模型,还要勾选对公开 gated 仓库的读取权限。Write 令牌也能用,但完全不需要,因为该连接器不会修改 Hub 上的任何内容。
- 把令牌(以
hf_开头)粘贴到HF_TOKEN,然后安装连接器。令牌只会发送到 huggingface.co、datasets-server.huggingface.co 和 router.huggingface.co。 - 用
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 — 在 Claude 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
推荐路径:在 claude.ai web 上工作,无需触碰任何配置文件。
- 在 Claude 中打开 Customize → Connectors。
- 点击 +,然后点击 Add custom connector。
- 输入名称(例如
Hugging Face)和远程 MCP 服务器 URLhttps://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,然后点击 Add。 - 点击 Connect,登录 AnythingMCP(OAuth)并允许访问。
下面所有工具都会出现在你的聊天中,开始输入提示。
可用工具
| Tool | What it does |
|---|---|
huggingface_whoami | Show who the Hugging Face token belongs to: user name, PRO status, whether the account can pay for inference, the organizations it belongs… |
huggingface_search_models | Search models on the Hugging Face Hub |
huggingface_get_model | Read one model's details from the Hugging Face Hub: task, library, license, base model, parameter count, downloads, likes, gated or… |
huggingface_get_model_providers | List the Inference Providers that serve a model through Hugging Face (e.g. groq, together, novita, fal-ai, hf-inference), with each… |
huggingface_list_chat_models | List every model available for chat through the Hugging Face router, with each provider's status, context length, price per million input… |
huggingface_search_datasets | Search datasets on the Hugging Face Hub by text in the id, author or organization and tag (e.g. task_categories:text-classification… |
huggingface_get_dataset | Read one dataset's details from the Hugging Face Hub: license, tasks, languages, size category, downloads, likes, gated or private, last… |
huggingface_dataset_splits | List a dataset's subsets (config) and splits (train, validation, test, ...) from the Hugging Face dataset viewer |
huggingface_dataset_first_rows | Show the column names and types and the first 20 rows of one split of a Hugging Face dataset, from the dataset viewer |
huggingface_dataset_rows | Read 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_search | Full-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_filter | Filter 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_size | Show 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_statistics | Descriptive statistics for every column of one split of a Hugging Face dataset: for numbers min, max, mean, median, standard deviation and… |
huggingface_search_spaces | Search 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_spaces | Find Spaces (hosted AI demo apps) on Hugging Face by describing what they should do, e.g. 'remove image background' or 'transcribe audio' |
huggingface_get_space | Read 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_papers | List 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_papers | Search AI research papers indexed on Hugging Face by words in the title and abstract |
huggingface_get_paper | Read one paper's page on Hugging Face by arXiv id: title, authors, abstract, AI summary and keywords, upvotes, and the first models… |
huggingface_read_paper | Read 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_files | List the files and folders in a model, dataset or Space repository on Hugging Face, with sizes, at a branch, tag or commit |
huggingface_read_file | Read 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_collections | List curated collections on Hugging Face (groups of models, datasets, Spaces and papers), filtered by owner or by an item they contain… |
huggingface_get_collection | Read one Hugging Face collection with all its items (models, datasets, Spaces, papers) and the curator's notes |
huggingface_chat_completion | Chat with an open model through Hugging Face Inference Providers (OpenAI-compatible) |
huggingface_run_inference_task | Run 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
Claude Code 和 Claude Desktop 一样工作吗? 是的,两者都指向 https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。
下一步
这份指南对你有帮助吗?