Hugging Face MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Hugging Face MCP or direct API to run model inferences, upload datasets, manage repositories, and deploy models through natural language.

Hugging Face logoHugging Face
Api KeyOauth2

Hugging Face is an open-source platform for building, training, and deploying machine learning models. It empowers developers with easy access to state-of-the-art AI tools and model sharing.

143 Tools

Try Hugging Face now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Hugging Face
Try asking
TOOLS

Supported Tools

Every Hugging Face action and event your agent gets out of the box.

Change Discussion Status

Tool to change the status of a Hugging Face repository discussion.

Check Dataset Validity

Tool to check whether a specific dataset is valid on Hugging Face Hub.

Check Models Upload Method

Tool to check if files should be uploaded through the Large File mechanism or directly.

Check Spaces Upload Method

Tool to check if files should be uploaded through the Large File mechanism or directly to Hugging Face Spaces.

Claim Paper Authorship

Tool to claim authorship of a paper on Hugging Face.

Request Repository Access

Tool to request access to a gated repository on Hugging Face Hub.

Create Collection

Tool to create a new collection on Hugging Face.

Create Datasets Branch

Tool to create a new branch in a Hugging Face dataset repository.

Create Datasets Commit

Tool to create a commit in a Hugging Face dataset repository.

Check Dataset File Upload Method

Tool to check if files should be uploaded via Large File Storage (LFS) or directly to a Hugging Face dataset repository.

Create Datasets Tag

Tool to create a tag on a Hugging Face dataset repository.

Create Discussion

Tool to create a new discussion on a Hugging Face repository (model, dataset, or Space).

Create Discussion Comment

Tool to create a new comment on a Hugging Face repository discussion.

Pin discussion

Tool to pin or unpin a discussion on a Hugging Face repository (model, dataset, or Space).

Create models branch

Tool to create a new branch in a Hugging Face model repository.

Create Models Commit

Tool to create a commit to a Hugging Face model repository.

Create Models Tag

Tool to create a tag on a Hugging Face model repository.

Create Paper Comment

Tool to create a new comment on a Hugging Face paper.

Create Papers Comment Reply

Tool to create a reply to a comment on a Hugging Face paper.

Create Papers Index

Tool to index a paper from arXiv by its ID on Hugging Face.

Create Repository

Tool to create a new repository (model, dataset, or Space) on Hugging Face Hub.

Create spaces branch

Tool to create a new branch in a Hugging Face space repository.

Create Spaces Commit

Tool to create a commit in a Hugging Face Space repository.

Create or update Space secret

Tool to create or update a secret in a Hugging Face Space.

Create Spaces Tag

Tool to create a tag on a Hugging Face space repository.

Create or update Space variable

Tool to create or update a variable in a Hugging Face Space.

Create SQL Console Embed

Tool to create a SQL Console embed for querying datasets on Hugging Face.

Create Webhook

Tool to create a webhook on Hugging Face that triggers on repository or discussion events.

Delete dataset branch

Tool to delete a branch from a Hugging Face dataset repository.

Delete Dataset Tag

Tool to delete a tag from a Hugging Face dataset.

Delete discussion

Tool to delete a discussion from a Hugging Face repository.

Delete network CIDR list

Tool to delete a network CIDR list entry from Hugging Face Inference Endpoints.

Delete notifications

Tool to delete notifications from Hugging Face.

Delete Settings Webhook

Tool to delete a webhook from Hugging Face settings.

Delete space branch

Tool to delete a branch from a Hugging Face space repository.

Delete space secret

Tool to delete a secret from a Hugging Face space.

Delete Spaces Tag

Tool to delete a tag from a Hugging Face space.

Delete space variable

Tool to delete a variable from a Hugging Face space.

Filter dataset rows

Tool to filter rows in a Hugging Face dataset split based on SQL-like query conditions.

Generate Chat Completion

Tool to generate a response given a list of messages in a conversational context.

Generate Text Embeddings

Tool to convert text into vector embeddings for feature extraction, semantic search, and similarity tasks.

Get Daily Papers

Tool to retrieve daily papers from Hugging Face.

Get Dataset Croissant Metadata

Tool to get Croissant metadata about a Hugging Face dataset.

Get Dataset First Rows

Tool to get the first 100 rows of a dataset split along with column data types and features.

Get Dataset Info

Tool to get general information about a dataset including description, citation, homepage, license, and features (column schemas).

Get Dataset Repository Info

Tool to retrieve detailed information about a Hugging Face dataset repository.

Get Dataset Rows

Tool to retrieve a slice of rows from a Hugging Face dataset split at any given location (offset).

Get Datasets Compare

Tool to get a comparison (diff) between two revisions of a Hugging Face dataset.

Get Dataset Size

