Ollama Local Models

v2.1.0Coding Agentsstable

Enables 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 qu

claudeclaude-codeclinecursorllm
Share:
160
Stars
0
Downloads
0
Weekly
0/5

What is Ollama Local Models?

Ollama Local Models is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables 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 fi...

Enables 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 qu

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables Claude to delegate coding tasks to local Ollama mode

Use Cases

Delegate coding to local Ollama
Reduce API tokens by 98.75%
Code review and refactoring
rawveg

Maintainer

LicenseAGPL 3.0
Languagetypescript
Versionv2.1.0
UpdatedMay 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y ollama-mcp

Manual Installation

npx -y ollama-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Ollama Local Models

Ollama MCP Server bridges Claude and locally-running Ollama models, enabling Claude to delegate compute-heavy coding tasks to local LLMs and reducing Anthropic API token usage by up to 98.75%. It exposes 14 tools covering model management, inference (chat and generate), embeddings, and optional web search. This is ideal for developers who want Claude's reasoning and oversight while running repetitive code generation, review, or refactoring on local hardware.

Prerequisites

  • Ollama installed and running locally (https://ollama.com) — default endpoint http://127.0.0.1:11434
  • At least one Ollama model pulled (e.g., 'ollama pull codellama' or 'ollama pull llama3')
  • Node.js 18 or higher and npx available
  • An MCP client such as Claude Desktop, Claude Code, or Cline (VS Code)
1

Install and start Ollama

Download and install Ollama from ollama.com, then pull a model you want to use for code tasks. The server will default to connecting at http://127.0.0.1:11434.

ollama pull codellama
2

Add ollama-mcp to Claude Desktop

Edit your Claude Desktop configuration file to register the Ollama MCP server. The server requires no API key for local usage.

{
  "mcpServers": {
    "ollama": {
      "command": "npx",
      "args": ["-y", "ollama-mcp"]
    }
  }
}
3

Configure a custom Ollama host (optional)

If Ollama runs on a non-default host or port, or if you are using a cloud Ollama endpoint, set the OLLAMA_HOST environment variable in the config.

{
  "mcpServers": {
    "ollama": {
      "command": "npx",
      "args": ["-y", "ollama-mcp"],
      "env": {
        "OLLAMA_HOST": "http://127.0.0.1:11434",
        "OLLAMA_API_KEY": "your-api-key-if-needed"
      }
    }
  }
}
4

Restart Claude Desktop

After saving the configuration file, fully quit and relaunch Claude Desktop to load the new MCP server. You should see Ollama tools become available in Claude's tool list.

5

List available models

Ask Claude to list the Ollama models available on your machine to verify the connection is working.

6

Delegate a coding task

Ask Claude to use a local Ollama model for a specific task. Claude will route the request through the MCP server to your local Ollama instance and return the result.

Ollama Local Models Examples

Client configuration

Minimal Claude Desktop configuration for local Ollama usage — no API key required for local models.

{
  "mcpServers": {
    "ollama": {
      "command": "npx",
      "args": ["-y", "ollama-mcp"],
      "env": {
        "OLLAMA_HOST": "http://127.0.0.1:11434"
      }
    }
  }
}

Prompts to try

Use these prompts with Claude once Ollama MCP is connected to leverage local models for coding tasks.

- "List all Ollama models available on my machine"
- "Use the codellama model to review this function for bugs: [paste code]"
- "Generate a Python class for a REST API client using the local llama3 model"
- "Refactor this JavaScript file using Ollama to reduce token costs"
- "Generate embeddings for this text using nomic-embed-text"

Troubleshooting Ollama Local Models

Connection refused when Claude tries to reach Ollama

Verify Ollama is running with 'ollama serve' and listening on the default port: curl http://127.0.0.1:11434/api/tags. If OLLAMA_HOST is set in the environment, make sure the MCP config reflects the same value.

Model not found error when running a task

The model must be pulled before it can be used. Run 'ollama pull <model-name>' in your terminal first. Use the list models tool in Claude to see which models are currently available.

Web search tools are unavailable

Web search and page fetch tools require OLLAMA_API_KEY to be set. These features are cloud-only. Set OLLAMA_API_KEY in the MCP server env config to enable them.

Frequently Asked Questions about Ollama Local Models

What is Ollama Local Models?

Ollama Local Models is a Model Context Protocol (MCP) server that enables 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 qu It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Ollama Local Models?

Install via npm with the command: npx -y ollama-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Ollama Local Models?

Ollama Local Models works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Ollama Local Models free to use?

Yes, Ollama Local Models is open source and available under the AGPL 3.0 license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ollama-mcp-server": { "command": "npx", "args": ["-y", "ollama-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Ollama Local Models?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides