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
- A portal with at least one access group
- An account with Hugging Face for each person who connects
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| API Token | API token | token |
| OAuth (default) | OAuth | Signs 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:
| Scope | Name | What it allows |
|---|---|---|
openid | OpenID | OpenID Connect identity |
profile | Profile | User profile information |
email | User email address | |
read-repos | Read Repos | Read access to repositories |
write-repos | Write Repos | Write access to repositories |
manage-repos | Manage Repos | Manage repositories (create, delete, update settings) |
read-collections | Read Collections | Read access to collections |
write-collections | Write Collections | Create, update, and delete collections |
write-discussions | Write Discussions | Create and update discussions and pull requests |
webhooks | Webhooks | Manage repository webhooks |
inference-api | Inference API | Make 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:
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
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.
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 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. NeedsmodelIdandinputs.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. NeedsrepoType,repoIdanddiscussionNum.list_discussions: List discussions and pull requests on a Hugging Face repository. NeedsrepoTypeandrepoId.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. NeedsrepoTypeandrepoId.get_collection: Retrieve a Hugging Face collection by its slug. Needsslug.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. NeedsrepoId.get_file_content: Read the text content of a file in a Hugging Face repository. NeedsrepoType,repoIdandfilePath.text_generation: Generate text using a model on the Hugging Face Inference API. Needsmodelandprompt.chat_completion: Run a chat completion using a model on the Hugging Face Inference API. Needsmodelandmessages.get_repository_info: Get detailed information about a model, dataset, or Space repository on Hugging Face Hub. NeedsrepoTypeandrepoId.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. NeedsrepoIdandaction.create_discussion: Create a new discussion or pull request on a Hugging Face repository. NeedsrepoType,repoIdandtitle.create_collection: Create a new collection to curate related models, datasets, and Spaces. Needstitleandnamespace.manage_space_secrets: Add or delete secrets on a Space. NeedsrepoIdandaction.create_repository: Create a new model, dataset, or Space repository on Hugging Face Hub. NeedsrepoTypeandname.upload_file: Upload or update a text file in a Hugging Face repository. NeedsrepoType,repoId,filePathandcontent.update_repository_visibility: Change a repository's visibility between public and private. NeedsrepoType,repoIdandprivate.manage_space_variables: Add or delete environment variables on a Space. NeedsrepoIdandaction.add_collection_item: Add a model, dataset, or space to an existing collection with an optional note. Needsslug,itemIdanditemType.update_discussion_status: Open or close a discussion or pull request. NeedsrepoType,repoId,discussionNumandaction.comment_on_discussion: Post a comment on an existing discussion or pull request. NeedsrepoType,repoId,discussionNumandcomment.
Destructive tools (4)
delete_repository: Permanently delete a model, dataset, or Space repository from Hugging Face Hub. NeedsrepoTypeandrepoId.remove_collection_item: Remove an item from a collection. NeedssluganditemId.delete_file: Delete a file from a Hugging Face repository. NeedsrepoType,repoIdandfilePath.delete_collection: Delete a collection. Needsslug.
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
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Hugging Face there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Hugging Face on metorial.com: the integration overview