Tool to get the size of a Hugging Face dataset including number of rows and size in bytes.

Get Datasets JWT

Tool to generate a JWT token for accessing a Hugging Face dataset repository.

Get Datasets Leaderboard

Tool to retrieve evaluation results ranked by score for a dataset's leaderboard.

Get Dataset Notebook URL

Tool to get a Jupyter notebook URL from a Hugging Face dataset repository.

Get Datasets Resolve

Tool to resolve and download a file from a Hugging Face dataset repository.

Get Dataset Security Scan

Tool to retrieve the security scan status of a Hugging Face dataset repository.

Get Dataset Tags by Type

Tool to retrieve all possible tags used for datasets on Hugging Face, grouped by tag type.

Get Dataset Statistics

Tool to get comprehensive statistics about a dataset split including column statistics and data distribution information.

Get dataset repository size

Tool to get the total size of a Hugging Face dataset repository at a specific revision and path.

Get Datasets XET Read Token

Tool to get a read short-lived access token for XET from Hugging Face datasets.

Get Discussion Details

Tool to get detailed information about a specific discussion or pull request on Hugging Face Hub.

Get Discussion Details

Tool to retrieve discussion details from a Hugging Face repository.

Get Available Job Hardware

Tool to retrieve available hardware configurations for Hugging Face Jobs with their specifications and pricing.

Get Model Information

Tool to retrieve detailed information about a Hugging Face model repository.

Get Models Compare

Tool to compare two revisions of a Hugging Face model repository.

Get Models JWT

Tool to generate a JWT token for accessing a Hugging Face model repository.

Get Models Notebook

Tool to retrieve a Jupyter notebook URL from a Hugging Face model repository.

Get Model Security Scan Status

Tool to retrieve the security scan status of a Hugging Face model repository.

Get model repository size

Tool to get the total size of a Hugging Face model repository at a specific revision and path.

Get Model XET Read Token

Tool to retrieve a short-lived XET read access token for a Hugging Face model repository.

Get Model Tags By Type

Tool to retrieve all possible tags used for Hugging Face models, grouped by tag type.

Get Organization Avatar

Tool to retrieve the avatar URL for a Hugging Face organization.

Get Organization Members

Tool to retrieve a list of members for a Hugging Face organization.

Get Organization Social Handles

Tool to retrieve an organization's social media handles from Hugging Face.

Get Resolve

Tool to resolve a file in a Hugging Face repository.

Get Resolve Cache Datasets

Tool to resolve a file from cache in a Hugging Face dataset repository.

Get Resolve Cache Models

Tool to resolve and retrieve files from the Hugging Face model cache.

Get Resolve Cache Spaces

Tool to resolve and retrieve a file from Hugging Face Spaces cache.

Get Billing Usage

Tool to retrieve user billing usage for a given period from Hugging Face.

Get Jobs Usage

Tool to retrieve Jobs usage and billing information for the current subscription period from Hugging Face.

Get Live Billing Usage

Tool to retrieve live billing usage stream from Hugging Face.

Get Billing Usage V2

Tool to retrieve user billing usage for a custom date range from Hugging Face.

Get MCP Settings

Tool to retrieve MCP (Model Context Protocol) tools configuration for the authenticated user.

Get Settings Webhook

Tool to retrieve a specific webhook configuration from Hugging Face settings.

Get Space Info

Tool to retrieve detailed information about a Hugging Face Space repository.

Get Spaces Compare

Tool to compare two revisions of a Hugging Face Space repository.

Get Spaces Events

Tool to stream status updates for a Hugging Face Space using SSE protocol.

Get Spaces JWT

Tool to generate a JWT token for accessing a Hugging Face space repository.

Get Space Metrics

Tool to get live metrics for a specific Space in a streaming fashion, with SSE protocol, such as current Zero-GPU usage.

Get Spaces Notebook

Tool to retrieve a Jupyter notebook URL from a Hugging Face space repository.

Get Spaces Resolve

Tool to resolve and retrieve a file from a Hugging Face Space repository.

Get Space Security Scan Status

Tool to retrieve the security scan status of a Hugging Face space repository.

Get space repository size

Tool to get the total size of a Hugging Face space repository at a specific revision and path.

Get Space XET Read Token

Tool to retrieve a short-lived XET read access token for a Hugging Face Space repository.

Get Spaces XET Write Token

Tool to retrieve a short-lived XET write access token for a Hugging Face space repository.

Get Trending Repositories

Tool to retrieve trending repositories from Hugging Face.

Get User Avatar

Tool to retrieve the avatar URL for a Hugging Face user.

Get User Overview

Tool to retrieve a comprehensive overview of a Hugging Face user's profile.

Get User Social Handles

Tool to retrieve a user's social media handles from Hugging Face.

Get Authenticated User Info

