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
- OAuth app
- Scalekit's or your own
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. 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>Create the Hugging face MCP connection
In AgentKit > Connections, create a Hugging face MCP connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Scalekit credentials are available for Hugging face MCP server, so you don't need to register an OAuth app.
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.actionsconst connector = 'huggingfacemcp'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'huggingfacemcp_hf_whoami',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "huggingfacemcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Hugging face MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="huggingfacemcp_hf_whoami",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user signs in once. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolhuggingfacemcp_hf_doc_fetchFetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination.Read-onlyHf 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_doc_searchSearch Hugging Face documentation across all products or a specific product by query.Read-onlyHf Doc Search
Search Hugging Face documentation across all products or a specific product by query.
Inputs
querystringrequired- Semantic search query. Use an empty string to explore structure and navigation tips, or provide a specific query to find targeted documentation.
productstring- Hugging Face product or library to filter results by. Provide when known to narrow the search.
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-onlyHf 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-onlyHf 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-onlyHub 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.
huggingfacemcp_hub_repo_searchSearch the Hugging Face Hub for models, datasets, or spaces with optional filters for author, task, and sort order.Read-onlyHub Repo Search
Search the Hugging Face Hub for models, datasets, or spaces with optional filters for author, task, and sort order.
Inputs
authorstring- Organization or user namespace to filter results by.
filtersarray- Hub filter tags to apply to each selected repo type. Supports task tags, language codes, and framework tags.
limitnumber- Maximum number of results to return per selected repository type. Clamped between 1 and 100.default
20 querystring- Search term for repositories. Leave blank with sort + limit set to browse trending or recent repos.
repo_typesarray- Repository types to include in the search. Defaults to model and dataset. space uses keyword search.
sortstring- Sort order for results, applied in descending order.one of
trendingScoredownloadslikescreatedAtlastModified
huggingfacemcp_paper_searchSearch Hugging Face Papers by query and return matching papers with abstracts and author information.Read-onlyPaper Search
Search Hugging Face Papers by query and return matching papers with abstracts and author information.
Inputs
querystringrequired- Semantic search query for finding ML research papers.
concise_onlyboolean- Return a 2-sentence abstract summary instead of the full text. Recommended for broad queries that return many results.default
false results_limitnumber- Maximum number of paper results to return.default
12
huggingfacemcp_space_searchSearch Hugging Face Spaces by query and return matching spaces with relevance scores.Read-onlySpace Search
Search Hugging Face Spaces by query and return matching spaces with relevance scores.
Inputs
querystringrequired- Semantic search query for finding Hugging Face Spaces.
limitnumber- Maximum number of Space results to return.default
10 mcpboolean- Set to true to return only MCP Server-enabled Spaces. Required when using results with dynamic_space.default
false
huggingfacemcp_dynamic_spaceCall a Hugging Face MCP-enabled Space dynamically.WriteDynamic Space
Call a Hugging Face MCP-enabled Space dynamically. Use 'discover' to list available MCP spaces, 'view_parameters' to inspect a space's tools, or 'invoke' to call a specific tool.
Inputs
operationstring- Action to perform: discover lists available tasks, view_parameters inspects a space, invoke runs it.one of
discoverview_parametersinvoke parametersstring- JSON string of input parameters. Used only with the "invoke" operation.
space_namestring- Space ID in "username/space-name" format. Required for "view_parameters" and "invoke" operations.
huggingfacemcp_gr1_z_image_turbo_generateGenerate an image from a text prompt using the Image Turbo model hosted on Hugging Face Spaces.WriteGr1 Z Image Turbo Generate
Generate an image from a text prompt using the Image Turbo model hosted on Hugging Face Spaces.
Inputs
promptstring- Text prompt describing the desired image content
random_seedboolean- Generate a new random seed for each run. Set to false to use the value in the seed field.default
true resolutionstring- Output resolution in "WIDTHxHEIGHT ( RATIO )" format.one of
1024x1024 ( 1:1 )1152x896 ( 9:7 )896x1152 ( 7:9 )1152x864 ( 4:3 )864x1152 ( 3:4 )1248x832 ( 3:2 )832x1248 ( 2:3 )1280x720 ( 16:9 )720x1280 ( 9:16 )1344x576 ( 21:9 )576x1344 ( 9:21 )1280x1280 ( 1:1 )1440x1120 ( 9:7 )1120x1440 ( 7:9 )1472x1104 ( 4:3 )1104x1472 ( 3:4 )1536x1024 ( 3:2 )1024x1536 ( 2:3 )1536x864 ( 16:9 )864x1536 ( 9:16 )1680x720 ( 21:9 )720x1680 ( 9:21 )1536x1536 ( 1:1 )1728x1344 ( 9:7 )1344x1728 ( 7:9 )1728x1296 ( 4:3 )1296x1728 ( 3:4 )1872x1248 ( 3:2 )1248x1872 ( 2:3 )2048x1152 ( 16:9 )1152x2048 ( 9:16 )2016x864 ( 21:9 )864x2016 ( 9:21 )default1024x1024 ( 1:1 ) seedinteger- Seed value for reproducible image generation. Ignored when random_seed is true.default
42 shiftnumber- Time shift parameter for the flow matching scheduler. Controls generation quality.default
3 stepsnumber- Number of inference steps for the diffusion process. Higher values improve quality but take longer.default
8
huggingfacemcp_hf_hub_queryAsk a natural language question about the Hugging Face Hub and get an AI-generated answer.WriteHf Hub Query
Ask a natural language question about the Hugging Face Hub and get an AI-generated answer.
Inputs
messagestringrequired- Natural language query to run against the Hugging Face Hub.
No tools match.