Local Model MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOCAL_MODEL_MCP_ROOT | No | Workspace root directory to use when the --root command-line option is not provided. If unset, the native workspace directory is used. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Manage local Hugging Face causal language models. Start with capabilities and inventory. Create a dataset, launch a fine-tune, poll job_status, then evaluate on held-out data. For direct tensor edits, inspect exact names, preview_weight_edits, and pass the returned plan_token to apply_weight_edits with an unused output name. All operations are local. Original checkpoints are preserved. LoRA training returns an adapter; use its base model plus adapter for evaluation/generation, or merge it into a standalone model. Weight changes are numerical interventions; validate behavior with evaluation and generation.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| capabilitiesA | Report supported formats, hardware, workspace, and operational limits. |
| inventoryA | List up to 200 names per category: models, datasets, and tensor assets. |
| inspect_modelA | Page through tensor names, shapes, dtypes, and shards without reading weight data. |
| read_tensorB | Read tensor statistics and a bounded flat sample. ranges are [start, stop] per axis. |
| create_datasetB | Create a new JSONL dataset from text or chat examples. Existing names are rejected. |
| inspect_datasetB | Validate a dataset and report row formats and character counts, without text. |
| create_tensor_assetA | Save named float32 arrays for replacement, additive, or low-rank edits. Max 1M values. Example: tensors={"left": [[1.0], [0.0]], "right": [[0.1, 0.2]]}. For larger assets, place a safetensors file directly in workspace/tensors (max 256 MiB). |
| preview_weight_editsA | Simulate edits and return statistics and a token bound to weights, assets, and edits. value means scalar for scale/add/set, or standard deviation for noise. low_rank applies W += alpha * (left @ right). Ranges use exclusive stops; omit for the whole tensor. Tensor asset shapes must match exactly. This reads each affected shard into CPU memory. |
| apply_weight_editsA | Apply a previewed numerical edit into a new checkpoint. Pass preview's plan_token. The original is preserved. Stale plans, existing output names, invalid shapes, and nonfinite results are rejected. Copies all checkpoint bytes before modifying them. |
| compare_weightsB | Compute changed element counts and delta norms for selected, equally shaped tensors. |
| start_fine_tuneA | Launch local LoRA or full-parameter training; return a job ID after validating inputs. Training cycles shuffled examples until max_steps optimizer steps. Every nonpadding next token contributes to loss, including chat prompt tokens. No assistant-only masking. Dtype bfloat16 uses autocast with float32 trainable weights. LoRA saves an adapter. |
| start_evaluationB | Launch token-weighted next-token loss and perplexity evaluation; poll job_status. |
| start_generationB | Launch a local raw-text completion. temperature=0 selects greedy decoding. |
| merge_adapterA | Launch a LoRA merge into a new standalone model; preserve the base and adapter. |
| job_statusB | Read persistent status, progress, results, and a bounded worker log tail. |
| list_jobsB | List the most recent 100 persistent jobs; workers can outlive a server restart. |
| cancel_jobA | Request cooperative cancellation. Poll until terminal; no partial model is published. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 17 tools
Each tool targets a distinct resource and action: model inspection, tensor reading, dataset creation, tensor-asset creation, weight-edit preview/apply/compare, job management, training, evaluation, generation, and adapter merging are all clearly separated. Paired tools like preview_weight_edits and apply_weight_edits are explicitly linked by the preview token, so their boundary is clear rather than ambiguous.
Most tools follow a predictable snake_case verb_noun pattern (merge_adapter, list_jobs, inspect_model, create_dataset, apply_weight_edits, start_fine_tune, cancel_job). A few names deviate by being noun-only or noun_noun (job_status, capabilities, inventory), but the overall convention is still readable and mostly consistent.
The server covers a broad local-model workflow, and the 17 tools are largely nonredundant, each earning a place across job management, inspection, editing, training, evaluation, generation, and merging. The count is slightly above the typical 3-15 range, but it is reasonable for this multi-stage domain rather than bloated.
The surface covers the main lifecycle: capabilities/inventory, model and tensor inspection, dataset and tensor-asset creation, weight-edit preview/apply/compare, fine-tuning, evaluation, generation, adapter merge, and job status/list/cancel. Minor gaps remain around deleting or updating datasets/assets and purging jobs, but core workflows are workable without dead ends.