localvibecode
This MCP server exposes localVibeCode capabilities for deterministic, offline codebase analysis, surgical context extraction, verification, and PEV task execution.
Build/refresh the AST code knowledge graph with 0 LLM tokens, returning God Nodes, dependencies, and signatures (
localvibecode_build_graph).Extract surgical context (<4,000 tokens) for a target file, including target code, 1-hop outbound signatures, and 1-hop inbound callers (
localvibecode_blast_radius).Run zero-token deterministic verification: AST syntax checks, enterprise security SAST, and unit tests (
localvibecode_verify).Execute a requirement through the Plan → Execute → Verify pipeline with fresh context and one local Ollama model (
localvibecode_pev_run).Use legacy
aisdlc_*aliases for graph build, blast radius, verify, and PEV run.Optionally target a repository via
repo_path; blast radius requirestarget_file, and PEV requiresrequirement.
Serves as the local inference engine powering the autonomous Plan-Execute-Verify coding workflow, routing planning, patch generation, and verification through Ollama-hosted models (e.g., qwen2.5-coder:7b/14b) with a pinned model to avoid VRAM thrashing and enable fully offline, air-gapped AI coding.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@localvibecode show me the one-hop impact of changing processPayment before I edit it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
localVibeCode
🎯 What is localVibeCode?
In high-security enterprise environments (banking, financial services, telecom, defense, healthcare), developers face a strict constraint: no public internet access or high network bottlenecks. At the same time, traditional AI coding tools rely on frontier cloud LLMs with 200k+ token context windows by dumping dozens of files into the prompt.
When running local models (7B – 14B) on laptops (16GB – 32GB RAM):
Dumping multiple files causes severe "Lost in the Middle" hallucination and memory blowup.
Running multiple models (Planner + Coder + Reviewer) causes VRAM thrashing and 10–20 second swapping freezes.
Unchecked edits cause breaking contract changes across dependent modules.
localVibeCode solves this by shifting structural discovery and verification to the CPU (0 LLM Tokens), feeding your local model only surgical, high-precision context (< 4,000 tokens) under a deterministic state machine.
Related MCP server: CodeMap
⚡ The 3 Architectural Breakthroughs
[Developer Requirement]
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Phase 0: Graphify AST Indexer (CPU • 0 LLM Tokens) │
│ - Parses AST across codebase in < 0.1s │
│ - Identifies Architectural God Nodes & Leiden subsystem clusters │
│ - Extracts 1-Hop Inbound Callers & Outbound Signatures │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Phase 1: PLAN (Fresh Context #1 • Constrained JSON Schema) │
│ - Analyzes Requirement + GRAPH_REPORT.md + Enterprise Guardrails │
│ - Generates minimal ordered Atomic Tasks (Model -> Service -> Test) │
└───────────────────────────────────┬────────────────────────────────────┘
│ (Context Reset)
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Phase 2: EXECUTE (Fresh Context #2 per file • Surgical Slice) │
│ - Blast-Radius Slicer feeds ONLY: Target File + 1-Hop Signatures │
│ - Single Pinned Base Model generates surgical patch │
│ - Immediate Zero-Token Verifier (AST check + SAST + Unit Tests) │
│ - Self-Healing loop with error traceback if verification fails │
└───────────────────────────────────┬────────────────────────────────────┘
│ (Context Reset)
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Phase 3: VERIFY (Fresh Context #3 • Spec Critic) │
│ - Evaluates unified git diff against original requirements │
│ - Produces pass/replan scorecard and compliance score (0-100) │
└────────────────────────────────────────────────────────────────────────┘Deterministic AST Knowledge Graph (Graphify Style):
0 LLM tokens consumed.
Maps classes, functions, and import/call dependencies deterministically using AST parsing.
Ranks Architectural God Nodes so AI knows which core interfaces cannot be broken.
Blast-Radius Slicer (< 4,000 Tokens Surgical Context):
Extracts only: Target file + 1-Hop Outbound Signatures (function bodies stripped) + 1-Hop Inbound Callers.
Allows a 7B or 14B model to make multi-file modifications with the precision of a 200B cloud model.
Single Pinned Base Model & Deterministic PEV:
Keeps only 1 model pinned in Unified Memory/VRAM (
keep_alive: -1m), eliminating model swapping.Resets context at every phase (Plan $\rightarrow$ Execute $\rightarrow$ Verify) to keep the model in its Peak Reasoning Zone.
Zero-token verification (AST, Security SAST, Test Suite) before displaying changes.
🚀 Quickstart
1. Prerequisites
OS: macOS (Apple Silicon M-series recommended) or Linux.
RAM: 16GB+ Unified Memory / RAM recommended.
Python: Python >= 3.9.
Inference Engine: Ollama running locally.
Recommended Model:
qwen2.5-coder:7b(fast) orqwen2.5-coder:14b(deep reasoning).
# Pull your preferred local coding model
ollama pull qwen2.5-coder:7b2. Installation
Clone the repository:
git clone https://github.com/dhluong90/localVibeCode.git
cd localVibeCode
# Make the CLI launcher executable (or add to your PATH)
chmod +x ./localvibecode3. Run Preflight Health Check
Verify your local environment, RAM budget, Ollama daemon, and models:
./localvibecode doctor──────────────────── SYSTEM PREFLIGHT DIAGNOSTICS ────────────────────
[PASS] Python Version (Runtime)
↳ Python 3.9.6 (/usr/bin/python3)
[PASS] System Memory (Hardware)
↳ 24.0 GB RAM / Unified Memory detected (Darwin arm64)
[PASS] Git CLI (Toolchain)
↳ Found at /usr/bin/git
[PASS] Ollama Binary (Inference)
↳ Found at /usr/local/bin/ollama
[PASS] Ollama Daemon Service (Inference)
↳ Responding at http://localhost:11434 (2 model(s) installed)
[PASS] Coding LLM Models (Inference)
↳ Available: ['qwen2.5:7b', 'gemma4:latest']
──────────────────────────────────────────────────────────────────────
[SUCCESS] All environment checks passed! localVibeCode is 100% ready to run offline.4. Test on the Included Enterprise Demo Repo
./localvibecode pev "Add 20% discount for ENTERPRISE tier in order service and add unit test verifying 500.0 USD charges 400.0."📊 Automated Acceptance Benchmarking Suite
localVibeCode comes with a formal, reproducible benchmark harness designed for technical evaluation and acceptance sign-offs (Nghiệm thu dự án):
# Run all 5 enterprise benchmark use cases in isolated workspaces:
./localvibecode benchmark
# Run a specific test case (e.g., Case 1: Ideas to Code):
./localvibecode benchmark --case 1The 5 Standard Benchmark Use Cases
Case | Category | Real-World Scenario | Acceptance Criteria |
#1 | Ideas to Code | Implement cross-layer bulk purchase discounts across service and tests | 100% test pass rate; zero code regression |
#2 | Unit Test Gen | Generate boundary tests (currency validation, negative amounts) | Covers edge-cases with exact mock signatures |
#3 | Self-Healing | Injected VIP calculation defect triggers automated self-healing loop | Identifies failure trace and self-heals $\le 2$ retries |
#4 | Blast Radius | Modify central God Node ( | Zero breaking changes across 1-hop inbound callers |
#5 | Zero-Token SAST | Injected | Immediate blocker + safe enterprise rewrite |
📖 Full Acceptance Specification & Protocol: See docs/BENCHMARK_AND_ACCEPTANCE_GUIDE.md for detailed pass/fail thresholds, KPI metrics, and formal sign-off templates.
📄 Live Generated Report: Each run produces a complete Markdown evaluation report in
benchmarks/BENCHMARK_REPORT.md.
☕ Real-World Enterprise Java Evaluation (7B vs. 14B Benchmark)
To validate localVibeCode on real-world enterprise architectures, we stress-tested a multi-module Java Clean Architecture repository (clean-architecture-java, 5 Maven modules, Spring Boot, JUnit 5, AssertJ, Checkstyle) comparing qwen2.5:7b vs qwen2.5-coder:14b:
Capability Metric | Model 7B ( | Model 14B ( |
VRAM Footprint | 4.7 GB (Ultra-lightweight) | 9.5 GB (100% GPU on Apple M5, 0 swap) |
Inference Speed | ~42 tokens / sec | ~35 tokens / sec |
QA Scorecard | 82 / 100 | 100 / 100 (Flawless PASS) |
Spring Context Runner Pattern | ❌ Fails (invokes naive | ✅ Native Mastery ( |
AssertJ & JUnit 5 Syntax | ⚠️ Uses legacy | ✅ Idiomatic |
Zero-Human Intervention Pass@1 | ~60% | ~95% |
Maven Reactor Multi-Module Build | ✅ PASS (1.8s) | ✅ PASS (1.75s) |
📖 Comprehensive Evaluation Document: Read the complete 6-Phase SDLC report at docs/JAVA_ENTERPRISE_SDLC_EVALUATION.md.
🛠️ Onboarding an Existing Project
You can apply localVibeCode to any existing repository in one command:
./localvibecode init /path/to/your/existing/projectWhat init does automatically in 1 second:
Detects project test suite (
pytest,npm test,go test).Generates
localvibecode.jsonconfig.Configures OpenCode CLI integration (
opencode.json).Configures VS Code / Cursor MCP integration (
.vscode/mcp.json).Generates starter
enterprise_rules/folder.Builds the initial Graphify AST map in
graphify-out/GRAPH_REPORT.md.
💻 IDE & Tool Integrations
1. OpenCode CLI (Terminal Agent)
Run OpenCode in any onboarded repository:
cd /path/to/your/project
opencodeUse custom slash commands:
/graph— Inspect architectural God Nodes and repository skeleton (0 tokens)./impact path/to/file.py— View 1-hop blast-radius surgical slice./pev <requirement>— Trigger autonomous offline Plan-Execute-Verify cycle.
2. VS Code & Cursor (MCP Integration)
The onboarded project includes .vscode/mcp.json. Any MCP client (VS Code Cline, Roo Code, Continue.dev, Claude Code) connects directly to:
{
"servers": {
"localvibecode": {
"type": "stdio",
"command": "python3",
"args": ["-m", "localvibecode.mcp_server"],
"env": {
"PYTHONPATH": "/path/to/localVibeCode/src"
}
}
}
}Exposed MCP Tools:
localvibecode_build_graphlocalvibecode_blast_radiuslocalvibecode_verifylocalvibecode_pev_run
📖 CLI Reference
Command | Description |
| Run environment diagnostics (Python, RAM, Ollama, Models) |
| Onboard an existing codebase for CLI, OpenCode, and VS Code |
| Run end-to-end Plan $\rightarrow$ Execute $\rightarrow$ Verify with 1 local pinned model |
| Generate & display Graphify AST structural report & God Nodes (0 tokens) |
| Extract 1-hop surgical context (< 4K tokens) for a specific file |
| Run zero-token AST check, offline security SAST, and unit tests |
| Launch stdio MCP server for IDE agents |
| Run automated 5-case acceptance benchmark suite in isolated workspaces |
Options:
--repo <path>: Specify target project path (overrides config).--model <name>: Override Ollama model (e.g.--model qwen2.5-coder:14b).--no-banner: Hide ASCII logo.
🇻🇳 Dành Cho Kỹ Sư Việt Nam (Vietnamese Summary)
localVibeCode được thiết kế đặc thù cho các môi trường doanh nghiệp Việt Nam (ngân hàng, tài chính, viễn thông, cơ quan nhà nước):
100% Không cần Internet: Source code, tài liệu và logic nghiệp vụ không bao giờ rời khỏi laptop.
Khắc phục triệt để giới hạn của Local LLM (7B - 14B):
Không nhồi bừa bãi hàng chục file vào context làm AI "lú" (Lost in the Middle).
Dùng Graphify AST (0 token) để trích xuất đúng vùng ảnh hưởng (Blast-Radius < 4,000 tokens).
Ghim cố định 1 model duy nhất trong VRAM, chia nhỏ quy trình thành vòng lặp Plan $\rightarrow$ Execute $\rightarrow$ Verify với context sạch ở mỗi bước.
Tự động chạy AST Check + Security SAST + Unit Test để tự sửa lỗi (Self-Healing) trước khi giao code cho dev.
📄 License
Licensed under the Apache License 2.0.
Available Tools
8 toolsaisdlc_blast_radiusC
Legacy alias for localvibecode_blast_radius.
Inputs: target_file (required), repo_path.
aisdlc_build_graphD
Legacy alias for localvibecode_build_graph.
Inputs: repo_path.
aisdlc_pev_runC
Legacy alias for localvibecode_pev_run.
Inputs: requirement (required), repo_path.
aisdlc_verifyC
Legacy alias for localvibecode_verify.
Inputs: repo_path.
localvibecode_blast_radiusB
Extract the Surgical Context (< 4,000 tokens) for a target file: includes target code, 1-hop outbound signatures (bodies stripped), and 1-hop inbound callers.
Inputs: target_file (required), repo_path.
localvibecode_build_graphB
Build/refresh the deterministic AST Code Knowledge Graph (Graphify) with 0 LLM tokens. Returns Architectural God Nodes, import/call dependencies, and public signatures.
Inputs: repo_path.
localvibecode_pev_runC
Execute an Enterprise Local Vibe Coding task using the Deterministic PEV (Plan -> Execute -> Verify) pipeline with Fresh Context isolation on 1 Local Ollama Model.
Inputs: requirement (required), repo_path.
localvibecode_verifyB
Run Zero-Token Deterministic Verification (AST syntax check, Enterprise Security SAST, and Unit Tests).
Inputs: repo_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The four localvibecode_ tools are distinct in purpose (graph build, context extraction, verification, pipeline run), but each has an exact aisdlc_ duplicate. Descriptions explicitly mark these as aliases, which mitigates but does not eliminate misselection risk.
Within each prefix, names follow a clear verb_noun pattern (build_graph, blast_radius, verify, pev_run), but the set mixes two different namespace prefixes (localvibecode_ vs aisdlc_), which is inconsistent across the surface.
The server registers 8 tools, but 4 are pure legacy aliases, so the real functional surface is only 4. The count is inflated by duplication rather than reflecting genuine capability.
The four real tools cover the core workflow—graph construction, surgical context extraction, deterministic verification, and the PEV execution pipeline. Minor gaps like graph inspection/reset or model management exist but are workable around.
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to retrieve hyper-targeted, token-efficient context from a codebase by querying a locally built AST knowledge graph, and to persist cross-session agent memory through 17 MCP tools. All indexing and retrieval run entirely offline, so proprietary code never leaves the machine.24 PyPI1MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to explore a repository by querying a pre-built structural knowledge graph of symbols and their relationships — definitions, callers, callees, blast radius, and file-level impact — instead of grepping and reading files. This cuts the tokens spent on code exploration by roughly 96–99% while running entirely on local SQLite with tree-sitter parsing.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a local structural code graph for focused context, inspect relationships and impact, and carry recorded mistakes into later sessions.24 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a local structural code graph, inspect relationships and impact, and retrieve focused project context before reading full files.24 npmMIT