Skip to main content
Glama
hf-model-explorer-mcp

hf-model-explorer-mcp

by Greekkgod

hf-model-explorer-mcp

An MCP server that lets AI agents search, compare, and right-size Hugging Face models — including estimating whether a model will actually fit in your available GPU VRAM before you download 15GB of weights and find out the hard way.

Works with any MCP-compatible client: Claude, Google Antigravity, Cursor, and others.

Why

Picking a model off Hugging Face usually means checking the model card, guessing at parameter count, mentally doing GB-per-precision math, and hoping it fits your GPU. This wraps that into tools an agent can call directly, so you can ask things like:

"Find me a small instruction-tuned model I can run locally on a 12GB GPU"

and get an actual, sized answer instead of a guess.

Related MCP server: nodegrove VRAM: can I run it?

Tools

Tool

What it does

search_models

Search HF Hub by query and task, sorted by downloads/likes/recency

get_model_details

Full details on one model: params, license, tags, task

compare_models

Side-by-side comparison of 2–4 models

check_hardware_fit

Estimates VRAM needed at fp32/fp16/int8/int4 and whether it fits your GPU

find_similar_models

Finds lighter/heavier/similar-sized alternatives for the same task

Install

pip install hf-model-explorer-mcp

Or run directly without installing, via uvx:

uvx hf-model-explorer-mcp

Configure

Claude Desktop / Claude Code

Add to your MCP config (claude_desktop_config.json or .mcp.json):

{
  "mcpServers": {
    "hf-model-explorer": {
      "command": "uvx",
      "args": ["hf-model-explorer-mcp"]
    }
  }
}

Google Antigravity

Add to ~/.gemini/antigravity/mcp_config.json (path may vary by Antigravity version — check Settings → MCP Servers in the IDE):

{
  "mcpServers": {
    "hf-model-explorer": {
      "command": "uvx",
      "args": ["hf-model-explorer-mcp"]
    }
  }
}

Example

User: I want to run an instruction-tuned 7B-ish model locally. I have a 12GB GPU.

Agent calls: search_models(query="instruct", task="text-generation")
Agent calls: check_hardware_fit(model_id="mistralai/Mistral-7B-Instruct-v0.2", available_vram_gb=12)

→ {
    "parameters": "7.0B",
    "recommended_precision": "fp16",
    "estimated_vram_by_precision_gb": { "fp16": 15.65, "int8": 7.82, "int4": 3.91 },
    "fits": true
  }

How hardware-fit estimation works

Parameter count comes from the model's safetensors metadata on the Hub. Memory is estimated as params × bytes_per_param × 1.2 (a 20% overhead margin for activations and KV-cache), using standard bytes-per-parameter figures:

Precision

Bytes/param

fp32

4.0

fp16 / bf16

2.0

int8

1.0

int4

0.5

This is an estimate, not a guarantee — actual usage varies by framework, batch size, and context length. Models without safetensors metadata return an explicit "unknown" rather than a guessed number.

Development

git clone https://github.com/YOUR_USERNAME/hf-model-explorer-mcp
cd hf-model-explorer-mcp
pip install -e ".[dev]"
pytest

All 23 tests mock the Hugging Face API, so the suite runs offline with no rate limits.

Publishing (for your own fork)

  1. PyPI: python -m build && twine upload dist/*

  2. MCP Registry: update server.json with your GitHub username and package version, then follow the MCP Registry publishing guide to submit it — typically via mcp-publisher authenticated against your GitHub repo.

License

MIT

Available Tools

5 tools
check_hardware_fitA

Estimate whether a Hugging Face model will fit in a given amount of GPU VRAM, and at which precision. Uses the model's parameter count and standard bytes-per-parameter figures for each precision, plus a runtime overhead margin for activations and KV-cache. This is an estimate, not a guarantee — actual usage varies by framework, batch size, and context length.

Args: model_id: the HF model repo id, e.g. "mistralai/Mistral-7B-v0.1" available_vram_gb: available GPU VRAM in gigabytes, e.g. 24 precision: specific precision to check, or "auto" to find the lowest-precision option that fits

Inputs: model_id (required), available_vram_gb (required), precision. Returns: object

compare_modelsA

Compare 2-4 Hugging Face models side by side: parameters, license, downloads, task, and last update.

Args: model_ids: list of 2-4 HF model repo ids to compare

Inputs: model_ids (required). Returns: object

find_similar_modelsA

Find alternative models for the same task as the given model, filtered by relative size (lighter, heavier, or similar-sized alternatives).

Args: model_id: the HF model repo id to find alternatives for variant: "lighter" (fewer params), "heavier" (more params), or "same_size" (roughly comparable) limit: max number of alternatives to return (1-20)

Inputs: model_id (required), limit, variant. Returns: object

get_model_detailsA

Get full details for a single Hugging Face model, including parameter count, license, tags, and pipeline task.

Args: model_id: the HF model repo id, e.g. "meta-llama/Llama-3.1-8B-Instruct"

Inputs: model_id (required). Returns: object

search_modelsA

Search Hugging Face Hub for models matching a query, optionally filtered by task (pipeline_tag), sorted by popularity or recency.

Args: query: free-text search, e.g. "llama instruct" or "sentiment analysis" task: optional HF pipeline tag filter, e.g. "text-generation", "text-classification", "image-classification", "translation" limit: max number of results (1-50) sort_by: "downloads" (default), "likes", or "last_modified"

Inputs: query (required), task, limit, sort_by. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: search, get details, compare, hardware fit, and find similar models. There is no meaningful overlap between them, even though several take model_id as input.

    Naming Consistency5/5

    All tool names follow the same verb_noun snake_case pattern: get_model_details, search_models, compare_models, check_hardware_fit, find_similar_models. The naming is predictable and readable.

    Tool Count5/5

    Five tools is a well-scoped set for a model exploration server. Each tool adds a distinct capability without redundancy or bloat.

    Completeness5/5

    The server covers the full exploration workflow: discovering models via search, inspecting individual models, comparing models, checking hardware compatibility, and finding alternatives. No obvious gaps exist for its stated purpose.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      4
      52 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Checks whether an open-weight LLM fits your GPU: VRAM for weights, KV cache and overhead at each quantisation, a tokens-per-second ceiling, the longest context that fits, and what would work instead when it doesn't. Reads any Hugging Face repo's config.json. Free, read-only, no API key.
      6
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Tell your AI agent what you want a model to do. It searches Hugging Face for each part of the job and tells you which parts already exist there: which are an exact fit, which to fine-tune, which to train, and which are just code. Every model it names is real, current, and sized for your hardware.
      3
      370 npm
      1
      MIT