Ollama Local Models
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
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
Maintainer
Works with
Installation
NPM
npx -y ollama-mcpManual Installation
npx -y ollama-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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 codellamaAdd 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"]
}
}
}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"
}
}
}
}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.
List available models
Ask Claude to list the Ollama models available on your machine to verify the connection is working.
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.
Ollama Local Models Alternatives — Similar Coding Agents Servers
Looking for alternatives to Ollama Local Models? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up Ollama Local Models in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.