SH

shreyaskarnik/huggingface-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

72 stars 10 forks 质量 66 趋势 0MIT

shreyaskarnik/huggingface-mcp-server 是从 https://github.com/shreyaskarnik/huggingface-mcp-server. 导入的 MCP 服务器候选人。

概览

shreyaskarnik/huggingface-mcp-server 是从 https://github.com/shreyaskarnik/huggingface-mcp-server. 导入的 MCP 服务器候选人。

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,提供对 Hugging Face Hub API 的只读访问。该服务器允许像 Claude 这样的大型语言模型与 Hugging Face 的模型、数据集、空间、论文和收藏进行交互。

组成部分

资源

服务器展示了热门的拥抱面资源:

  • 自定义hf:// URI方案用于访问资源
  • 带有hf://model/{model_id}的URI模型
  • 具有hf://dataset/{dataset_id}]的URI数据集
  • 带有hf://space/{space_id}的URI空间
  • 所有资源都有描述性名称和 JSON 内容类型

提示

服务器提供两个提示模板:

  • compare-models:生成多个Hugging Face模型的比较

  • 必要 model_ids 参数(逗号分隔型号ID)

  • 检索模型细节并格式化以便比较

  • summarize-paper:总结了《Hugging Face》中的一篇研究论文

  • 纸质识别所需的arxiv_id论证

  • 可选的detail_level参数(简短/详细)用于控制摘要深度

  • 将纸质元数据与实现细节结合

工具

服务器实现了几个工具类别:

  • 模型工具

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

🤗 Hugging Face MCP Server 🤗

A Model Context Protocol (MCP) server that provides read-only access to the Hugging Face Hub APIs. This server allows LLMs like Claude to interact with Hugging Face’s models, datasets, spaces, papers, and collections.

Components

Resources

The server exposes popular Hugging Face resources:

  • Custom hf:// URI scheme for accessing resources
  • Models with hf://model/{model_id} URIs
  • Datasets with hf://dataset/{dataset_id} URIs
  • Spaces with hf://space/{space_id} URIs
  • All resources have descriptive names and JSON content type

Prompts

The server provides two prompt templates:

  • compare-models: Generates a comparison between multiple Hugging Face models

    • Required model_ids argument (comma-separated model IDs)
    • Retrieves model details and formats them for comparison
  • summarize-paper: Summarizes a research paper from Hugging Face

    • Required arxiv_id argument for paper identification
    • Optional detail_level argument (brief/detailed) to control summary depth
    • Combines paper metadata with implementation details

Tools

The server implements several tool categories:

  • Model Tools

    • search-models: Search models with filters for query, author, tags, and limit
    • get-model-info: Get detailed information about a specific model
  • Dataset Tools

    • search-datasets: Search datasets with filters
    • get-dataset-info: Get detailed information about a specific dataset
  • Space Tools

    • search-spaces: Search Spaces with filters including SDK type
    • get-space-info: Get detailed information about a specific Space
  • Paper Tools

    • get-paper-info: Get information about a paper and its implementations
    • get-daily-papers: Get the list of curated daily papers
  • Collection Tools

    • search-collections: Search collections with various filters
    • get-collection-info: Get detailed information about a specific collection

Configuration

The server does not require configuration, but supports optional Hugging Face authentication:

  • Set HF_TOKEN environment variable with your Hugging Face API token for:
    • Higher API rate limits
    • Access to private repositories (if authorized)
    • Improved reliability for high-volume requests

Quickstart

Install

Installing via Smithery

To install huggingface-mcp-server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @shreyaskarnik/huggingface-mcp-server --client claude

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

"mcpServers": {
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @shreyaskarnik/huggingface-mcp-server --client claude
新手?先看 mcpskill.org 教程 →

配置

"mcpServers": { "huggingface": { "command": "uv", "args": [ "--directory", "/absolute/path/to/huggingface-mcp-server", "run", "huggingface_mcp_server.py" ], "env": { "HF_TOKEN": "your_token_here" // Optional } } }