# Add Ollama Tool

Add Ollama MCP server so the container agent can call local models and optionally...

- Repository: https://github.com/nanocoai/nanoclaw (31069 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add nanocoai/nanoclaw --skill add-ollama-tool -g -a claude-code -y`
Codex: `npx skills add nanocoai/nanoclaw --skill add-ollama-tool -g -a codex -y`
Cursor: `npx skills add nanocoai/nanoclaw --skill add-ollama-tool -g -a cursor -y`
Gemini CLI: `npx skills add nanocoai/nanoclaw --skill add-ollama-tool -g -a gemini-cli -y`

## Description

Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Add Ollama Integration

This skill adds a stdio-based MCP server that exposes local [Ollama](https://ollama.com) models as tools for the container agent. Claude remains the orchestrator but can offload work to local models served by the Ollama daemon on the host, and can optionally manage the model library directly. Ollama runs locally and is keyless, there are no credentials to thread; the only configuration is the daemon's base URL.

Core tools (always available):
- `ollama_list_models`, list installed models with name, size, and family (`GET /api/tags`)
- `ollama_generate`, send a prompt to a specified model and return the response (`POST /api/generate`)

Management tools (opt-in via `OLLAMA_ADMIN_TOOLS=true`):
- `ollama_pull_model`, pull (download) a model from the Ollama registry (`POST /api/pull`)
- `ollama_delete_model`, delete a locally installed model to free disk space (`DELETE /api/delete`)
- `ollama_show_model`, show model details: modelfile, parameters, and architecture info (`POST /api/show`)
- `ollama_list_running`, list models currently loaded in memory with memory usage and processor type (`GET /api/ps`)

The skill ships the MCP server source (and its tests) in this folder and copies them into the agent-runner tree at install time, then registers the server in `index.ts` and forwards host env vars in `container-runner.ts`. Registering the server is enough to expose its tools, the agent's allow-pattern (`mcp__ollama__*`) is derived from the registered server name.

## Phase 1: Pre-flight

### Check if already applied

Check if `container/agent-runner/src/ollama-mcp-stdio.ts` exists. If it does, skip to Phase 3 (Configure).

### Check prerequisites

Verify Ollama is installed and its daemon is reachable. On the host:

```bash
curl -s http://127.0.0.1:11434/api/tags | head
```

If the request fails:

The rest: https://github.com/nanocoai/nanoclaw/blob/HEAD/.claude/skills/add-ollama-tool/SKILL.md
