lmstudio-ollama-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lmstudio-ollama-mcp
npm install -g lmstudio-ollama-mcp
lmstudio-ollama-mcp doctor # or: forge doctor
lmstudio-ollama-mcp "add unit tests for src/utils/logger.ts"Local-first. Private. Free. No API keys required. Frontier models (GPT-4o, Claude 4) are optional — used only as planners while small local models do the work. Alias
forge/forgecodekeeps muscle memory.
Why lmstudio-ollama-mcp
Claude Code / Codex | lmstudio-ollama-mcp | |
Runs on | Cloud API (paid, data leaves machine) | LM Studio · Ollama · llama.cpp (offline, private) |
Cost | $ per token | $0 after model download |
Sub-agents | Single-threaded or cloud parallelism | Hardware-aware local parallelism |
Model choice | Vendor-locked | Any GGUF / OpenAI-compatible model |
Hybrid mode | — | Frontier plans, local executes (optional) |
Sandbox | Cloud container | Your filesystem, your rules |
MCP | — | Ready: bridges local runtimes as MCP tools |
Single sentence: lmstudio-ollama-mcp brings the Claude Code agentic loop — read → plan → edit → verify with tools — to your MacBook, with an intelligent router that sends trivial tasks to a local 7B and hard reasoning to a frontier model only when needed.
Related MCP server: Shared Workspace MCP
Demo
# 1 — Diagnose
lmstudio-ollama-mcp doctor
# Hardware: Apple M3 (8 cores / 16GB) • Recommended: 8 agents
# ● lmstudio (LM Studio) http://localhost:1234/v1 available
# models: gemma-3-12b-qat, qwen3-27b-ud-iq2_s …
lmstudio-ollama-mcp models
# ● lmstudio ▸ gemma-3-12b-qat 6.5GB Q4_0
# ▸ qwen3-27b 7.8GB IQ2_S
# 2 — One-shot
lmstudio-ollama-mcp "refactor src/providers into a registry + add tests. keep public API stable"
# 3 — Parallel (auto-splits into sub-agents)
lmstudio-ollama-mcp --parallel 4 "implement auth module, write tests, and update docs"
# forge alias also works:
forge --parallel 4 "implement auth module, write tests, and update docs"
# 4 — Force a specific model
lmstudio-ollama-mcp --model ollama:qwen2.5-coder:14b "explain this repo's error handling"
lmstudio-ollama-mcp --provider lmstudio --model gemma-3-12b "fix the failing test in tests/tools.test.ts"
# 5 — Interactive
lmstudio-ollama-mcp
# lmstudio-ollama-mcp> add dark mode to docs/index.htmlQuickstart
Prerequisites
Node.js >= 18
One of:
Install
npm install -g lmstudio-ollama-mcp
# aliases also available: forge, forgecode
# or one-off
npx lmstudio-ollama-mcp doctorFirst run
git clone https://github.com/your-org/your-project && cd your-project
lmstudio-ollama-mcp init # creates lmstudio-ollama-mcp.json (also reads forgecode.json for compat)
lmstudio-ollama-mcp doctor # verify providers + hardware
lmstudio-ollama-mcp "list the codebase structure and suggest 3 small improvements"No API keys needed for local-only mode. For hybrid mode (frontier + local), set env:
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...Architecture
┌─────────────────────────────────────────────────────────┐
│ CLI lmstudio-ollama-mcp "task" • doctor • models │
│ aliases: forge, forgecode │
├─────────────────────────────────────────────────────────┤
│ Router (strategy: auto | local-first | frontier-first)│
│ ├─ classify(prompt) → trivial | small | medium | large │
│ └─ thresholds.preferLocalFor: lint/format/test/search │
├─────────────────────────────────────────────────────────┤
│ Orchestrator (decompose → batch by deps → schedule) │
│ ├─ Planner LLM decomposes goal → SubTasks[] │
│ └─ Scheduler (hardware-aware p-limit, preserves order) │
├─────────────────────────────────────────────────────────┤
│ Agent Loop (provider.chat ↔ tool executor) │
│ ├─ Tools: read_file, write_file, edit_file, bash, │
│ │ glob, grep, list_dir │
│ └─ Max 25 tool turns, exact-string edits │
├─────────────────────────────────────────────────────────┤
│ Providers (OpenAI-compatible) │
│ ├─ LM Studio http://localhost:1234/v1 (+ fs scan) │
│ ├─ Ollama http://localhost:11434 (+ /api/tags) │
│ ├─ llama.cpp http://localhost:8080/v1 │
│ └─ Frontier OpenAI / Anthropic (optional) │
├─────────────────────────────────────────────────────────┤
│ Hardware Detector • Scheduler │
│ cores × overcommit, free mem / perAgent → maxParallel │
│ Apple Silicon bonus, clamp 1..16 │
└─────────────────────────────────────────────────────────┘Data flow:
User prompt
→ Router.classify → pick provider+model (local for small, frontier for large)
→ If parallel & non-trivial: Orchestrator.decompose → 2-6 SubTasks
→ Scheduler.runAll(SubTasks) with maxParallel = f(cores, RAM)
→ Each SubTask → Agent(provider, model, ToolExecutor) → tool loop
→ Synthesis agent merges results
→ Final summaryProviders
Provider | Default URL | Discovery | Notes |
LM Studio |
|
| Supports |
Ollama |
|
|
|
llama.cpp |
|
| Any GGUF via |
OpenAI |
| API | Set |
Anthropic |
| API | Set |
All providers speak OpenAI-compatible Chat Completions with tools (function calling). Normalizes reasoning_content (Qwen/Gemma) automatically.
Adding a custom endpoint
// lmstudio-ollama-mcp.json
{
"providers": {
"my-local": { "type": "openai", "baseUrl": "http://192.168.1.10:1234/v1", "enabled": true }
}
}Parallel Sub-Agents
Splits complex goals into 2–6 independent sub-tasks via a planner LLM (frontier if available, otherwise local). Execution is bounded by hardware:
// hardware/detector.ts — recommendParallelism()
cpuLimit = floor(cores * overcommit) - 1
memLimit = floor((totalGb*1024 - 2048) / perAgentMb)
maxParallel = min(cpuLimit, memLimit) + appleSiliconBonus
// clamp: 1..8 default, up to 16 on 64GB machineslmstudio-ollama-mcp --parallel 8 "migrate codebase from Jest to Vitest"
# Decomposed:
# t1 Explore & plan → search (routed to local 7B)
# t2 Implement → code (routed to local or frontier)
# t3 Verify → test (routed to local)
# Runner: Scheduler.runAll with p-limit = 8Tasks with dependsOn are batched topologically — batch N only starts after N-1 completes.
Local-model friendly: trivial tasks (lint, format, summarize, explain) are always routed locally regardless of strategy.
Configuration
Config resolution: DEFAULT < ~/.lmstudio-ollama-mcp/config.json < ./lmstudio-ollama-mcp.json < env vars.
Legacy ~/.forgecode/config.json and forgecode.json / forge.json are still read for backward compat (new path takes precedence).
lmstudio-ollama-mcp config --show # resolved JSON
lmstudio-ollama-mcp config --path # file locations
lmstudio-ollama-mcp init # scaffold lmstudio-ollama-mcp.jsonlmstudio-ollama-mcp.json reference
{
"version": 1,
"providers": {
"lmstudio": { "type": "lmstudio", "baseUrl": "http://localhost:1234/v1", "enabled": true },
"ollama": { "type": "ollama", "baseUrl": "http://localhost:11434", "enabled": true },
"llamacpp": { "type": "llamacpp", "baseUrl": "http://localhost:8080", "enabled": true },
"openai": { "type": "openai", "baseUrl": "https://api.openai.com/v1", "apiKey": "sk-..." }
},
"router": {
"strategy": "auto", // auto | local-first | frontier-first | local-only
"frontierProvider": "openai",
"frontierModel": "gpt-4o-mini",
"thresholds": {
"smallTaskMaxTokens": 2000,
"preferLocalFor": ["lint","format","test","search","summarize","explain"]
}
},
"hardware": {
"maxParallelAgents": 4, // auto if omitted
"maxMemoryPerAgentMb": 1200,
"cpuOvercommit": 1
},
"permissions": {
"allowBash": true,
"allowWriteOutsideWorkspace": false,
"allowNetwork": true
}
}Strategies:
auto— trivial/small → local, medium/large → frontier if available else local. (recommended)local-first— only medium/large go to frontier.local-only— never call frontier (air-gapped).frontier-first— always prefer frontier.
Tools
Agents have 7 tools — the same surface as Claude Code, sandboxed to the workspace:
Tool | Description |
| Read a file (2 MB limit, else use grep) |
| Create/overwrite a file (mkdir -p auto) |
| Exact-string replacement (must match once) |
| Run a command ( |
|
|
| Regex search (skips |
| Directory listing |
Safety: path escape blocked unless permissions.allowWriteOutsideWorkspace=true; dangerous commands (rm -rf /) rejected; large outputs truncated (30k).
Comparison: When to use which model
Task | Why local wins | Example |
Lint / format / grep | 0.2s vs 2s RTT |
|
Explain / summarize | Private codebase stays local |
|
Small edits | No queue, no cost |
|
Large refactor | Frontier plans, locals execute in parallel |
|
Hard reasoning | 70B / frontier needed |
|
Development
npm install
npm run build # tsc
npm test # vitest
npm run dev -- doctorProject map:
src/
cli/ commander CLI + commands (doctor, models, config, init)
config/ Zod schema + layered store (global ↔ project)
hardware/ detector (cores/RAM/GPU) + p-limit scheduler
providers/ base + openai-compatible + lmstudio/ollama/llamacpp + registry + router
core/ Agent (tool loop) + Orchestrator (decompose + parallel)
tools/ definitions + executor (fs/glob/grep/bash)
utils/ logger, format
tests/ vitest suites (hardware, tools, router, config, providers)
docs/ GitHub Pages landing (WizardZ-inspired, lime/black)Roadmap
Streaming output (
--stream)MCP (Model Context Protocol) server — expose local models as MCP tools for other agents
Persistent memory (
.lmstudio-ollama-mcp/memory.md)lmstudio-ollama-mcp plan— dry-run decomposition without executionVision models (Gemma 12B multimodal) for screenshot-driven UI work
hooks— pre/post tool hooksWindows / Linux GPU (CUDA/Vulkan) scheduler hints
Contributing
PRs welcome. Keep the core principles: local-first, minimal deps, hardware-aware, no AI slop.
npm run build && npm testKeywords
lm-studio lmstudio ollama llama.cpp local-llm local-first coding-agent autonomous-agent claude-code codex sub-agents parallel-agents mcp model-context-protocol hardware-aware openai-compatible gguf agentic dev-tools ai-coding on-device-ai privacy
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
AI work orchestration for plans, tasks, teams, and coding-agent dispatch.
AI-powered spec-to-task decomposition and execution orchestration for coding agents.
Open-source workspace where AI agents do the work and humans set direction. Apache 2.0.
Related MCP Servers
- AlicenseAqualityBmaintenanceA fully featured coding agent that uses symbolic operations (enabled by language servers) and works well even in large code bases. Essentially a free to use alternative to Cursor and Windsurf Agents, Cline, Roo Code and others.2929,845 PyPI31,560GPL 3.0
- AlicenseNot gradedqualityCmaintenanceLocal-first memory, pipelines, learning, feedback, and safe code tools for AI coding agents.MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to delegate agent tasks to local LLMs via llama.cpp or vLLM servers on your own hardware, reducing API usage while maintaining full agent capabilities.1122MIT
- AlicenseAqualityBmaintenanceEnables zero-cost autonomous coding and dual-agent verification by connecting AI IDEs to DeepSeek Harness and local or free model backends.6MIT