Sherpa
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., "@SherpaGenerate a Rust function for hashing and run contract check"
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.
Sherpa (Local Coder MCP Server)
A lightweight, zero-dependency Python-based Model Context Protocol (MCP) server that offloads code generation, deterministic compiler validation, sandboxed testing, and self-healing to local hardware (Apple Silicon via Metal or NVIDIA GPUs via CUDA/Ollama), immediately freeing memory and context after every invocation.
π― The Philosophy: "Blind Orchestrator" Pattern
Frontier cloud models (Claude, Gemini, GPT-4) serve as Architectsβdefining interfaces, contracts, and orchestrating execution. Implementation code generation, compiler syntax checks, contract validation, and sandboxed test execution run locally on your own hardware.
Only compact telemetry receipts (bytes written, duration, compiler error lines, test pass/fail) return to the cloud model's context window. File contents never enter orchestrator context unless explicitly requested, eliminating quadratic context window compounding ("multi-turn context tax") and reducing cloud token costs by up to 90%.
Related MCP server: OmniBridge MCP Server
π Key Features
Instant Memory Eviction (
keep_alive: 0):Every inference request to Ollama automatically sends an eviction hook to guarantee zero lingering VRAM on GPUs or unified memory on Apple Silicon.
Zero-Token Deterministic Compiler Gates:
Native language parsers and compilers (
cargo check&rustcfor Rust,go vetfor Go,py_compilefor Python,node --checkfor JS/TS,g++for C++) validate code in under 20ms with zero token cost.
Contract-Driven Hallucination Detection (
code_contract_check):Deterministic AST scanner that checks generated code against a
contract.jsonmanifest before tests are run, catching forbidden/hallucinated fields, missing required fields, or deprecated framework patterns.
Binary Compilation & Contract Reflection (
code_build&code_schema):Builds native binaries directly with
cargo build, returns terse compiler diagnostics on error, and reflects public struct, enum, and function contracts from source or--schemaCLI binaries.
Autonomous Recursive Self-Healing (
code_fix) & STOP Protocol:Executes multi-turn generation β validation β contract check β test cycles entirely on local compute without frontier model intervention. Halts and emits a structured
decision_required: trueSTOP signal when design choices require human judgment.
Zero Third-Party Runtime Dependencies:
Implements standard MCP JSON-RPC 2.0 over
stdiousing only the Python standard library. Starts in milliseconds.
π οΈ The 7 MCP Tools
Tool | Purpose |
| Generates implementation code directly to disk with instant memory eviction. |
| Runs native language compilers ( |
| Executes unit/integration test suites in an isolated sandbox with |
| Zero-token AST scanner detecting schema violations, forbidden fields, and API drift before tests run. |
| Compiles Rust Cargo projects to native binaries, with optional CLI execution and terse error filtering. |
| Extracts machine-readable contract schemas from compiled binaries (via |
| Autonomous recursive self-healing loop combining generation, validation, contract checks, and tests with the STOP protocol. |
π» Hardware & Model Support
Works identically across Apple Silicon (M-Series M1βM4 with Unified Memory) and Linux / Windows (NVIDIA CUDA):
16 GB Mac / 10 GB RTX 3080:
qwen2.5-coder:14b-instruct-q4_k_m(Standard)24 GB β 48 GB Mac (M4 Pro / Max) / 24 GB GPU:
qwen2.5-coder:32b-instruct-q4_k_m(Best reasoning)8 GB Mac / 8 GB GPU:
qwen2.5-coder:7b-instruct-q8_0(Fast boilerplate)
See SETUP.md for full manual model installation and custom Modelfile instructions.
βοΈ Configuration
Sherpa features a hierarchical configuration engine (CLI args > Environment variables > Project sherpa.json > Global user ~/.config/sherpa/config.json > Defaults).
Using the Config CLI:
# View active configuration
python3 -m coder.config show
# Set the global model
python3 -m coder.config set model qwen2.5-coder:14b-instruct-q4_k_m
# Set remote Ollama host
python3 -m coder.config set ollama_host http://localhost:11434Client Setup (Antigravity CLI / Claude Desktop):
Add to your mcp_config.json:
{
"mcpServers": {
"sherpa": {
"command": "python3",
"args": ["/path/to/coder/server.py"],
"env": {
"SHERPA_MODEL": "qwen2.5-coder:14b-instruct-q4_k_m"
}
}
}
}π§ Agent Skill & Orchestration Guide
Sherpa ships with a ready-to-use agent skill definition in skills/local-coder/SKILL.md designed for Antigravity, Claude Code, and agentic workflows.
It instructs frontier orchestrators on:
The Granularity Boundary Rule: Slicing tasks into micro-contracts (<40 lines) to achieve near-100% compiler pass rates on local 14B models.
The STOP Protocol: Structured human-in-the-loop decision checkpoints when self-healing attempts are exhausted or design ambiguities are detected.
Contract Manifests (
contract.json): Pre-defining data structures and route schemas socode_contract_checkcan eliminate hallucinations prior to test runs.
π§ͺ Running Tests
Run the complete test suite (67 tests, pure stdlib):
python3 -m unittest discover -s tests -p "test_*.py" -vπ License
MIT License. See LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Validates AI infra code on real VMs. Self-corrects until it works. No containers, no sandboxes.
Architecture compiler for AI code. 11 tools, 92 actions, 872 Lean4 proofs, 100/100 self-cert.
Confidential AI execution with a post-quantum receipt on every job β verifiable by anyone.
Machine-native capabilities with explicit contracts and machine-readable commerce.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables local, Docker-isolated code execution across six programming languages including Python, Rust, and TypeScript. It features pre-warmed container pooling, persistent sessions, and built-in support for machine learning libraries.-
- AlicenseNot gradedqualityCmaintenanceProvides isolated sandbox environments for AI agents to execute code securely, generating signed receipts for every execution to ensure auditability and trust.61 npm4MIT
- FlicenseAqualityCmaintenanceEnables LLM-driven agents to autonomously detect, diagnose, repair, verify, and prevent software and hardware failures on local and remote systems. Includes built-in safety checks and automatic rollbacks.15-
- AlicenseNot gradedqualityCmaintenanceEnables deterministic, neural-free compilation of natural language into typed intent and canonical receipts, with proof-gated synthesis and governed tool use via read-only compiler functions.MIT