Home / MCP / Hugging Face MCP Server

Hugging Face MCP Server

Provides read-only access to Hugging Face Hub data via MCP for models, datasets, spaces, papers, and collections.

python
Installation
Add the following to your MCP client configuration file.

Configuration

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

You can access Hugging Face Hub resources through a dedicated MCP server that provides read-only interactions with models, datasets, spaces, papers, and collections. This enables LLMs to query and summarize Hugging Face content efficiently and securely.

How to use

To use this MCP server, run it in your environment and connect your MCP client to it. You will be able to search models, datasets, spaces, and papers, retrieve detailed information, and invoke prompts that compare models or summarize papers. Each tool is designed to help you discover relevant artifacts on Hugging Face and extract structured information for downstream tasks.

How to install

Prerequisites: you need Node.js and a Python runtime available on your system. You will also use a command-line tool to run the MCP server locally.

Install and run the MCP server using the recommended local setup. The following steps show how to run the server with a local runtime instead of a remote endpoint.

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

Additional configuration and usage notes

Optional authentication with Hugging Face can improve API rate limits and access to private repositories if you have the proper permissions. You can supply your token via the HF_TOKEN environment variable when starting the server.

If you encounter issues, check logs and ensure you have internet connectivity. For debugging, you can use an inspector tool to trace the MCP interactions.

Available tools

search-models

Search models with filters for query, author, tags, and limit

get-model-info

Get detailed information about a specific model

search-datasets

Search datasets with filters

get-dataset-info

Get detailed information about a specific dataset

search-spaces

Search Spaces with filters including SDK type

get-space-info

Get detailed information about a specific Space

get-paper-info

Get information about a paper and its implementations

get-daily-papers

Get the list of curated daily papers

search-collections

Search collections with various filters

get-collection-info

Get detailed information about a specific collection

compare-models

Prompt template that generates a comparison between multiple Hugging Face models using provided model_ids

summarize-paper

Prompt template that summarizes a Hugging Face paper identified by arxiv_id with optional detail level