Local AI MCP

v0.6.1
io.github.TMHSDigital/local-ai-mcp Checked 3 days ago Published 1 month ago

Run, fit, and route work to local LLMs (Ollama, LM Studio, llama.cpp, MLX, vLLM, and more).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_providers List providers

List configured model runtimes (Ollama, LM Studio, llama.cpp, Docker Model Runner, and any opt-in MLX / vLLM / Foundry Local / OpenAI-compatible / hosted instances) with host, kind (local or hosted), live status, and capabilities.

ParameterTypeDescription
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

list_models List installed models

List models installed/available on each live provider, keyed by provider. Pass provider to query just one.

ParameterTypeDescription
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

list_loaded List loaded models

List models currently loaded into memory on each live provider, with VRAM use and context length where the runtime reports them.

ParameterTypeDescription
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

model_info Model info

Detailed metadata for one model (family, parameter size, quantization, context length, and layer architecture where available). Without provider, queries the live local providers that have the model.

ParameterTypeDescription
model *stringModel id/name to inspect
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

pull_model Pull model

HEAVY: Download a model onto ONE provider (multiple GB, can take a long time). Streams download progress via MCP progress notifications when the client sends a progressToken. Without provider, uses the provider that already has the model, else the first live local provider that can pull.

ParameterTypeDescription
model *stringModel id/name to pull (e.g. qwen3:8b, hf.co/<repo>:<quant>)
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

remove_model Remove model

DESTRUCTIVE: Permanently delete a model from one provider. provider is REQUIRED (no fan-out). If the client supports elicitation the user is asked to confirm directly; otherwise confirm:true is required.

ParameterTypeDescription
model *stringModel id/name to remove
provider *stringProvider to delete from (required). Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
confirmbooleanMust be true when the client cannot ask the user directly (no elicitation support)

load_model Load model

Load a model into memory on ONE provider so it is ready for inference. Optional keepAlive (e.g. '5m', '1h') and contextLength. Without provider, uses the live local provider that has the model.

ParameterTypeDescription
model *stringModel id/name to load
contextLengthintegerContext window to load with (Ollama num_ctx, LM Studio --context-length)
keepAlivestringHow long to keep the model resident, e.g. '5m'
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

unload_model Unload model

Unload a model from memory to free VRAM/RAM on ONE provider. Without provider, uses the live local provider that has it loaded.

ParameterTypeDescription
model *stringModel id/name to unload
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

ensure_model Ensure model is ready

Make a model ready in one call: optionally pull it, check it fits current free VRAM, unload other models if needed (evict: 'lru' or 'all'), load it, and verify. Use dryRun:true to get the plan without changing anything.

ParameterTypeDescription
model *stringModel id/name
allowPullbooleanDownload the model if it is not installed (default false)
contextLengthintegerContext window to fit and load with (default 4096)
dryRunbooleanReturn the plan only (default false)
evictstringUnload other models to make room: none (default), lru (least recently used first), all
keepAlivestringKeep-alive for the loaded model, e.g. '30m'
kvCacheTypestringKV cache precision used for the fit estimate (default f16)
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

health_check Health check

Check whether each provider is reachable and report its version (and live metrics such as vLLM KV-cache usage). Without provider, checks every configured provider, including hosted ones.

ParameterTypeDescription
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

system_resources System resources

Report local hardware: platform, total/available RAM, CPU count, and GPUs with total/free VRAM (NVIDIA via nvidia-smi, AMD/Intel via sysfs or the Windows registry, Apple Silicon unified memory). Each GPU names its data source.

fit_check Fit check

Will a model run on this machine, and where? Uses the installed model's size and exact layer architecture when the runtime exposes it (else parameter-count or catalog estimates) to size weights + KV cache for a context length, then compares with free VRAM summed across GPUs and available RAM. Returns target gpu / partial (GPU+CPU split) / cpu / none, with the numbers and how the KV estimate was made. Credits back memory the model already uses if it is loaded.

ParameterTypeDescription
model *stringModel id/name to check
contextLengthintegerContext length for the KV-cache estimate (default 4096)
kvCacheTypestringKV cache precision: f16 (default), q8_0, q4_0
parameterSizestringParameter size like "7B" (overrides lookup)
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
sizeBytesnumberExplicit weight size in bytes (overrides lookup)

benchmark Benchmark

HEAVY: Runs REAL inference. Measures a model on this machine with a warmup (absorbs load time) plus N streamed runs: time-to-first-token, generation tokens/sec (runtime-reported when available, else measured after the first token), and prompt-processing speed. Pass models[] to compare several models with the same prompt, ranked by generation speed.

