MetorialDocs

Set up Hugging Face in Metorial for Claude, ChatGPT and Cursor

Share Hugging Face with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API token sign-in, 29 tools (14 read-only).

To give your team Hugging Face in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Hugging Face integration in a Metorial portal, and each person signs in to Hugging Face with their own account. Agents can manage machine learning model, dataset, and Spaces repositories on Hugging Face Hub. The integration has 29 tools, 14 read-only, 11 write and 4 destructive, plus 1 trigger.

What you'll learn

  • How an admin shares Hugging Face in a portal and how each person connects
  • The 11 OAuth scopes Hugging Face can request, and what each one allows
  • How to keep the 14 read-only tools and reject the other 15

Before you start

Sign-in methods

MethodTypeWhat a person provides
API TokenAPI tokentoken
OAuth (default)OAuthSigns in to Hugging Face

The portal and metorial setup use OAuth unless someone picks another method.

API Token

To connect, a person enters:

  • token: Hugging Face User Access Token (starts with hf_)

OAuth

People sign in to Hugging Face and approve the scopes you allow. The integration can request:

ScopeNameWhat it allows
openidOpenIDOpenID Connect identity
profileProfileUser profile information
emailEmailUser email address
read-reposRead ReposRead access to repositories
write-reposWrite ReposWrite access to repositories
manage-reposManage ReposManage repositories (create, delete, update settings)
read-collectionsRead CollectionsRead access to collections
write-collectionsWrite CollectionsCreate, update, and delete collections
write-discussionsWrite DiscussionsCreate and update discussions and pull requests
webhooksWebhooksManage repository webhooks
inference-apiInference APIMake inference requests on behalf of the user

Use your own Hugging Face OAuth app

With your own OAuth app, people see your company's name on the Hugging Face consent screen, and the client ID and secret belong to you.

Start the credentials in Metorial

In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Hugging Face and copy the Redirect URI.

Register the app with Hugging Face

Create an OAuth app or client in Hugging Face and add the redirect URI from Metorial as its redirect or callback URL.

Finish in Metorial

Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Hugging Face integration.

Admin: share Hugging Face in a portal

In the dashboard

Open Shared Resources

Open Workforce, choose the portal, and select Shared Resources under Access.

Share a new integration

Select Share a Resource, then New Integration, and choose Hugging Face. Under Auth Method, keep OAuth or pick another. For how members connect, choose Each person connects, so everyone signs in to Hugging Face as themselves.

Limit the tools

Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Hugging Face.

Choose who gets it

Add the access groups that should see Hugging Face. When a person asks for access from the portal, the request appears under Access Requests.

With the CLI

The CLI cannot create the per-user Hugging Face integration. Once it exists, check which groups have it:

metorial-admin portals access list <portal-id> --type provider_template --search "hugging face"

Employee: connect Hugging Face

In the portal

Open Hugging Face in the catalog

Sign in to your portal and open Hugging Face. The status reads Available.

Authenticate

Under Quick setup, select Authenticate. A Hugging Face sign-in tab opens. Sign in and approve the permissions listed.

Confirm

The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.

With the CLI

metorial catalog search "hugging face"
metorial setup <catalog-item-id>

catalog search prints the catalog item ID. metorial setup uses OAuth. To connect with API Token instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.

Add it to your AI client

metorial install adds your Hugging Face connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.

metorial list "hugging face"
metorial client list
metorial install <client-identifier> <integration-id>

For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.

Make it read-only

Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 14 read-only tools, such as get_user_info and run_inference, and lose the 11 write tools, such as upload_file or control_space, and the 4 destructive tools, such as delete_file or delete_collection.

Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.

Check it worked

metorial list "hugging face"
metorial tools <integration-id>
metorial call <integration-id> get_user_info -d '{}'

metorial tools lists the 29 tools, minus any you rejected. get_user_info takes no input. It gets information about the authenticated user, including username, email, organizations, and account details.

To see every input a tool takes, run metorial schema <integration-id> <tool-key>.

Tools

Read-only tools (14)

  • run_inference: Run generic inference on any Hugging Face model. Needs modelId and inputs.
  • search_datasets: Search for datasets on Hugging Face Hub.
  • get_discussion: Get detailed information about a specific discussion or pull request, including all comments and events. Needs repoType, repoId and discussionNum.
  • list_discussions: List discussions and pull requests on a Hugging Face repository. Needs repoType and repoId.
  • get_user_info: Get information about the authenticated user, including username, email, organizations, and account details.
  • list_repo_files: List files and directories in a Hugging Face repository at a given path and revision. Needs repoType and repoId.
  • get_collection: Retrieve a Hugging Face collection by its slug. Needs slug.
  • search_spaces: Search for Spaces (ML application demos) on Hugging Face Hub.
  • get_space_runtime: Get runtime information for a Space, including hardware, stage, SDK, and storage details. Needs repoId.
  • get_file_content: Read the text content of a file in a Hugging Face repository. Needs repoType, repoId and filePath.
  • text_generation: Generate text using a model on the Hugging Face Inference API. Needs model and prompt.
  • chat_completion: Run a chat completion using a model on the Hugging Face Inference API. Needs model and messages.
  • get_repository_info: Get detailed information about a model, dataset, or Space repository on Hugging Face Hub. Needs repoType and repoId.
  • search_models: Search for machine learning models on Hugging Face Hub.

Write tools (11)

  • control_space: Control a Space's lifecycle: pause, restart, or change hardware. Needs repoId and action.
  • create_discussion: Create a new discussion or pull request on a Hugging Face repository. Needs repoType, repoId and title.
  • create_collection: Create a new collection to curate related models, datasets, and Spaces. Needs title and namespace.
  • manage_space_secrets: Add or delete secrets on a Space. Needs repoId and action.
  • create_repository: Create a new model, dataset, or Space repository on Hugging Face Hub. Needs repoType and name.
  • upload_file: Upload or update a text file in a Hugging Face repository. Needs repoType, repoId, filePath and content.
  • update_repository_visibility: Change a repository's visibility between public and private. Needs repoType, repoId and private.
  • manage_space_variables: Add or delete environment variables on a Space. Needs repoId and action.
  • add_collection_item: Add a model, dataset, or space to an existing collection with an optional note. Needs slug, itemId and itemType.
  • update_discussion_status: Open or close a discussion or pull request. Needs repoType, repoId, discussionNum and action.
  • comment_on_discussion: Post a comment on an existing discussion or pull request. Needs repoType, repoId, discussionNum and comment.

Destructive tools (4)

  • delete_repository: Permanently delete a model, dataset, or Space repository from Hugging Face Hub. Needs repoType and repoId.
  • remove_collection_item: Remove an item from a collection. Needs slug and itemId.
  • delete_file: Delete a file from a Hugging Face repository. Needs repoType, repoId and filePath.
  • delete_collection: Delete a collection. Needs slug.

Triggers

Hugging Face has 1 trigger, which fire on events in Hugging Face:

  • repository_events: Triggered when events occur on watched Hugging Face repositories, including content changes, config updates, discussions, and comments.

Next steps