Ollama MCP Server

Offload cheap work from your AI agent to a local Ollama model, at zero cloud cost.

Local serverstdioPython

What is the Ollama MCP server?

Ollama MCP server exists for a simple reason — assistants are far more useful when they can act on Ollama directly instead of describing what you should do. Offload cheap work from your AI agent to a local Ollama model, at zero cloud cost.

What you get

This isn't a generic "wrap the Ollama API" server. Each tool ships with a baked-in system prompt and a description written for the calling agent, so the agent knows when to hand off and gets a tuned result back without re-stating instructions every call.

  • 💸 Spend less. Routine offloads run locally and bill nothing
  • Keep the big model focused. Summaries, extractions, and drafts don't eat its context or your budget
  • 🧠 Tuned, not raw. summarize_local, code_review_local, draft_commit_message_local, and extract_local come with reviewer/summarizer/extractor system prompts already dialed in
  • 🔌 Drop-in. One MCP registration; works with Claude Code, Claude Desktop, Cursor, and any MCP client
  • 🪶 Tiny & auditable. Two dependencies (mcp, httpx), fully typed, unit-tested, no telemetry

Setting it up

Installation goes through your MCP client rather than a global install: point it at ollama-handoff on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

What the assistant can call

Once Ollama is connected, these are the calls the assistant has available:

  • ask_local — One-shot prompt to the local model
  • chat_local — Multi-turn local chat
  • summarize_local — Structured summary (headline + bullets)
  • code_review_local — Quick first-pass review of a diff/code
  • draft_commit_message_local — Conventional commit message from a diff
  • extract_local — Pull structured items from unstructured text
  • list_models — List locally available Ollama models
  • server_info — Report the effective configuration

Configuration and credentials

You will need 2 environment variables: OLLAMA_DEFAULT_MODEL, OLLAMA_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Ollama running locally (ollama serve) with at least one model pulled, e.g. ollama pull qwen2.5-coder:14b. - Python 3.11+ (or just uvx, which manages it for you).

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the ollama mcp server does with a few real requests.

Choosing this one

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Ollama's toolset — ask_local, chat_local, summarize_local and 5 more — is a fair guide to whether it matches your workflow. It is maintained by Michael-WhiteCapData; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

ToolWhat it does
ask_localOne-shot prompt to the local model
chat_localMulti-turn local chat
summarize_localStructured summary (headline + bullets)
code_review_localQuick first-pass review of a diff/code
draft_commit_message_localConventional commit message from a diff
extract_localPull structured items from unstructured text
list_modelsList locally available Ollama models
server_infoReport the effective configuration

How to install the Ollama MCP server

{
  "mcpServers": {
    "ollama-handoff": {
      "command": "uvx",
      "args": ["ollama-handoff"],
      "env": {
        "OLLAMA_DEFAULT_MODEL": "qwen2.5-coder:14b"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Ollama running locally (ollama serve) with at least one model pulled, e.g. ollama pull qwen2.5-coder:14b. - Python 3.11+ (or just uvx, which manages it for you).
VariableDescriptionRequired
OLLAMA_DEFAULT_MODELConfiguration value read at startup.Optional
OLLAMA_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Ollama to ask local.
  • Use Ollama to chat local.
  • Use Ollama to summarize local.

Frequently asked questions

It connects Ollama to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (ask_local, chat_local, summarize_local, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Ollama directly.