mcpField
G
gguf-mcp

gguf-mcp

Local
github.com/arose26AI & Agents0Updated 2w ago

About gguf-mcp

gguf-mcp is an MCP server for inspecting local GGUF and safetensors model files. It reads headers rather than tensor data, helping LLM users check model details and estimate VRAM requirements without uploading files.

Key features

  1. 01Inspect model format and architecture
  2. 02Report parameter and quantization details
  3. 03List tensor names, shapes, and types
  4. 04Estimate weights and KV-cache VRAM
  5. 05Read filtered metadata and configuration

Use cases

  1. 01Check whether a model fits a GPU at a chosen context length
  2. 02Review tensors in a model or selected shards
  3. 03Inspect chat templates and tokenizer settings

MCP support

Exposes model inspection, tensor listing, VRAM estimation, and metadata tools to MCP clients. It operates on local files and does not send them over the network.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"arose26-gguf": {
"command": "npx",
"args": [
"-y",
"gguf-mcp"
]
}
}
}
Run commandnpx -y gguf-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmgguf-mcp0.1.1

Tools

4

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
pathstringYesPath to a .gguf or .safetensors file, a *.safetensors.index.json, or a model directory

Details

From the project README

gguf-mcp

An MCP server that inspects local model files — GGUF and safetensors — so Claude and other LLMs can answer questions about the models on your disk:

  • "What is this .gguf? Architecture, quantization, parameter count?"
  • "Will this model fit in my 12 GB GPU at 8k context?"
  • "What tensors are inside, with what shapes?"
  • "Show me its chat template / RoPE settings / tokenizer config."

Headers only. The parser never touches tensor data, so inspecting a 70 GB model takes milliseconds and a few MiB of I/O. No network, no API keys, no telemetry — your files never leave your machine.

Quick start

Claude Code

claude mcp add gguf -- npx -y gguf-mcp

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "gguf": {
      "command": "npx",
      "args": ["-y", "gguf-mcp"]
    }
  }
}

The same npx invocation works in Cursor, Windsurf, and any other MCP client.

Tools

ToolWhat it does
inspect_modelOne-call summary: format, architecture, parameters, quantization, context length, file size, tensor count
list_tensorsTensor names, shapes, and storage types — filterable (attn, blk.0, ...)
estimate_vramFit check: exact weights size + modeled fp16 KV cache for your chosen context length
get_metadataThe GGUF key-value store (or safetensors __metadata__), filterable by key

Paths can be a .gguf file, a .safetensors file, a *.safetensors.index.json, or a model directory (sharded HuggingFace layouts are aggregated across shards). Extension-less GGUF blobs — like the ones in Ollama's ~/.ollama/models/blobs — are detected by magic bytes.

Design notes

  • Context-friendly by construction. A tokenizer vocabulary is 100k+ strings; metadata arrays are returned as {count, sample} summaries and long strings (chat templates) are truncated with a marker. The full data stays on disk where it belongs.
  • Honest estimates. estimate_vram reports exact on-disk weight bytes plus the standard KV-cache formula (2 × layers × context × KV heads × head dim × 2 bytes), and says what it excludes rather than faking precision.
  • Defensive parsing. Magic checks, version checks (incl. big-endian detection), truncation detection, and sanity caps on header sizes — malformed files produce specific, actionable errors.
  • Zero runtime dependencies beyond the MCP SDK and zod. The GGUF binary reader and safetensors parser are hand-rolled and unit-tested against synthetic files built in the test suite — no fixtures, no downloads.

Development

npm install
npm test                 # offline unit tests (vitest) — synthetic model files
npm run build            # tsc → dist/
node scripts/smoke.mjs   # end-to-end: generates models, drives the server over stdio

Architecture: src/gguf.ts (binary header parser + VRAM math) and src/safetensors.ts (JSON header + shard index) are pure logic with no MCP imports; src/index.ts is the MCP wiring and path/format detection.

Out of scope

Tensor statistics (would require reading data), PyTorch .bin (pickle — unsafe by design), ONNX, and remote HuggingFace queries (HuggingFace has an official MCP server for that).

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.