Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Hugging face MCP server

Vendor MCP
Open markdown

The Hugging face MCP connector routes your AI agent's tool calls to Hugging face's own MCP server through Scalekit. Each user signs in to Hugging face once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 11 tools.

Tools
11
What they doRead · write · destructive
8 · 3 · 08 read3 write0 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Hugging face MCP connection

    In AgentKit > Connections, create a Hugging face MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Hugging face MCP server, so you don't need to register an OAuth app.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'huggingfacemcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Hugging face MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'huggingfacemcp_hf_whoami',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • huggingfacemcp_hf_doc_fetchFetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination.Read-only

    Hf Doc Fetch

    Fetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination.

    Inputs

    doc_urlstringrequired
    Full URL of the Hugging Face or Gradio documentation page to fetch.
    offsetnumber
    Token offset for paginating large documents. Use the offset value from the truncation message to fetch the next chunk.
  • huggingfacemcp_hf_fsNavigate and search Hugging Face Hub resources (models, datasets, spaces, buckets, collections, papers, and documentation) through a virtual filesystem interface over hf:// URIs, using ls, cat, attach, stat, find, and search commands.Read-only

    Hf Fs

    Navigate and search Hugging Face Hub resources (models, datasets, spaces, buckets, collections, papers, and documentation) through a virtual filesystem interface over hf:// URIs, using ls, cat, attach, stat, find, and search commands.

    Inputs

    argsarrayrequired
    Command arguments; each array item is one grammar token (e.g. the URI, flags, or query terms for the chosen command).
    cmdstringrequired
    Command to execute: ls, cat, attach, stat, find, or search.one of lscatattachstatfindsearch
  • huggingfacemcp_hf_whoamiReturn the currently authenticated Hugging Face user's profile information.Read-only

    Hf Whoami

    Return the currently authenticated Hugging Face user's profile information.

    Inputs

    This tool takes no inputs.

  • huggingfacemcp_hub_repo_detailsRetrieve details for one or more Hugging Face Hub repositories by their IDs.Read-only

    Hub Repo Details

    Retrieve details for one or more Hugging Face Hub repositories by their IDs.

    Inputs

    repo_idsarrayrequired
    One or more repository IDs in "author/name" format. Supports models, datasets, and spaces.
    configstring
    Dataset Viewer config name. Required for dataset_preview when the dataset has multiple configs. Discover available configs via dataset_structure.
    limitinteger
    Number of rows to return for dataset_preview. Defaults to 5; clamped between 1 and 100.
    offsetinteger
    Row offset for dataset_preview pagination. Defaults to 0.
    operationsarray
    Details to return. Defaults to ["overview"]. For datasets, use ["overview", "dataset_structure"] first, then ["dataset_preview"] with config and split.
    repo_typestring
    Repository type to look up. Auto-detected when omitted.one of modeldatasetspace
    splitstring
    Dataset split name. Required for dataset_preview when the dataset has multiple splits. Discover available splits via dataset_structure.