Local AI MCP
概览
作者提供的说明(英文原文)
Run, fit, and route work to local LLMs (Ollama, LM Studio, llama.cpp, MLX, vLLM, and more).
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i起步阶段↓ 484/周 · ★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 搜索与 AI 记忆
- 你需要填写:VLLM_API_KEY, OPENAI_COMPAT_API_KEY, MOONSHOT_API_KEY
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 需要你自己填写:
OLLAMA_HOST,LMSTUDIO_HOST,LLAMACPP_HOST,DOCKER_MODEL_RUNNER_HOST,MLX_HOST,VLLM_HOST,VLLM_API_KEY,FOUNDRY_LOCAL_HOST,OPENAI_COMPAT_HOST,OPENAI_COMPAT_API_KEY,MOONSHOT_API_KEY,LOCAL_AI_ALLOW_HOSTED_FALLBACK,MOONSHOT_HOST,LOCAL_AI_DISABLE,LOCAL_AI_PROVIDERS,LOCAL_AI_DISABLE_NETWORK_SEARCH,LOCAL_AI_BENCHMARK_CACHE
标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"local-ai": {
"command": "npx",
"args": [
"-y",
"@tmhs/local-ai-mcp"
],
"env": {
"OLLAMA_HOST": "your-value",
"LMSTUDIO_HOST": "your-value",
"LLAMACPP_HOST": "your-value",
"DOCKER_MODEL_RUNNER_HOST": "your-value",
"MLX_HOST": "your-value",
"VLLM_HOST": "your-value",
"VLLM_API_KEY": "your-value",
"FOUNDRY_LOCAL_HOST": "your-value",
"OPENAI_COMPAT_HOST": "your-value",
"OPENAI_COMPAT_API_KEY": "your-value",
"MOONSHOT_API_KEY": "your-value",
"LOCAL_AI_ALLOW_HOSTED_FALLBACK": "your-value",
"MOONSHOT_HOST": "your-value",
"LOCAL_AI_DISABLE": "your-value",
"LOCAL_AI_PROVIDERS": "your-value",
"LOCAL_AI_DISABLE_NETWORK_SEARCH": "your-value",
"LOCAL_AI_BENCHMARK_CACHE": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add local-ai --env OLLAMA_HOST=your-value --env LMSTUDIO_HOST=your-value --env LLAMACPP_HOST=your-value --env DOCKER_MODEL_RUNNER_HOST=your-value --env MLX_HOST=your-value --env VLLM_HOST=your-value --env VLLM_API_KEY=your-value --env FOUNDRY_LOCAL_HOST=your-value --env OPENAI_COMPAT_HOST=your-value --env OPENAI_COMPAT_API_KEY=your-value --env MOONSHOT_API_KEY=your-value --env LOCAL_AI_ALLOW_HOSTED_FALLBACK=your-value --env MOONSHOT_HOST=your-value --env LOCAL_AI_DISABLE=your-value --env LOCAL_AI_PROVIDERS=your-value --env LOCAL_AI_DISABLE_NETWORK_SEARCH=your-value --env LOCAL_AI_BENCHMARK_CACHE=your-value -- npx -y @tmhs/local-ai-mcp运行前请先填写空着的值。
或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"local-ai": {
"command": "npx",
"args": [
"-y",
"@tmhs/local-ai-mcp"
],
"env": {
"OLLAMA_HOST": "your-value",
"LMSTUDIO_HOST": "your-value",
"LLAMACPP_HOST": "your-value",
"DOCKER_MODEL_RUNNER_HOST": "your-value",
"MLX_HOST": "your-value",
"VLLM_HOST": "your-value",
"VLLM_API_KEY": "your-value",
"FOUNDRY_LOCAL_HOST": "your-value",
"OPENAI_COMPAT_HOST": "your-value",
"OPENAI_COMPAT_API_KEY": "your-value",
"MOONSHOT_API_KEY": "your-value",
"LOCAL_AI_ALLOW_HOSTED_FALLBACK": "your-value",
"MOONSHOT_HOST": "your-value",
"LOCAL_AI_DISABLE": "your-value",
"LOCAL_AI_PROVIDERS": "your-value",
"LOCAL_AI_DISABLE_NETWORK_SEARCH": "your-value",
"LOCAL_AI_BENCHMARK_CACHE": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"local-ai": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@tmhs/local-ai-mcp"
],
"env": {
"OLLAMA_HOST": "your-value",
"LMSTUDIO_HOST": "your-value",
"LLAMACPP_HOST": "your-value",
"DOCKER_MODEL_RUNNER_HOST": "your-value",
"MLX_HOST": "your-value",
"VLLM_HOST": "your-value",
"VLLM_API_KEY": "your-value",
"FOUNDRY_LOCAL_HOST": "your-value",
"OPENAI_COMPAT_HOST": "your-value",
"OPENAI_COMPAT_API_KEY": "your-value",
"MOONSHOT_API_KEY": "your-value",
"LOCAL_AI_ALLOW_HOSTED_FALLBACK": "your-value",
"MOONSHOT_HOST": "your-value",
"LOCAL_AI_DISABLE": "your-value",
"LOCAL_AI_PROVIDERS": "your-value",
"LOCAL_AI_DISABLE_NETWORK_SEARCH": "your-value",
"LOCAL_AI_BENCHMARK_CACHE": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
需要你填写的值
OLLAMA_HOSTenvOllama base URLLMSTUDIO_HOSTenvLM Studio server base URLLLAMACPP_HOSTenvllama.cpp server (llama-server) base URLDOCKER_MODEL_RUNNER_HOSTenvDocker Model Runner host TCP endpointMLX_HOSTenvmlx_lm.server base URL (opt-in; Apple Silicon)VLLM_HOSTenvvLLM OpenAI server base URL (opt-in)- Bearer token for VLLM_HOST (when vLLM runs with --api-key)
FOUNDRY_LOCAL_HOSTenvFoundry Local service URL (opt-in; port from `foundry service status`)OPENAI_COMPAT_HOSTenvAny OpenAI-compatible /v1 server (opt-in)- Bearer token for OPENAI_COMPAT_HOST
- Moonshot AI (Kimi) key. Hosted: only used when named explicitly.
LOCAL_AI_ALLOW_HOSTED_FALLBACKenvAllow implicit routing to hosted providers (default: off)MOONSHOT_HOSTenvMoonshot API base URLLOCAL_AI_DISABLEenvComma-separated provider names to skip probingLOCAL_AI_PROVIDERSenvJSON array of extra provider instances: {type, host, name?, apiKey?, kind?}LOCAL_AI_DISABLE_NETWORK_SEARCHenvKeep search_models offline (catalog only)LOCAL_AI_BENCHMARK_CACHEenvBenchmark results file used to rank delegate by measured speed (default: per-user cache dir; off disables)
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月9日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 TMHSDigital 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“搜索与 AI 记忆”中的其他服务器比较i
- 星标数多于此分类中其他 5732 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 5732 个服务器的 87% 更新
- 基础检查结果等于或优于此分类中其他 5732 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Local AI MCP 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
你需要填写:VLLM_API_KEY, OPENAI_COMPAT_API_KEY, MOONSHOT_API_KEY
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(0.6.1)于5天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:Context7, Codebase Memory, Exa
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Codebase Memory
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Exa
Connect AI agents to Exa for web search, content fetching, and multi-step research.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Local AI MCP
One MCP server for every local model runtime on your machine. It knows what fits your GPU, and it never sends a prompt to the cloud unless you tell it to.
Local AI MCP gives your agent (Claude, Cursor, VS Code, and others) one control plane for Ollama, LM Studio, llama.cpp, Docker Model Runner, MLX, vLLM and Foundry Local. Your agent can see what's installed and loaded, check what will actually fit in your VRAM, get models ready, and hand work off to the best local model with a single delegate call.
# illustrative session
You: Summarise these 40 pages of meeting notes locally, I don't want them in the cloud. Agent: → delegate { task: "summarize", prompt: "...", contextLength: 32768 } ← routing: ollama / qwen3:14b — already loaded (no load cost); general model; fits: gpu local: true · 412 tokens · 38 tok/s
Why use it
- It knows your hardware.
fit_checksizes the KV cache from the model's actual layer architecture, adds up VRAM across GPUs, models partial GPU/CPU offload, and understands Apple Silicon unified memory. It answers "will this model run, and where?" with numbers rather than guesses. - It works across runtimes. If you run Ollama *and* LM Studio, each call goes to the runtime that actually has the model. Lifecycle actions such as pull, load and unload affect exactly one runtime.
- It keeps data local by default. Hosted providers such as Moonshot are opt-in, and a call without a
providerargument never uses one. Every result reportsprovider,hostandlocal, so you can see where inference ran. - It handles operations, not just chat. Pull with progress, load with a context size, evict least-recently-used models to make room, benchmark time-to-first-token and tokens per second, and search Hugging Face for GGUF quantizations that fit your machine.
Things to ask your agent
- "What can I run for coding on this laptop?" →
suggest_model, thenensure_model - "Free up my GPU." →
list_loaded, thenunload_model(or use thefree-vramprompt) - "Benchmark my installed coder models and tell me which is fastest." →
benchmark { models: [...] } - "Find a newer Gemma build that fits my 12 GB card." →
search_models { source: "huggingface" } - "Extract the invoice fields from this text as JSON, locally." →
delegate { task: "extract", responseFormat: { type: "json_schema", ... } } - "Will Llama 3.1 70B run here with 32K context?" →
fit_check { model, contextLength: 32768 }
Quick start
Install at least one runtime (Ollama, LM Studio, llama.cpp, Docker Model Runner, MLX, vLLM or Foundry Local), then add the server to your client. No configuration is needed for runtimes on their default ports.
Claude Code
claude mcp add local-ai -- npx -y @tmhs/local-ai-mcp
Claude Desktop. Download the .mcpb file from the latest release and open it. You get a settings screen for hosts and no JSON to edit. Alternatively, add this to claude_desktop_config.json:
{
"mcpServers": { "local-ai": { "command": "npx", "args": ["-y", "@tmhs/local-ai-mcp"] } } }
Cursor / VS Code. Use the install buttons above, or add the same command/args to .cursor/mcp.json or .vscode/mcp.json (VS Code uses a top-level "servers" key instead of "mcpServers").
Windsurf, Cline, Zed and other clients. Any stdio MCP client works: the command is npx, the args are ["-y", "@tmhs/local-ai-mcp"].
Windows: a few clients can't launch
npxdirectly. If the server doesn't start, use"command": "cmd", "args": ["/c", "npx", "-y", "@tmhs/local-ai-mcp"].
Adding a hosted provider (optional). Put MOONSHOT_API_KEY in the server's env. It is only used when a tool call names provider: "moonshot", unless you also set LOCAL_AI_ALLOW_HOSTED_FALLBACK=1.
Supported runtimes
| Runtime | Enabled | Default host | List / loaded | Pull | Load / unload | Remove | Embed | Notes |
|---|---|---|---|---|---|---|---|---|
| Ollama | always | localhost:11434 | ✓ / ✓ | ✓ progress | ✓ (keep_alive, num_ctx) | ✓ | ✓ | Native /api/chat: contextLength sets num_ctx, exact timings, JSON-schema format |
| LM Studio | always | localhost:1234 | ✓ / ✓ | ✓ via lms | ✓ via lms (TTL, context) | ✓ via lms | ✓ | Lifecycle needs the lms CLI; without it, models load on first request |
llama.cpp (llama-server) | always | localhost:8080 | ✓ / ✓ (/slots) | – | – | – | ✓ | One model per server; start with --embeddings for embed |
| Docker Model Runner | always | localhost:12434 | ✓ / – | ✓ progress | on first request | ✓ | ✓ | Enable host-side TCP support in Docker Desktop |
MLX (mlx_lm.server) | MLX_HOST | – | ✓ / – | – | on first request | – | – | Apple Silicon; switches models per request |
| vLLM | VLLM_HOST | – | ✓ / ✓ | – | – | – | ✓ | health_check reports KV-cache usage and queue depth from /metrics |
| Foundry Local | FOUNDRY_LOCAL_HOST | dynamic port | ✓ / ✓ | ✓ progress | ✓ (TTL) | – | – | Find the port with foundry service status |
| OpenAI-compatible (Jan, LocalAI, …) | OPENAI_COMPAT_HOST | – | ✓ / ✓ | – | – | – | ✓ | Local or hosted, inferred from the host |
| Moonshot AI (Kimi) | MOONSHOT_API_KEY | api.moonshot.ai/v1 | ✓ / – | – | – | – | – | Hosted: never selected implicitly |
You can run more than one instance of a runtime, for example a second Ollama box on your LAN, with LOCAL_AI_PROVIDERS='[{"type":"ollama","name":"ollama-gpu2","host":"http://192.168.1.20:11434"}]'. Use LOCAL_AI_DISABLE=lmstudio,dockermodelrunner to skip probing runtimes you don't use.
Privacy model
- Each provider is either local or hosted. The kind is inferred from its host: loopback, private LAN ranges,
*.local, Tailscale CGNAT andhost.docker.internalcount as local. You can override it per instance inLOCAL_AI_PROVIDERS. - With no
providerargument,complete,embed,delegate,benchmark,load_modeland the other model-scoped tools only consider live local providers that have the model. If the model exists only on a hosted provider, the call fails and tells you how to opt in. - Hosted providers are never probed on routine calls. Only
health_checkanddiagnosticscontact them. search_modelswithsource: "huggingface"queries the Hugging Face Hub, and only when you ask it to. SetLOCAL_AI_DISABLE_NETWORK_SEARCH=1to forbid it.- The server uses stdio only. It never opens a network listener.
Tools (19)
Every tool declares MCP annotations (read-only, destructive, open-world) and an output schema, and returns structured content.
| Group | Tool | What it does |
|---|---|---|
| Discovery | list_providers | Configured runtimes: kind (local/hosted), live status, capabilities |
list_models | Installed models on each live provider | |
list_loaded | Models resident in memory, with VRAM use and context length | |
model_info | Family, size, quantization, context length and layer architecture | |
| Lifecycle | pull_model | Heavy. Downloads to one provider, streaming progress notifications. background: true returns a job id instead |
pull_status / pull_cancel | Check or stop background pulls | |
remove_model | Destructive. provider is required; asks you directly through MCP elicitation when the client supports it, otherwise needs confirm: true | |
load_model / unload_model | One provider, with optional keepAlive and contextLength | |
ensure_model | Pull (if allowed), fit check, evict others (lru / all), load and verify. dryRun returns the plan only | |
| Ops | health_check | Reachability, version, runtime metrics |
diagnostics | Effective config (keys redacted), per-provider detection with latency and errors, speed cache, hardware probe sources. Paste it into bug reports | |
system_resources | RAM and GPUs (NVIDIA, AMD, Intel, Apple Silicon), each tagged with its data source | |
fit_check | Returns gpu / partial / cpu / none for a model at a given context length and KV-cache precision | |
benchmark | Heavy. Warmup, then N runs: time-to-first-token, generation and prompt tokens/sec. models: [...] to compare | |
| Registry | search_available | Built-in offline catalog |
suggest_model | Best models for a task on *this* machine: largest that fits on the GPU first, flags installed ones | |
search_models | Live Hugging Face GGUF search with per-quantization fit and pull references (hf.co/ : ) | |
| Delegation | complete | Run a completion on a model you choose: system prompt, JSON / JSON-schema output (validated), seed, sampling, images, contextLength |
embed | Embeddings, always one vector per input | |
delegate | One call: picks the best local model for a task (loaded, then installed and fitting, then optionally pulled; larger size tiers first, with speed measured by benchmark on this machine breaking ties within a tier), runs it, and explains the choice |
Resources: local-ai://system, local-ai://loaded (subscribable; updates when models load or unload), and local-ai://models/{provider}. Prompts: setup, free-vram, benchmark-my-models, pick-model.
Configuration
Every setting is an environment variable, and blank means the default. See .env.example for the full annotated list.
| Variable | Default | Purpose |
|---|---|---|
OLLAMA_HOST, LMSTUDIO_HOST, LLAMACPP_HOST, DOCKER_MODEL_RUNNER_HOST | standard local ports | Always-on runtimes |
MLX_HOST, VLLM_HOST (+VLLM_API_KEY), FOUNDRY_LOCAL_HOST, OPENAI_COMPAT_HOST (+OPENAI_COMPAT_API_KEY) | unset | Opt-in runtimes |
LOCAL_AI_PROVIDERS | unset | JSON array of extra instances {type, host, name?, apiKey?, kind?} |
LOCAL_AI_DISABLE | unset | Comma-separated types or names to skip |
MOONSHOT_API_KEY, MOONSHOT_HOST | unset, https://api.moonshot.ai/v1 | Hosted Moonshot provider |
LOCAL_AI_ALLOW_HOSTED_FALLBACK | off | Let calls without a provider use hosted providers |
LOCAL_AI_DISABLE_NETWORK_SEARCH | off | Forbid Hugging Face search |
LOCAL_AI_BENCHMARK_CACHE | per-user cache dir | Where benchmark results are kept for delegate ranking (expire after 14 days); off disables |
LOCAL_AI_REQUEST_TIMEOUT_MS | 120000 | Non-streamed requests |
LOCAL_AI_DETECT_TIMEOUT_MS | 1500 | Detection probes |
LOCAL_AI_PULL_TIMEOUT_MS | 3600000 | Downloads (0 = no limit) |
LOCAL_AI_STREAM_IDLE_TIMEOUT_MS | 60000 | Abort a stream only if no token arrives for this long |
| LOCAL_AI_STREAM_MAX_MS | 1800000 | Hard cap on a streamed completion
只显示了开头部分;其余内容请在仓库中阅读