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-agentsummarize 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.
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| think | No | ||
| timeout_s | No | ||
| max_tokens | No | ||
| model_tier | No | strong | |
| context_files | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint annotation, the description discloses that output is saved to a file whose path is returned, that think=true adds slower reasoning, that fast tier is ~1.4x quicker, and that the tool is unsuitable for correctness-critical tasks. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with the core purpose, followed by scannable Good-for and NOT-for lists. Every sentence adds operational value; no filler or repetition of schema fields.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description explains the return value (file path) and covers context limits, performance trade-offs, and selection criteria. It is complete enough for an agent to decide when and how to call this tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description compensates by explaining context_files (absolute paths, ~90k chars), model_tier (fast vs strong speed), and think (reasoning/slower). However, timeout_s and max_tokens are not explicitly described, though 'ask for long outputs freely' indirectly hints at output limits.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Run a self-contained subtask on a LOCAL model and return its text.' This clearly distinguishes it from siblings like search_code and review_diff, and the Good-for list further scopes it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit 'Good for' and 'NOT for' sections naming concrete use cases (boilerplate, unit tests, docstrings) and exclusions (final correctness, full-repo reasoning). It also gives operational constraints like ~90k chars context and model_tier trade-offs.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | ||
| force | No | ||
| include_globs | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the idempotentHint annotation, the description reveals the incremental re-embedding behavior, the storage location in the server's data dir rather than the repo, and that search_code auto-refreshes the index. This adds meaningful behavioral context that annotations alone do not convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded: main purpose first, then incremental behavior, storage, usage positioning, and parameter default. Every sentence contributes information, with no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a moderately complex indexing tool with no output schema, the description covers purpose, incremental semantics, storage side effects, run cadence, and default globs. Missing details such as force semantics and expected return values keep it just shy of fully complete, but the agent has enough to call it correctly in most cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It only explains include_globs by noting its default; root and force are left undocumented. Root is somewhat inferable from 'directory tree,' but force's effect is never described, which is a meaningful gap for a 3-parameter tool with zero schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb-resource pair: 'Build or refresh the LOCAL semantic search index for a directory tree.' It clearly identifies the tool's scope (local indexing) and differentiates it from the sibling search_code by stating that search_code refreshes the index automatically, so an agent can distinguish them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives practical guidance: 'Run once per repo' and notes that search_code refreshes the index automatically afterwards, implying search_code is the tool for queries. It does not explicitly enumerate when not to use the tool or compare against all siblings, but the context is clear enough for confident selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=false, so the read-only, non-side-effect nature is covered. The description adds valuable context about what is revealed (VRAM placement, competing model) and why it matters. It doesn't describe return format, but for a status tool that's acceptable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first states what it does, second provides when and why. Information is front-loaded and every phrase adds value. No redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless status tool with no output schema, the description covers everything an agent needs: what it shows, when to call it, and the diagnostic benefit. There are no missing prerequisites or side-effect caveats to document.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the schema coverage is 100% (empty schema). Per rubric, baseline is 4. The description appropriately focuses on purpose rather than parameters, which are nonexistent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('Show') and resource (active local profile, model per tier, Ollama loaded state). It precisely differentiates from sibling tools, which all perform different actions (delegate, review, summarize, index, search). The scope is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use: when a local tool is slow or fails, or before a batch of local work. It explains the diagnostic value (VRAM placement, competing model). This is strong guidance with clear triggers and purpose, even though it doesn't name alternatives, since siblings are distinct tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| diff | No | ||
| focus | No | ||
| think | No | ||
| git_range | No | ||
| timeout_s | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| model | No | |
| notes | No | |
| seconds | No | |
| summary | Yes | Two or three sentences on overall quality and risk |
| verdict | Yes | |
| findings | Yes | |
| diff_chars | No | |
| output_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only declare readOnlyHint=true and openWorldHint=false, so the description must carry behavioral context. It discloses that the server may run `git diff` in cwd, that the model is local, that findings are structured with severity levels, and that the output is not authoritative. This is exactly the kind of context an agent needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact but information-dense, front-loading the purpose, then parameter semantics, then usage caveats. Every sentence contributes, and the examples are positioned where they are most useful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema and read-only annotation, the description is complete: an agent knows how to supply input, what defaults apply, what results look like, and how much to trust them. The only undeclared parameters are clearly optional and self-explanatory.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description compensates well: it explains `diff` vs `git_range`, provides `git_range` examples (`--staged`, `main...HEAD`), documents the `cwd` default, and defines `focus`. However, `think` and `timeout_s` are not explained, so it does not fully cover all six parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Second-opinion code review of a diff by a LOCAL model; returns structured findings.' This clearly differentiates it from sibling tools like search_code, summarize, and index_codebase. It also names the output format, leaving no ambiguity about what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit usage context: use as a first pass before or alongside your own review, verify findings against the code, and treat it as 'a cheap second opinion, not a verdict.' It does not explicitly name sibling alternatives or state when not to use it, which keeps it from a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | ||
| query | Yes | ||
| top_k | No | ||
| refresh | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds valuable behavioral context: it refreshes the index first unless refresh=false, returns path:start-end plus a snippet, and uses local embeddings. This goes beyond the annotations and helps the agent predict side effects and output format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded: it opens with the core purpose, gives concrete examples, states the return format, and ends with a clear exclusion. Every sentence earns its place, and the structure makes it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only search tool with no output schema, the description covers the main things an agent needs: what to ask, what results look like, the refresh side effect, and when to use a sibling instead. It doesn't detail top_k semantics or root scope, but those are minor given the schema defaults and the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains the query parameter via natural-language examples and clarifies the refresh parameter's default behavior. It does not explicitly explain root or top_k, but root is fairly self-evident and top_k has a default; the description's examples and refresh clarification add meaningful value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('search'), a resource ('codebase'), and a distinctive mechanism ('by MEANING using local embeddings'). It also gives concrete example queries and explicitly contrasts itself with Grep for exact identifiers/strings, which distinguishes it from sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says when to use it ('Ask in natural language...') and when NOT to use it ('NOT for exact identifiers or strings — use Grep for those'). It also mentions the refresh behavior and how to disable it, giving clear operational guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| paths | No | ||
| question | No | ||
| timeout_s | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, and the description adds meaningful context beyond that: local model execution, map-reduce strategy, megabyte-scale capability, preservation of concrete details, and that the full summary is saved to a file. It doesn't describe failure modes or timeout behavior, but the added operational context is substantial and does not contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose and capability, then usage guidance, parameter hints, and a closing exclusion. Dense but every sentence earns its place; slightly long but efficient given the 4 parameters and 0% schema coverage it must compensate for.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complete for a read-only summarization tool: purpose, when/when-not, parameters, and a behavioral note about saved output. The main gaps are undocumented timeout_s and no explicit statement of what the tool returns directly (no output schema exists), which an agent would need to know. Minor against an otherwise thorough definition.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description carries the full burden and documents 3 of 4 parameters: paths (absolute), text (inline), and question (with a concrete example). It omits timeout_s entirely, which is a gap, but the parameters it does cover include usage context beyond the schema's bare names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Summarise') + resource (large files, logs, text) with an explicit mechanism (LOCAL models, map-reduce). Clearly distinguishes from siblings by naming 'Read' as the alternative and scoping to long files, which separates it from search_code, index_codebase, and review_diff. The purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (long files needing gist or a specific question answer) and when not to use ('NOT for short files (<200 lines): just Read them'), naming the exact alternative tool. Gives a concrete example question. This is as explicit as usage guidance gets.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
delegate_task - First observed
index_codebase - First observed
local_models_status - First observed
review_diff - First observed
search_code - First observed
summarize
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.
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Local-first, governed memory and session continuity for AI coding agents. No cloud, no telemetry.
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.358 npm25AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceA bridge that enables Claude Code to interact with local Ollama instances for text generation, multi-turn chat, and vision-based analysis. It supports model management tasks such as listing, pulling, and showing details, alongside generating text embeddings.358 npm1MIT
- 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
- AlicenseAqualityCmaintenanceEnables 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.1135 npm4Apache 2.0