mcp-hfspace
This server connects to Hugging Face Spaces for various AI tasks:
Image Generation: Generate images using FLUX.1-schnell with customizable parameters (seed, dimensions, steps).
File Management: List and manage files in the working directory with details like name, size, and last modified date.
Advanced AI Models: Access chat models (Qwen2.5-72B-Instruct), text-to-speech (parler-tts), speech-to-text (whisper-large-v3-turbo), and vision models (OmniParser, paligemma2-vqav2).
Custom Configuration: Use Hugging Face tokens for private spaces access and specify custom API endpoints for tailored interactions.
Connects to Hugging Face Spaces with minimal setup, providing access to various AI models and services such as image generation, vision tasks, text-to-speech, and speech-to-text capabilities.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-hfspacegenerate an image of a futuristic city skyline at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-hfspace MCP Server 🤗
You can access and configure Hugging Face MCP services directly at https://hf.co/mcp, including Gradio spaces.
This project has been superceded by the official Hugging Face MCP Server and Gradio MCP Endpoints.
Alternatively you can run hf-mcp-server locally as a STDIO Server, or with robust support for SSE, Streaming HTTP and Streaming HTTP JSON Mode. This also runs a local UI for selecting tools and endpoints and supports ToolListChangedNotifications too.
hf.co/mcp
Related MCP server: MCP HuggingFetch
mcp-hfspace
Read the introduction here llmindset.co.uk/resources/mcp-hfspace/
Connect to Hugging Face Spaces with minimal setup needed - simply add your spaces and go!
By default, it connects to black-forest-labs/FLUX.1-schnell providing Image Generation capabilities to Claude Desktop.

Gradio MCP Support
Gradio 5.28 now has integrated MCP Support via SSE:https://huggingface.co/blog/gradio-mcp. Check out whether your target Space is MCP Enabled!
Installation
NPM Package is @llmindset/mcp-hfspace.
Install a recent version of NodeJS for your platform, then add the following to the mcpServers section of your claude_desktop_config.json file:
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace"
]
}Please make sure you are using Claude Desktop 0.78 or greater.
This will get you started with an Image Generator.
Basic setup
Supply a list of HuggingFace spaces in the arguments. mcp-hfspace will find the most appropriate endpoint and automatically configure it for usage. An example claude_desktop_config.json is supplied below.
By default the current working directory is used for file upload/download. On Windows this is a read/write folder at \users\<username>\AppData\Roaming\Claude\<version.number\, and on MacOS it is the is the read-only root: /.
It is recommended to override this and set a Working Directory for handling the upload and download of images and other file-based content. Specify either the --work-dir=/your_directory argument or MCP_HF_WORK_DIR environment variable.
An example configuration for using a modern image generator, vision model and text to speech, with a working directory set is below:
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=/Users/evalstate/mcp-store",
"shuttleai/shuttle-jaguar",
"styletts2/styletts2",
"Qwen/QVQ-72B-preview"
]
}To use private spaces, supply your Hugging Face Token with either the --hf-token=hf_... argument or HF_TOKEN environment variable.
It's possible to run multiple server instances to use different working directories and tokens if needed.
File Handling and Claude Desktop Mode
By default, the Server operates in Claude Desktop Mode. In this mode, Images are returned in the tool responses, while other files are saved in the working folder, their file path is returned as a message. This will usually give the best experience if using Claude Desktop as the client.
URLs can also be supplied as inputs: the content gets passed to the Space.
There is an "Available Resources" prompt that gives Claude the available files and mime types from your working directory. This is currently the best way to manage files.
Example 1 - Image Generation (Download Image / Claude Vision)
We'll use Claude to compare images created by shuttleai/shuttle-3.1-aesthetic and FLUX.1-schnell. The images gets saved to the Work Directory, as well as included in Claude's context window - so Claude can use its vision capabilities.

Example 2 - Vision Model (Upload Image)
We'll use merve/paligemma2-vqav2 space link to query an image. In this case, we specify the filename which is available in the Working Directory: we don't want to upload the Image directly to Claude's context window. So, we can prompt Claude:
use paligemma to find out who is in "test_gemma.jpg" -> Text Output: david bowie

