ollama-agent
Provides tools for working with local Ollama models, including task delegation, diff review, summarization, semantic code search, and model status monitoring.
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., "@ollama-agent summarize build.log with the local model"
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.
ollama-agent
Local Ollama models exposed to Claude Code as MCP tools. Claude Code stays the brain (cloud); the RTX 4080 does the bulk work: summarising big files, first-pass code review, semantic code search, boilerplate and tests. A launcher also runs Claude Code fully offline against Ollama.
Tools
Tool | What it does | Local model |
| Run a self-contained subtask (tests, boilerplate, rewrites, log triage) | strong or fast tier |
| Structured second-opinion review of a diff ( | strong, thinking on |
| Map-reduce summary of large files/logs, optionally focused on a question | fast (map) + strong (reduce) |
| Local embedding index + semantic search by meaning | qwen3-embedding |
| Profile, tier→model map, | – |
Full outputs are always written to ~/.cache/ollama-agent/outputs/*.md; Claude gets the head plus the path.
Related MCP server: Ollama MCP Server
Profiles (16 GB GPU)
Profile | strong | fast | embed | Measured |
| qwen3.5:latest (9B) | qwen3.5:4b | qwen3-embedding:0.6b | 72 / 97 tok/s, all resident (15.0 GB) |
| qwen3.6:35b-a3b | same model | embed on CPU | 36–38 tok/s, 12 GiB on GPU + 9 GiB RAM |
The profile is fixed per server process (OLLAMA_AGENT_PROFILE); mixing the 35B with the
9B/4B pair would cost a 15–20 s reload on every switch. On startup the server preloads the
profile's models in the background, largest first — loading the 9B last leaves ~15% of it
on the CPU (OLLAMA_AGENT_WARMUP=0 disables this).
Setup
ollama pull qwen3.5:latest qwen3.5:4b qwen3-embedding:0.6b # trio
ollama pull qwen3.6:35b-a3b # big (optional)
uv sync --all-groups
uv run ollama-agent --check # settings + Ollama reachability
# Claude Code, this repo only: .mcp.json is already here (approve it on first start).
# Claude Code, every repo:
scripts/register.sh # uv tool install + claude mcp add --scope userThen in Claude Code: "call local_models_status", "summarize build.log with the local
model", "use local-reviewer on my staged changes" (.claude/agents/local-reviewer.md).
Environment variables are listed in .env.example.
Offline fallback
ollama create qwen3.6-cc -f Modelfile.qwen3.6-cc # once: 35B with 64K context
bin/claude-local # Claude Code -> Ollama /v1/messages
MODEL=qwen3.5:latest bin/claude-local -p "explain this repo"The launcher points every Claude Code model slot and the MCP tools at the same model so only one LLM is loaded.
Development
uv run pytest # unit tests, fake backend
OLLAMA_AGENT_INTEGRATION=1 uv run pytest tests/integration -s # real Ollama
uv run scripts/bench.py trio moe big64k # VRAM placement + tok/sstdout is the MCP transport — log to stderr only.
Available Tools
6 toolsdelegate_taskARead-only
Run a self-contained subtask on a LOCAL model and return its text.
Good for: boilerplate, unit tests for a given file, docstrings, log triage, rewrites,
first drafts, mechanical transformations. Pass the files it needs in context_files
(absolute paths, ~90k chars total). model_tier="fast" is ~1.4x quicker for simple
jobs; think=true adds reasoning for tricky ones (slower). Output is saved to a file
whose path is returned, so ask for long outputs freely.
NOT for: final correctness decisions, reasoning about the whole repo, tasks needing more than ~32K tokens of context, or anything you must get right without checking.
Inputs: task (required), think, timeout_s, max_tokens, +2 more.
index_codebaseAIdempotent
Build or refresh the LOCAL semantic search index for a directory tree.
Incremental: only files whose mtime/hash changed are re-embedded. Stored in the
server's data dir (~/.cache/ollama-agent), not in the repo. Run once per repo; search_code refreshes it
automatically afterwards. include_globs defaults to common source/doc extensions.
Inputs: root (required), force, include_globs.
local_models_statusARead-only
Show the active local profile, which model serves each tier, and what Ollama has loaded.
Call this when a local tool is slow or fails, or before a batch of local work, to see VRAM placement and whether an unrelated model is loaded and competing for the GPU.
Inputs: no named parameters.
review_diffARead-only
Second-opinion code review of a diff by a LOCAL model; returns structured findings.
Give either diff text, or git_range and let the server run git diff in cwd
(defaults: cwd = current dir, range = HEAD i.e. all uncommitted changes). Examples:
git_range="--staged", git_range="main...HEAD". focus narrows the review
("concurrency", "error handling"). Findings carry file, line, severity
(critical/major/minor/nit), summary and suggestion.
Use it as a first pass before or alongside your own review, then verify each finding against the code — it is a cheap second opinion, not a verdict.
Inputs: cwd, diff, focus, think, +2 more. Returns: ReviewCore plus metadata about how it was produced.
search_codeARead-only
Semantic search over a codebase by MEANING using local embeddings.
Ask in natural language: "where do we retry failed uploads?", "code that parses the
config file". Returns the best-matching chunks as path:start-end plus a snippet.
Refreshes the index first unless refresh=false.
NOT for exact identifiers or strings — use Grep for those.
Inputs: root (required), query (required), top_k, refresh.
summarizeARead-only
Summarise large files, logs or text with LOCAL models (map-reduce; megabytes are fine).
Use instead of Read when a file is long (logs, dumps, generated code, long docs) and
you need the gist or an answer to a specific question ("what errors occurred after
14:00?"). Accepts absolute paths and/or inline text. Concrete details
(identifiers, numbers, errors) are preserved. Full summary is also saved to a file.
NOT for short files (<200 lines): just Read them.
Inputs: text, paths, question, timeout_s.
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 operation: delegated generation, diff review, summarization, index building, semantic search, and model status. Even where multiple tools invoke local models, the descriptions explicitly separate use cases, so an agent is unlikely to misselect.
Most tool names follow a clear verb_noun pattern (delegate_task, review_diff, index_codebase, search_code). summarize is a lone single-verb name and local_models_status is a noun phrase, but these are minor deviations that do not cause confusion.
Six tools is well-scoped for a local-model assistive agent. Each tool earns its place and covers a distinct utility without redundancy or bloat.
The tool surface covers the main local-model workflows: task delegation, diff review, large-content summarization, semantic code indexing/search, and status checks. Minor gaps exist, such as no exact-match search or model management beyond status, but these are workable and do not block the core purpose.
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Every employee asks your codebase from Claude, without access to it. Statistics on each developer.
Add any agent you deploy on ibl.ai to Claude Code, Cursor or Claude Desktop and talk to it there.
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to delegate coding tasks to local Ollama models, reducing API token usage by up to 98.75% while leveraging local compute resources. Supports code generation, review, refactoring, and file analysis with Claude providing oversight and quality assurance.27AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceExposes local Ollama instances as tools for Claude Code, allowing users to offload code generation, text drafting, and embedding tasks to local GPUs. It supports multi-turn conversations and model management through the Model Context Protocol.MIT
- AlicenseAqualityDmaintenanceEnables Claude Code to offload routine code generation and text processing tasks to a local Ollama LLM, saving Cloud API tokens and costs with automatic model selection and security features.11204 npm3Apache 2.0
- 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