Ollama MCP Server
A 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.
README
Ollama MCP Server
A bridge to use Ollama as an MCP server from Claude Code.
Features
- ollama_generate: Single-turn text generation (supports vision models with image input)
- ollama_chat: Multi-turn chat conversations (supports vision models with image input)
- ollama_list: List available models
- ollama_show: Show model details
- ollama_pull: Download models
- ollama_embeddings: Generate text embeddings
Supported Vision Models
llava- General-purpose vision modelllama3.2-vision- Meta's multimodal modeldeepseek-ocr- OCR-specialized vision model
Prerequisites
-
Ollama installed and running
# Install Ollama (macOS) brew install ollama # Start Ollama server ollama serve -
At least one model downloaded
ollama pull llama3.2
Installation
cd ollama-mcp-server
npm install
npm run build
Claude Code Configuration
Method 1: Using CLI (Recommended)
# Add to local scope (current project)
claude mcp add --transport stdio ollama -- node /path/to/ollama-mcp-server/dist/index.js
# Add to user scope (all projects)
claude mcp add --transport stdio ollama --scope user -- node /path/to/ollama-mcp-server/dist/index.js
To add environment variables:
claude mcp add --transport stdio ollama \
--env OLLAMA_BASE_URL=http://localhost:11434 \
-- node /path/to/ollama-mcp-server/dist/index.js
Method 2: Manual Configuration
Project scope (.mcp.json in project root):
{
"mcpServers": {
"ollama": {
"command": "node",
"args": ["/path/to/ollama-mcp-server/dist/index.js"],
"env": {
"OLLAMA_BASE_URL": "http://localhost:11434"
}
}
}
}
User scope (~/.claude.json):
{
"mcpServers": {
"ollama": {
"command": "node",
"args": ["/path/to/ollama-mcp-server/dist/index.js"],
"env": {
"OLLAMA_BASE_URL": "http://localhost:11434"
}
}
}
}
Verify Installation
# List configured MCP servers
claude mcp list
# Inside Claude Code
/mcp
Auto-approve Tool Calls (Optional)
By default, Claude Code asks for confirmation each time an Ollama tool is called. To skip confirmations, add the following to ~/.claude/settings.json:
{
"permissions": {
"allow": [
"mcp__ollama__ollama_generate",
"mcp__ollama__ollama_chat",
"mcp__ollama__ollama_list",
"mcp__ollama__ollama_show",
"mcp__ollama__ollama_pull",
"mcp__ollama__ollama_embeddings"
]
}
}
Environment Variables
| Variable | Default | Description |
|---|---|---|
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama server URL |
Usage Examples
From Claude Code:
List Models
List available Ollama models
Text Generation
Generate "3 features of Rust" using Ollama's llama3.2 model
Chat
I'd like to have Ollama do a code review
Vision / Image Analysis
Analyze this image using llava: /path/to/image.jpg
Use deepseek-ocr to extract text from this document: /path/to/document.png
Troubleshooting
Cannot connect to Ollama
# Check if Ollama is running
curl http://localhost:11434/api/tags
# If not running
ollama serve
No models available
ollama pull llama3.2
MCP server not showing up
# Verify server is registered
claude mcp list
# Check server health
claude mcp get ollama
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.