Hugging face MCP connector
OAuth 2.1/DCR AIDeveloper ToolsConnect to Hugging Face MCP. Search and manage models, datasets, spaces, and collections on the Hugging Face Hub.
Hugging face MCP connector
-
Install the SDK
Section titled “Install the SDK”Terminal window npm install @scalekit-sdk/nodeTerminal window pip install scalekit -
Set your credentials
Section titled “Set 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> -
Authorize and make your first call
Section titled “Authorize and make your first call”quickstart.ts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENV_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)process.stdout.write('Press Enter after authorizing...')await new Promise(r => process.stdin.once('data', r))// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'huggingfacemcp_hf_whoami',toolInput: {},})console.log(result)quickstart.py import osfrom scalekit.client import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENV_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)
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Search space, paper, hub repo — Search Hugging Face Spaces by query and return matching spaces with relevance scores
- Details hub repo — Retrieve details for one or more Hugging Face Hub repositories by their IDs
- Whoami hf — Return the currently authenticated Hugging Face user’s profile information
- Query hf hub — Ask a natural language question about the Hugging Face Hub and get an AI-generated answer
- Fetch hf doc — Fetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination
- Generate gr1 z image turbo — Generate an image from a text prompt using the Image Turbo model hosted on Hugging Face Spaces
Tool list
Section titled “Tool list”Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.
huggingfacemcp_dynamic_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. 3 params
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.
operation string optional Action to perform: discover lists available tasks, view_parameters inspects a space, invoke runs it. parameters string optional JSON string of input parameters. Used only with the "invoke" operation. space_name string optional Space ID in "username/space-name" format. Required for "view_parameters" and "invoke" operations. huggingfacemcp_gr1_z_image_turbo_generate
#
Generate an image from a text prompt using the Image Turbo model hosted on Hugging Face Spaces. 6 params
Generate an image from a text prompt using the Image Turbo model hosted on Hugging Face Spaces.
prompt string optional Text prompt describing the desired image content random_seed boolean optional Generate a new random seed for each run. Set to false to use the value in the seed field. resolution string optional Output resolution in "WIDTHxHEIGHT ( RATIO )" format. seed integer optional Seed value for reproducible image generation. Ignored when random_seed is true. shift number optional Time shift parameter for the flow matching scheduler. Controls generation quality. steps number optional Number of inference steps for the diffusion process. Higher values improve quality but take longer. huggingfacemcp_hf_doc_fetch
#
Fetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination. 2 params
Fetch the content of a Hugging Face documentation page by URL, with optional character offset for pagination.
doc_url string required Full URL of the Hugging Face or Gradio documentation page to fetch. offset number optional Token offset for paginating large documents. Use the offset value from the truncation message to fetch the next chunk. huggingfacemcp_hf_doc_search
#
Search Hugging Face documentation across all products or a specific product by query. 2 params
Search Hugging Face documentation across all products or a specific product by query.
query string required Semantic search query. Use an empty string to explore structure and navigation tips, or provide a specific query to find targeted documentation. product string optional Hugging Face product or library to filter results by. Provide when known to narrow the search. huggingfacemcp_hf_hub_query
#
Ask a natural language question about the Hugging Face Hub and get an AI-generated answer. 1 param
Ask a natural language question about the Hugging Face Hub and get an AI-generated answer.
message string required Natural language query to run against the Hugging Face Hub. huggingfacemcp_hf_whoami
#
Return the currently authenticated Hugging Face user's profile information. 0 params
Return the currently authenticated Hugging Face user's profile information.
huggingfacemcp_hub_repo_details
#
Retrieve details for one or more Hugging Face Hub repositories by their IDs. 7 params
Retrieve details for one or more Hugging Face Hub repositories by their IDs.
repo_ids array required One or more repository IDs in "author/name" format. Supports models, datasets, and spaces. config string optional Dataset Viewer config name. Required for dataset_preview when the dataset has multiple configs. Discover available configs via dataset_structure. limit integer optional Number of rows to return for dataset_preview. Defaults to 5; clamped between 1 and 100. offset integer optional Row offset for dataset_preview pagination. Defaults to 0. operations array optional Details to return. Defaults to ["overview"]. For datasets, use ["overview", "dataset_structure"] first, then ["dataset_preview"] with config and split. repo_type string optional Repository type to look up. Auto-detected when omitted. split string optional Dataset split name. Required for dataset_preview when the dataset has multiple splits. Discover available splits via dataset_structure. huggingfacemcp_hub_repo_search
#
Search the Hugging Face Hub for models, datasets, or spaces with optional filters for author, task, and sort order. 6 params
Search the Hugging Face Hub for models, datasets, or spaces with optional filters for author, task, and sort order.
author string optional Organization or user namespace to filter results by. filters array optional Hub filter tags to apply to each selected repo type. Supports task tags, language codes, and framework tags. limit number optional Maximum number of results to return per selected repository type. Clamped between 1 and 100. query string optional Search term for repositories. Leave blank with sort + limit set to browse trending or recent repos. repo_types array optional Repository types to include in the search. Defaults to model and dataset. space uses keyword search. sort string optional Sort order for results, applied in descending order. huggingfacemcp_paper_search
#
Search Hugging Face Papers by query and return matching papers with abstracts and author information. 3 params
Search Hugging Face Papers by query and return matching papers with abstracts and author information.
query string required Semantic search query for finding ML research papers. concise_only boolean optional Return a 2-sentence abstract summary instead of the full text. Recommended for broad queries that return many results. results_limit number optional Maximum number of paper results to return. huggingfacemcp_space_search
#
Search Hugging Face Spaces by query and return matching spaces with relevance scores. 3 params
Search Hugging Face Spaces by query and return matching spaces with relevance scores.
query string required Semantic search query for finding Hugging Face Spaces. limit number optional Maximum number of Space results to return. mcp boolean optional Set to true to return only MCP Server-enabled Spaces. Required when using results with dynamic_space.