Tool to get information about the authenticated Hugging Face user including username, email, organizations, and token details.

Handle Dataset User Access Request

Tool to handle a user's access request to a gated Hugging Face dataset.

List Collections

Tool to list collections on the Hugging Face Hub.

List Dataset Parquet Files

Tool to get the list of Parquet files for a dataset.

List Dataset Paths Info

Tool to list detailed information about specific paths in a Hugging Face dataset repository.

List Datasets

Tool to list datasets on the Hugging Face Hub.

List Dataset Commits

Tool to list commits from a Hugging Face dataset repository.

List Dataset Splits

Tool to get the list of subsets and splits of a dataset.

List Dataset References

Tool to list all references (branches, tags, converts, pull requests) in a Hugging Face dataset repository.

List datasets tree

Tool to list the content of a Hugging Face dataset repository tree with pagination support.

List Dataset Access Requests

Tool to list access requests for a gated Hugging Face dataset repository.

List Discussions

Tool to list discussions for a Hugging Face repository.

List Repository Discussions

Tool to list discussions and pull requests for a Hugging Face repository.

List Available Documentation

Tool to retrieve the list of available documentation from Hugging Face.

List Inference Endpoints

Tool to list Hugging Face Inference Endpoints for a specific user or organization.

List models on Hugging Face Hub

Tool to list models on the Hugging Face Hub with filtering options.

List Model Commits

Tool to list commits from a Hugging Face model repository.

List Model Paths Info

Tool to list detailed information about specific paths in a Hugging Face model repository.

List Model References

Tool to list all references (branches, tags, converts, and optionally pull requests) in a Hugging Face model repository.

List model repository tree

Tool to list the contents of a Hugging Face model repository tree at a specific revision and path, with pagination support.

List Notifications

Tool to list notifications for the authenticated Hugging Face user.

List Repository Commits

Tool to list commits for a Hugging Face repository.

List repository files

Tool to get the file tree of a Hugging Face repository with pagination support.

List Webhooks

Tool to list all webhooks configured in Hugging Face settings.

List Spaces on Hugging Face Hub

Tool to list Spaces on the Hugging Face Hub with filtering options.

List Space Commits

Tool to list commits from a Hugging Face Space repository.

List Available Space Hardware

Tool to retrieve available hardware configurations for Hugging Face Spaces with their specifications and pricing.

List Space LFS Files

Tool to list LFS (Large File Storage) files from a Hugging Face Space repository.

List Space Paths Info

Tool to list detailed information about specific paths in a Hugging Face space repository.

List Space References

Tool to list all references (branches, tags, converts, pull requests) in a Hugging Face space repository.

List spaces tree

Tool to list the content of a Hugging Face space repository tree with pagination support.

List Cloud Provider Vendors

Tool to list available cloud provider vendors for Hugging Face Inference Endpoints.

Search dataset

Tool to search text in a dataset split on Hugging Face.

Search Documentation

Tool to search Hugging Face documentation across all products and libraries.

Search Papers

Tool to perform hybrid semantic/full-text search on papers in Hugging Face.

Squash Dataset Commits

Tool to squash all commits in a dataset ref into a single commit with the given message.

Squash Spaces Commits

Tool to squash all commits in a space ref into a single commit with the given message.

Update Dataset Settings

Tool to update settings for a Hugging Face dataset repository.

Update Discussion Title

Tool to change the title of an existing discussion on a Hugging Face repository (model, dataset, or Space).

Update Model Repository Settings

Tool to update settings for a Hugging Face model repository.

Update Notification Settings

Tool to update notification settings for the authenticated Hugging Face user.

Update Watch Settings

Tool to update watch settings for your Hugging Face account.

Update Webhook

Tool to update an existing webhook in Hugging Face settings.

Update Spaces Repository Settings

Tool to update settings for a Hugging Face Spaces repository.

Update SQL Console Embed

Tool to update an existing SQL console embed for a Hugging Face dataset.

Enable or Disable Webhook

Tool to enable or disable a webhook on Hugging Face.

SETUP GUIDE

Connect Hugging Face MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Hugging Face
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'Classify this text using the "distilbert-base-uncased" model: "AI is transforming technology."'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Hugging Face API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Hugging Face Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'Run sentiment analysis using the distilbert-base-uncased model on this text: "I love working with AI!"'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Hugging Face actions with your Agent

Why Use Composio?

AI Native Hugging Face Integration

  • Supports both Hugging Face MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Hugging Face data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Hugging Face access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Hugging Face
  • Scoped, least privilege access to Hugging Face resources
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

No, you can get started immediately using Composio's built-in Hugging Face app. For production, we recommend configuring your own OAuth credentials.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Hugging Face.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Hugging Face tool your agent needs.Free to start.

Start building