ParameterTypeDescription
maxTokensintegerTokens to generate per run (default 128)
modelstringModel id/name to benchmark
modelsarrayCompare several models (ranked by median generation tokens/sec)
promptstringPrompt (default: a short fixed prompt)
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
runsintegerMeasured runs per model (default 3)
warmupbooleanRun a 1-token warmup first so load time is excluded (default true)

search_available Search catalog

Search the built-in curated catalog of well-known local models (Ollama tags) by name, family, or task. Offline and instant. For live results with per-quant fit, use search_models with source 'huggingface'.

ParameterTypeDescription
query *stringSearch text matched against model name, family, and tasks

suggest_model Suggest model

Recommend catalog models for a task, ranked for THIS machine: fully-on-GPU first, then partial GPU offload, then CPU-only. Within a tier the largest (most capable) model comes first unless preferSpeed is true. Flags models already installed on a live provider and explains each pick.

ParameterTypeDescription
task *stringThe task you want a model for
contextLengthintegerContext length to plan for (default 4096)
kvCacheTypestringKV cache precision (default f16)
preferSpeedbooleanPrefer smaller, faster models within each tier

search_models Search models (live)

Find models to download, annotated with whether each fits this machine. source 'huggingface' searches GGUF repos on the Hugging Face Hub and returns per-quant sizes, the best quant for this hardware, and pullable references (Ollama: hf.co/<repo>:<quant>). source 'catalog' searches the offline curated list. The Ollama library has no public search API, so it is not a source.

ParameterTypeDescription
query *stringSearch text, e.g. 'qwen coder' or 'gemma 3'
contextLengthintegerContext length for fit (default 4096)
fitsOnlybooleanOnly return results with a quant that fits
limitintegerMax repos (default 8)
sourcestringDefault huggingface
taskstringCatalog source only: filter by task

complete Delegated completion

DELEGATED INFERENCE: Offload a completion to a model you choose for cost savings and privacy. Without provider, runs on the live LOCAL provider that has the model (never a hosted API unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set); the result's 'provider', 'host' and 'local' fields say where it ran. Supports system prompts, JSON / JSON-Schema output (validated 'parsed' field), seed/topP/topK, image inputs for vision models, and contextLength for long inputs. Streams tokens via MCP progress notifications when the client sends a progressToken.

ParameterTypeDescription
model *stringModel id/name to run the completion on
contextLengthintegerContext window to run with (Ollama num_ctx). Raise it for long inputs to avoid truncation.
maxTokensintegerMaximum tokens to generate
messagesarrayChat messages; content may be a string or text/image parts (vision models)
optionsobjectProvider-specific extras passed through as-is
promptstringPlain prompt text (alternative to messages)
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
repeatPenaltynumber
responseFormatConstrain output to JSON (json_object) or a JSON Schema (json_schema); the result includes a validated 'parsed' value
seedintegerSeed for reproducible sampling
stoparrayStop sequences
streambooleanStream tokens (default true). Progress notifications are sent when the client provides a progressToken.
systemstringSystem instruction
temperaturenumberSampling temperature
topKinteger
topPnumber

embed Delegated embeddings

DELEGATED EMBEDDINGS: Generate embeddings for a string or an array of texts. Without provider, runs on the live local provider that has the model. Always returns one vector per input.

ParameterTypeDescription
input *Text or array of texts to embed
model *stringEmbedding model id/name
providerstringProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).

delegate Delegate a task to the best local model

ONE CALL to offload work locally: pick the best model for a task on THIS machine, make it ready, and run it. Prefers models already loaded (no load cost), then installed models that fit your free VRAM, then (with allowPull) the best catalog model that fits. Task specialists (coder, vision, reasoning) win over general models; then larger fitting models win, grouped into size tiers (within ~20% parameter count); inside a tier, the model benchmarked fastest on this machine wins (run benchmark to record speeds; results expire after 14 days). Never uses a hosted provider unless allowHosted is true.…

ParameterTypeDescription
task *stringWhat kind of work this is
allowHostedbooleanAllow hosted providers (default false)
allowPullbooleanDownload a catalog model if nothing suitable is installed (default false)
contextLengthintegerContext window to run with (Ollama num_ctx). Raise it for long inputs to avoid truncation.
maxSizeBytesnumberIgnore models larger than this
maxTokensintegerMaximum tokens to generate
messagesarrayChat messages; content may be a string or text/image parts (vision models)
optionsobjectProvider-specific extras passed through as-is
promptstringPlain prompt text (alternative to messages)
providerstringRestrict to one provider. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
repeatPenaltynumber
responseFormatConstrain output to JSON (json_object) or a JSON Schema (json_schema); the result includes a validated 'parsed' value
seedintegerSeed for reproducible sampling
stoparrayStop sequences
streambooleanStream tokens (default true). Progress notifications are sent when the client provides a progressToken.
systemstringSystem instruction
temperaturenumberSampling temperature
topKinteger
topPnumber