@fre4x/huggingface
v1.1.13
Published
Hugging Face MCP server for local inference and Hub repository management.
Readme
Hugging Face MCP Server
MCP server for Hugging Face Hub management and local multimodal inference in Node.js.
Tool coverage
Hub management
list_modelsget_model_infolist_repo_filesdownload_filewhoamicreate_repoupload_filesdelete_filesdelete_repo
Local inference
generate_textclassify_textembed_texttranscribe_audiogenerate_speechimage_to_text
Environment variables
HF_TOKENorHUGGINGFACE_ACCESS_TOKEN: Optional for public reads, required for authenticated Hub operations.HF_UPLOAD_ROOTorHUGGINGFACE_UPLOAD_ROOT: Optional safe root forupload_files. Defaults to the current working directory.HF_MODEL_CACHE_DIR: Optional cache directory for local model downloads.HF_LOCAL_MODEL_PATH: Optional local model directory for offline-only runs.HF_ALLOW_REMOTE_MODELS: Set tofalseto force local-only model loading by default.MOCK: Set totruefor offline mock mode.
Path env values (HF_MODEL_CACHE_DIR, HF_LOCAL_MODEL_PATH, HF_UPLOAD_ROOT) support a leading ~ / ~/. The server expands it with os.homedir() — MCP clients do not shell-expand tilde, so this is required for presets like ~/.cache/huggingface/hub on Windows.
Claude Desktop configuration
{
"mcpServers": {
"huggingface": {
"command": "npx",
"args": ["-y", "@fre4x/huggingface"],
"env": {
"HF_TOKEN": "hf_your_access_token",
"HF_UPLOAD_ROOT": "/absolute/path/to/upload-root",
"HF_MODEL_CACHE_DIR": "~/.cache/huggingface/hub",
"HF_LOCAL_MODEL_PATH": "~/.cache/huggingface",
"HF_ALLOW_REMOTE_MODELS": "true"
}
}
}
}Mock mode
MOCK=true npx @fre4x/huggingfaceNotes
- Local inference uses
@huggingface/transformers. - Hub operations use
@huggingface/hub. upload_filesaccepts only local files under the configured upload root. Remote HTTP(S) URLs are rejected.- Local speech-to-text file decoding currently expects local WAV files for filesystem inputs. Remote HTTP(S) audio URLs are passed through directly.
transcribe_audioalways writeshuggingface_transcription_{number}.txtinto the current working directory unlessoutput_diroverrides the destination.