If you are uploading something to Claude's context use the Paperclip Attachment button, otherwise specify the filename for the Server to send directly.
We can also supply a URL. For example : use paligemma to detect humans in https://e3.365dm.com/24/12/1600x900/skynews-taylor-swift-eras-tour_6771083.jpg?20241209000914 -> One person is detected in the image - Taylor Swift on stage.
Example 3 - Text-to-Speech (Download Audio)
In Claude Desktop Mode, the audio file is saved in the WORK_DIR, and Claude is notified of the creation. If not in desktop mode, the file is returned as a base64 encoded resource to the Client (useful if it supports embedded Audio attachments).

Example 4 - Speech-to-Text (Upload Audio)
Here, we use hf-audio/whisper-large-v3-turbo to transcribe some audio, and make it available to Claude.

Example 5 - Image-to-Image
In this example, we specify the filename for microsoft/OmniParser to use, and get returned an annotated Image and 2 separate pieces of text: descriptions and coordinates. The prompt used was use omniparser to analyse ./screenshot.png and use the analysis to produce an artifact that reproduces that screen. DawnC/Pawmatch is also good at this.

Example 6 - Chat
In this example, Claude sets a number of reasoning puzzles for Qwen, and asks follow-up questions for clarification.

Specifying API Endpoint
If you need, you can specify a specific API Endpoint by adding it to the spacename. So rather than passing in Qwen/Qwen2.5-72B-Instruct you would use Qwen/Qwen2.5-72B-Instruct/model_chat.
Claude Desktop Mode
This can be disabled with the option --desktop-mode=false or the environment variable CLAUDE_DESKTOP_MODE=false. In this case, content as returned as an embedded Base64 encoded Resource.
Recommended Spaces
Some recommended spaces to try:
Image Generation
shuttleai/shuttle-3.1-aesthetic
black-forest-labs/FLUX.1-schnell
yanze/PuLID-FLUX
gokaygokay/Inspyrenet-Rembg (Background Removal)
diyism/Datou1111-shou_xin - Beautiful Pencil Drawings
Chat
Qwen/Qwen2.5-72B-Instruct
prithivMLmods/Mistral-7B-Instruct-v0.3
Text-to-speech / Audio Generation
fantaxy/Sound-AI-SFX
parler-tts/parler_tts
Speech-to-text
hf-audio/whisper-large-v3-turbo
(the openai models use unnamed parameters so will not work)
Text-to-music
haoheliu/audioldm2-text2audio-text2music
Vision Tasks
microsoft/OmniParser
merve/paligemma2-vqav2
merve/paligemma-doc
DawnC/PawMatchAI
DawnC/PawMatchAI/on_find_match_click - for interactive dog recommendations
Other Features
Prompts
Prompts for each Space are generated, and provide an opportunity to input. Bear in mind that often Spaces aren't configured with particularly helpful labels etc. Claude is actually very good at figuring this out, and the Tool description is quite rich (but not visible in Claude Desktop).
Resources
A list of files in the WORK_DIR is returned, and as a convenience returns the name as "Use the file..." text. If you want to add something to Claude's context, use the paperclip - otherwise specify the filename for the MCP Server. Claude does not support transmitting resources from within Context.
Private Spaces
Private Spaces are supported with a HuggingFace token. The Token is used to download and save generated content.
Using Claude Desktop
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-hfspace": {
"command": "npx"
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=~/mcp-files/ or x:/temp/mcp-files/",
"--HF_TOKEN=HF_{optional token}"
"Qwen/Qwen2-72B-Instruct",
"black-forest-labs/FLUX.1-schnell",
"space/example/specific-endpint"
(... and so on)
]
}
}
}Known Issues and Limitations
mcp-hfspace
Endpoints with unnamed parameters are unsupported for the moment.
Full translation from some complex Python types to suitable MCP formats.
Claude Desktop
Claude Desktop 0.75 doesn't seem to respond to errors from the MCP Server, timing out instead. For persistent issues, use the MCP Inspector to get a better look at diagnosing what's going wrong. If something suddenly stops working, it's probably due to exhausting your HuggingFace ZeroGPU quota - try again after a short period, or set up your own Space for hosting.
Claude Desktop seems to use a hard timeout value of 60s, and doesn't appear to use Progress Notifications to manage UX or keep-alive. If you are using ZeroGPU spaces, large/heavy jobs may timeout. Check the WORK_DIR for results though; the MCP Server will still capture and save the result if it was produced.
Claude Desktops reporting of Server Status, logging etc. isn't great - use @modelcontextprotocol/inspector to help diagnose issues.
HuggingFace Spaces
If ZeroGPU quotas or queues are too long, try duplicating the space. If your job takes less than sixty seconds, you can usually change the function decorator
@spaces.GPU(duration=20)inapp.pyto request less quota when running the job.Passing HF_TOKEN will make ZeroGPU quotas apply to your (Pro) HF account
If you have a private space, and dedicated hardware your HF_TOKEN will give you direct access to that - no quota's apply. I recommend this if you are using for any kind of Production task.
Third Party MCP Services
Available Tools
3 toolsavailable-filesA
A list of available file and resources. If the User requests things like 'most recent image' or 'the audio' use this tool to identify the intended resource.This tool returns 'resource uri', 'name', 'size', 'last modified' and 'mime type' in a markdown table
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It discloses the return format (markdown table with specific fields) which is valuable behavioral information. However, it doesn't mention important traits like whether this is a read-only operation, if it requires authentication, rate limits, or pagination behavior. The description adds some context but leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise and well-structured in two sentences. The first sentence states the purpose and usage guidelines, while the second specifies the return format. Every word earns its place with zero waste or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description provides the return format which is essential. However, for a tool that lists resources, it doesn't mention important contextual details like whether it returns all files or is filtered/scoped, sorting behavior (especially relevant for 'most recent' queries), or error conditions. The description is adequate but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage. The description doesn't need to explain any parameters, and it appropriately doesn't attempt to do so. A baseline of 4 is appropriate since there are no parameters to document, and the description focuses on its actual purpose rather than parameter details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to list available files and resources, with specific examples of user requests that should trigger its use. It distinguishes itself from sibling tools (FLUX_1-schnell-infer and search-spaces) by focusing on file enumeration rather than inference or space searching. However, it doesn't explicitly contrast with these siblings, keeping it from a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear usage context: 'If the User requests things like 'most recent image' or 'the audio' use this tool to identify the intended resource.' This gives explicit when-to-use guidance with concrete examples. It doesn't mention when NOT to use it or explicitly name alternatives among siblings, preventing a score of 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
FLUX_1-schnell-inferD
Call the FLUX.1-schnell endpoint /infer
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Prompt | |
| seed | No | Seed | |
| randomize_seed | No | Randomize seed | |
| width | No | Width | |
| height | No | Height | |
| num_inference_steps | No | Number of inference steps |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. However, it offers no information about what the tool does (e.g., image generation, inference), side effects, rate limits, authentication needs, or output format. This leaves the agent completely in the dark about the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
While concise with a single sentence, the description is under-specified and fails to convey essential information. It does not front-load key details (e.g., purpose), making it inefficient rather than appropriately concise. The sentence does not earn its place by adding value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a 6-parameter tool with no annotations and no output schema, the description is severely incomplete. It does not explain what the tool does, its inputs/outputs, or behavioral traits, leaving critical gaps for the agent to understand and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with all parameters documented in the input schema (e.g., 'prompt', 'seed', 'width'). The description adds no additional meaning or context beyond what the schema provides, such as explaining how parameters interact or their impact on results. This meets the baseline score of 3 for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Call the FLUX.1-schnell endpoint /infer' is tautological—it restates the tool name without explaining what the tool actually does. It lacks a specific verb and resource (e.g., 'generate images from text prompts using a FLUX model'), making it vague and unhelpful for distinguishing from siblings like 'available-files' or 'search-spaces'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description does not mention context, prerequisites, or exclusions, leaving the agent with no clues about appropriate usage scenarios or how it differs from sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search-spacesA
Use semantic search to find an endpoint on the Hugging Face Spaces service. The search term will usually be 3-7 words describing a task or activity the Person is trying to accomplish. The results are returned in a markdown table. Present all results to the Person. Await specific guidance from the Person before making further Tool calls.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | The semantic search term to use. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that results are returned in markdown table format and provides guidance about presenting results and awaiting further instructions, which adds useful behavioral context. However, it doesn't mention rate limits, authentication requirements, or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured in three sentences, each serving a distinct purpose: stating the tool's function, providing usage guidance, and giving operational instructions. There's no wasted language or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter search tool with no annotations and no output schema, the description provides good coverage of purpose, usage context, and behavioral guidance. It could be more complete by mentioning what happens with no results or error conditions, but it adequately covers the core functionality.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the single 'query' parameter. The description adds some context about the expected format ('3-7 words describing a task or activity'), but doesn't provide additional syntax or format details beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Use semantic search to find an endpoint'), the target resource ('Hugging Face Spaces service'), and distinguishes it from siblings by focusing on semantic search rather than file listing or inference. It provides a complete picture of what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context about when to use this tool ('search term will usually be 3-7 words describing a task or activity'), but doesn't explicitly mention when not to use it or name specific alternatives. The guidance to 'Present all results to the Person' and 'Await specific guidance before making further Tool calls' gives operational context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- Changed
FLUX_1-schnell-infer12 fields changed- changed
Input schema / properties / height / descriptionPrevious value: -"numeric value between 256 and 2048"New value: +"Height" - removed
Input schema / properties / height / maximumRemoved value: -2048 - removed
Input schema / properties / height / minimumRemoved value: -256 - changed
Input schema / properties / num_inference_steps / descriptionPrevious value: -"numeric value between 1 and 50"New value: +"Number of inference steps" - removed
Input schema / properties / num_inference_steps / maximumRemoved value: -50 - removed
Input schema / properties / num_inference_steps / minimumRemoved value: -1 - changed
Input schema / properties / seed / descriptionPrevious value: -"numeric value between 0 and 2147483647"New value: +"Seed" - removed
Input schema / properties / seed / maximumRemoved value: -2147483647 - removed
Input schema / properties / seed / minimumRemoved value: -0 - changed
Input schema / properties / width / descriptionPrevious value: -"numeric value between 256 and 2048"New value: +"Width" - removed
Input schema / properties / width / maximumRemoved value: -2048 - removed
Input schema / properties / width / minimumRemoved value: -256
3 tool updates
- First observed
available-files - First observed
FLUX_1-schnell-infer - First observed
search-spaces
TDQS
Each tool has a clearly distinct purpose: available-files lists local resources, FLUX_1-schnell-infer calls a specific AI model endpoint, and search-spaces finds Hugging Face Spaces. There is no overlap in functionality, making tool selection straightforward for an agent.
The naming is inconsistent with mixed conventions: available-files uses kebab-case, FLUX_1-schnell-infer uses a hybrid with underscores and hyphens, and search-spaces uses kebab-case but differs in style. There is no predictable verb_noun pattern, and the naming appears chaotic without a clear standard.
With only 3 tools, the count feels thin for a server named 'mcp-hfspace' that seems to involve Hugging Face Spaces and file management. This may be borderline insufficient for covering the domain comprehensively, as more operations might be expected for such a scope.
There are significant gaps in the tool surface. For a Hugging Face Spaces server, obvious missing operations include creating, updating, or deleting spaces, managing models, or handling user interactions. The tools only cover listing files, a specific inference call, and searching, leaving core workflows incomplete and likely causing agent failures.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Connect to Hugging Face Hub and thousands of Gradio AI Applications
Turn Claude into a creative studio: DNA-locked characters, images, video, voiceover — 55 tools.
- lightgenOAuthapp.lightgen
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
One workspace of tools for Claude and ChatGPT: connect 600+ apps, generate media, build tools.
Related MCP Servers
- AlicenseCqualityDmaintenanceConnects Claude Desktop to Hugging Face Spaces with minimal setup, enabling capabilities like image generation, vision tasks, text-to-speech, and chat with AI models.3928MIT
- AlicenseBqualityCmaintenanceEnables users to download HuggingFace models through natural language requests with support for file filtering, size limits, and custom download directories. Supports various AI development environments including Claude Desktop, VS Code, and Cursor.4373MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables access to 200,000+ machine learning models through the Hugging Face Inference API. Supports text generation, image creation, classification, translation, speech processing, embeddings, and more AI tasks.-
- AlicenseBqualityDmaintenanceExposes Replicate's FLUX image generation models to Claude, enabling text-to-image generation, image variations, inpainting, and edge-guided creation with 6 different FLUX models.21MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/evalstate/mcp-hfspace'
If you have feedback or need assistance with the MCP directory API, please join our Discord server