Connect Hugging Face to Claude Code
Search and inspect models, datasets, Spaces, papers and collections on the Hugging Face Hub, and create or manage your own repositories. Add Toolspoke to Claude Code once and it can use 15 Hugging Face actions. Your Hugging Face credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install Hugging Face and connect it
Add Hugging Face to a project in your Toolspoke workspace.
Access token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Access token
- huggingface.co → Settings → Access Tokens → Create new token. A Read token covers every read here; create_repo, update_repo_settings and delete_repo need a Write token, or a fine-grained one with write access to the namespaces you will change.
Choose what Claude Code may do
All 15 actions start on. Switch off any of the 3 actions that change something in Hugging Face, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the Hugging Face actions that only read, so they are safe to try first.
- Return the account this token belongs to, its organizations, and the token's role and fine-grained scopes
- Search models on the Hub by keyword, author, tag or task, sorted descending by the chosen field
- Retrieve one model's metadata, tags, pipeline task, library, card data, files, downloads and likes
- Search datasets on the Hub by keyword, author or tag, sorted descending by the chosen field
What Claude Code can do in Hugging Face
12 actions read, one writes and 2 delete or permanently change something.
Reads
Whoami
Return the account this token belongs to, its organizations, and the token's role and fine-grained scopes. Costs nothing, and it is the only call that fails on a bad token, every public read would succeed without one, so it is what an install tests itself with.
Search models
Search models on the Hub by keyword, author, tag or task, sorted descending by the chosen field. Returns ids, download and like counts, tags and pipeline task.
Get model
Retrieve one model's metadata, tags, pipeline task, library, card data, files, downloads and likes.
Search datasets
Search datasets on the Hub by keyword, author or tag, sorted descending by the chosen field.
Get dataset
Retrieve one dataset's metadata, tags, card data, files, downloads and likes.
Search spaces
Search Spaces (hosted demo apps) by keyword, author or tag, sorted descending by the chosen field.
Get space
Retrieve one Space's metadata. SDK, hardware, runtime stage, tags and likes.
List repo files
List the files at the root of a model, dataset or Space at one revision, with sizes and LFS info. Set recursive to walk the whole tree.
List commits
List the commit history of a model, dataset or Space at one revision, newest first.
Search papers
Search research papers indexed on Hugging Face Papers by text. Returns titles, arXiv ids, abstracts and upvotes.
List daily papers
List the Daily Papers curated on Hugging Face, for today or one date.
List collections
Search curated collections of models, datasets, Spaces and papers, by owner, text or a repository they contain.
Writes
Create repo
Create an empty model, dataset or Space repository under your account or an organization. Created private unless private is set to false. A Space also needs an sdk.
Deletes or permanently changes
Update repo settings
Change a repository's visibility or access gating. Destructive because making a private repository public publishes its files and history to everyone, and that cannot be taken back once they are downloaded.
Delete repo
Delete a model, dataset or Space repository permanently, with every file, commit and discussion in it. There is no undo.
Hugging Face in Claude Code: questions
Does Claude Code see my Hugging Face credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in Hugging Face?
Yes. Each of the 15 actions can be switched off for a project. Turn off the 3 that change something and Claude Code can only read.
Will 15 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Hugging Face action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a Hugging Face call does not run in a sandbox, so it bills nothing.
Hugging Face in your other apps
Try Hugging Face in Claude Code
Free to start, and tool calls cost nothing on any plan.