lmstudio-ollama-mcp
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"ローカルファースト。プライベート。無料。APIキー不要。 フロンティアモデル(GPT-4o、Claude 4)はオプション — 小さなローカルモデルが作業を実行している間、プランナーとしてのみ使用されます。エイリアス
forge/forgecodeで従来の操作感を維持できます。
lmstudio-ollama-mcp を選ぶ理由
Claude Code / Codex | lmstudio-ollama-mcp | |
実行環境 | クラウドAPI(有料、データがマシンの外に出る) | LM Studio · Ollama · llama.cpp(オフライン、プライベート) |
コスト | トークン課金 | モデルダウンロード後は $0 |
サブエージェント | シングルスレッドまたはクラウド並列 | ハードウェアを考慮したローカル並列処理 |
モデル選択 | ベンダーロックイン | あらゆる GGUF / OpenAI 互換モデル |
ハイブリッドモード | — | フロンティアが計画、ローカルが実行(オプション) |
サンドボックス | クラウドコンテナ | 自分のファイルシステム、自分のルール |
MCP | — | 対応済み: ローカルランタイムをMCPツールとして橋渡し |
一言で言えば: lmstudio-ollama-mcp は、Claude Code のエージェントループ(ツールによる読み取り → 計画 → 編集 → 検証)をあなたのMacBookにもたらします。インテリジェントなルーターが、簡単なタスクはローカルの7Bへ、難しい推論は必要なときだけフロンティアモデルへ振り分けます。
Related MCP server: Shared Workspace MCP
デモ
# 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.htmlクイックスタート
前提条件
Node.js >= 18
次**のいずれか:
インストール
npm install -g lmstudio-ollama-mcp
# aliases also available: forge, forgecode
# or one-off
npx lmstudio-ollama-mcp doctor初回実行
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"ローカルのみモードではAPIキーは不要です。ハイブリッドモード(フロンティア+ローカル)の場合は環境変数を設定してください:
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...アーキテクチャ
┌─────────────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────────────┘データフロー:
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 summaryプロバイダー
プロバイダー | デフォルトURL | 検出 | 備考 |
LM Studio |
|
|
|
Ollama |
|
|
|
llama.cpp |
|
|
|
OpenAI |
| API |
|
Anthropic |
| API |
|
すべてのプロバイダーは tools(関数呼び出し)を使用した OpenAI 互換の Chat Completions に対応しています。reasoning_content(Qwen/Gemma)は自動的に正規化されます。
カスタムエンドポイントの追加
// lmstudio-ollama-mcp.json
{
"providers": {
"my-local": { "type": "openai", "baseUrl": "http://192.168.1.10:1234/v1", "enabled": true }
}
}並列サブエージェント
複雑なゴールをプランナーLLM(利用可能ならフロンティア、それ以外はローカル)によって 2〜6個の独立したサブタスク に分割します。実行はハードウェアによって制限されます:
// 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 = 8dependsOn を持つタスクはトポロジカルにバッチ処理されます — バッチNはバッチN-1の完了後にのみ開始されます。
ローカルモデルに優しい: 簡単なタスク(lint、format、summarize、explain)は戦略に関係なく常にローカルにルーティングされます。
設定
設定の解決順: DEFAULT < ~/.lmstudio-ollama-mcp/config.json < ./lmstudio-ollama-mcp.json < 環境変数。
後方互換のため、従来の ~/.forgecode/config.json と forgecode.json / forge.json も読み込まれます(新しいパスが優先されます)。
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 リファレンス
{
"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
}
}戦略:
auto— 簡単/小規模 → ローカル、中/大規模 → 利用可能ならフロンティア、それ以外はローカル。(推奨)local-first— 中/大規模のみフロンティアへ。local-only— フロンティアを呼び出さない(エアギャップ)。frontier-first— 常にフロンティアを優先。
ツール
エージェントには7つのツールがあります — Claude Code と同じインターフェースで、ワークスペースにサンドボックス化されています:
ツール | 説明 |
| ファイルを読む(2 MB 制限、超える場合は grep を使用) |
| ファイルを作成/上書き(mkdir -p 自動) |
| 完全一致文字列の置換(1回だけ一致する必要があります) |
| コマンドを実行( |
|
|
| 正規表現検索( |
| ディレクトリ一覧 |
安全性: permissions.allowWriteOutsideWorkspace=true でない限りパスエスケープはブロックされます。危険なコマンド(rm -rf /)は拒否され、大きな出力は切り詰められます(30k)。
比較: どのモデルを使うべきか
タスク | ローカルが有利な理由 | 例 |
Lint / format / grep | RTT 0.2秒 vs 2秒 |
|
Explain / summarize | プライベートなコードベースはローカルのまま |
|
Small edits | 待ち時間なし、コストなし |
|
Large refactor | フロンティアが計画、ローカルが並列実行 |
|
Hard reasoning | 70B / フロンティアが必要 |
|
開発
npm install
npm run build # tsc
npm test # vitest
npm run dev -- doctorプロジェクトマップ:
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)ロードマップ
ストリーミング出力(
--stream)MCP(Model Context Protocol)サーバー — ローカルモデルを MCP ツールとして他のエージェントに公開
永続メモリ(
.lmstudio-ollama-mcp/memory.md)lmstudio-ollama-mcp plan— 実行を伴わないドライラン分割スクリーンショット駆動のUI作業のためのビジョンモデル(Gemma 12B マルチモーダル)
hooks— ツール前後フックWindows / Linux GPU(CUDA/Vulkan)スケジューラーヒント
コントリビューション
PR歓迎。中核となる原則を守ってください: ローカルファースト、最小限の依存、ハードウェアを考慮、AIスロップなし。
npm run build && npm testキーワード
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
ライセンス
MIT — LICENSE を参照。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceA 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.2928,582MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first memory, pipelines, learning, feedback, and safe code tools for AI coding agents.MIT
- FlicenseNot gradedqualityDmaintenanceMulti-agent continuous development system with local LLM orchestration.1
- AlicenseCqualityBmaintenanceEnables AI coding agents to navigate massive codebases through fast code property graph queries, sandboxed recursive language model execution, durable semantic memory, and swarm concurrency coordination.4MIT
Related MCP Connectors
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.
Coding agents build full-stack apps in persistent workspaces and share them by link.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fthsrbst/lmstudio-ollama-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server