Llama-Bridge
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., "@Llama-Bridge Implement a recursive Fibonacci function in Python"
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.
Llama-Bridge — Local LLM Delegation Server
An MCP server that lets your cloud model (Gemini / Claude) delegate implementation work to a local llama.cpp server, preserving precious cloud-model usage limits while maintaining high code quality through AI-powered code review.
Cloud Model → Plans & Reviews
↕ MCP
Local Model → Writes CodeQuick Start
1. Prerequisites
Python 3.11+
uv (recommended) or pip
A running llama.cpp server (see below)
2. Start your local llama.cpp server
# Example with llama-server
./llama-server -m your-model.gguf --port 8080
# Or with llama-cpp-python
pip install llama-cpp-python[server]
python -m llama_cpp.server --model your-model.gguf --port 80803. Run the Automated Installer
We provide an automated installer script that creates a virtual environment, installs the package and its dependencies, and automatically configures llama-bridge in your global Antigravity/Gemini configuration directory (~/.gemini/config/mcp_config.json on Linux/macOS):
python install.py4. Configure Global Model Instructions (Required)
To enable the cloud model to automatically use the local Llama-Bridge delegation tools across all workspaces:
Open the project-scoped .agents/AGENTS.md file.
Copy its entire content.
Paste the content into your global
GEMINI.mdinstructions file located at~/.gemini/GEMINI.md.
5. Custom Configuration (Optional)
The installer will set the default local server URL to http://localhost:8080. If you need to customize this, or set a custom API key, you can add environment variables to the "env" block in your global mcp_config.json or create a .env file in the project directory:
# Example .env settings:
LLAMA_BASE_URL=http://localhost:8080
LLAMA_REQUEST_TIMEOUT=1206. Verify
Restart Antigravity IDE. The cloud model should now have access to:
implement_codegenerate_testsrefactor_codefix_codegenerate_docscheck_local_model_health
Related MCP server: local-llm-mcp
Available Tools
Tool | Purpose | Inputs |
implement_code | Generate implementation from a spec | task_description, language, context, constraints |
generate_tests | Generate test code | code, language, framework, requirements |
refactor_code | Apply a specific refactor | code, language, refactor_description, constraints |
fix_code | Fix bugs from errors/feedback | code, language, errors, review_comments |
generate_docs | Generate documentation | code, language, style |
check_local_model_health | Check server availability | (none) |
Every code tool returns a consistent ToolResponse:
{
"success": true,
"code": "def hello(): ...",
"error": null,
"metadata": {
"tool": "implement_code",
"elapsed_seconds": 3.42,
"usage": {"prompt_tokens": 150, "completion_tokens": 89},
"warnings": []
}
}Configuration
All settings are configured via environment variables or a .env file:
Variable | Default | Description |
|
| llama.cpp server URL |
|
| Timeout in seconds |
|
| Default sampling temperature |
|
| Default token budget |
|
| Model identifier (usually ignored) |
Running Tests
uv run pytest tests/ -vHow It Works
The cloud model (Gemini/Claude in Antigravity IDE) acts as a senior engineer — it plans, delegates, and reviews. The local model acts as a fast junior engineer — it writes code quickly. The MCP server is the bridge between them.
Cloud model receives a user request
Cloud model breaks it into implementation tasks
Cloud model calls MCP tools to delegate coding
Local model generates implementation
Cloud model reviews the code
If issues found → calls
fix_codewith feedbackRepeat until code meets quality standards
Cloud model presents the final, reviewed code
This gives you practically unlimited coding capacity from the local model, with cloud-grade quality assurance from the review loop.
Available Tools
6 toolscheck_local_model_healthCheck Local Model HealthARead-only
Check if the local llama.cpp server is reachable and loaded.
Returns availability status and model metadata. Call this before starting a batch of implementation tasks, or when a previous tool call failed with a connection error, to decide whether to retry or fall back to direct cloud-model implementation.
Inputs: no named parameters. Returns: Response from the ``check_local_model_health`` tool.
fix_codeFix CodeARead-only
Fix bugs in code based on errors or review feedback.
Provide the broken code along with compiler/runtime errors and/or reviewer comments. The local model will return a corrected version that addresses all reported issues.
IMPORTANT: Always review the returned fix before accepting it.
Inputs: code (required), language (required), errors, max_tokens, +2 more. Returns: Unified response envelope returned by every code-generation tool. The cloud mod…
generate_docsGenerate DocumentationARead-only
Generate documentation for existing code.
Produces documentation in the requested style — inline docstrings, README content, or structured API reference.
IMPORTANT: Always review the returned documentation for accuracy.
Inputs: code (required), language (required), style, max_tokens, +1 more. Returns: Unified response envelope returned by every code-generation tool. The cloud mod…
generate_testsGenerate TestsARead-only
Generate test code for a given implementation.
Produces a complete, runnable test file that covers happy paths and edge cases. Specify the testing framework and any particular scenarios you want covered.
IMPORTANT: Always review the returned tests before accepting them.
Inputs: code (required), language (required), framework, max_tokens, +2 more. Returns: Unified response envelope returned by every code-generation tool. The cloud mod…
implement_codeImplement CodeARead-only
Generate implementation code from a specification.
Use this tool when you need the local model to write a function, class, module, API endpoint, CRUD logic, glue code, or any other implementation artefact. Provide as much context and constraints as possible for the best results.
IMPORTANT: Always review the returned code before accepting it.
Inputs: language (required), task_description (required), context, max_tokens, +2 more. Returns: Unified response envelope returned by every code-generation tool. The cloud mod…
refactor_codeRefactor CodeARead-only
Apply a specific refactoring to existing code.
The local model will apply the requested transformation while preserving external API and behavior. Useful for mechanical refactors like renaming, extracting methods, converting patterns, etc.
IMPORTANT: Always review the returned code before accepting it.
Inputs: code (required), language (required), refactor_description (required), max_tokens, +2 more. Returns: Unified response envelope returned by every code-generation tool. The cloud mod…
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct workflow: implementation, test generation, refactoring, bug fixing, documentation, and health checking. Descriptions clearly separate concerns, so an agent should be able to select the right tool without confusion.
Tool names follow a consistent verb_noun snake_case pattern: implement_code, generate_tests, check_local_model_health, refactor_code, fix_code, generate_docs. The naming convention is uniform and predictable.
Six tools is a well-scoped set for a local-model code-assistance bridge. Each tool earns its place, covering the main code-generation and modification workflows without redundant or unnecessary additions.
The toolset covers the core lifecycle of generating, testing, refactoring, fixing, and documenting code, plus a health check. A minor gap is the lack of a general code review or explanation tool, but agents can work around it with the existing tools.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA local MCP server that delegates coding tasks to local Qwen and cloud Gemini models, enabling orchestrators like Claude Code to offload routine code generation and receive verified results with automatic correction logging.1MIT
- AlicenseAqualityDmaintenanceMCP server connecting Claude Code to LM Studio, delegating token-expensive tasks to a local model while keeping the cloud model in control. It reduces cloud context usage by reading files locally and returning only the processed results.4MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that delegates mechanical tasks like summarization, classification, extraction, and drafting to a local Llama.cpp LLM, serving as a cost-optimization layer while Claude handles reasoning and quality control.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets ChatGPT or any MCP client securely delegate coding tasks to a local Claude Code instance, with git checkpointing, approval gates, and structured results. Supports code review, test running, and rollback via simple tool calls.MIT