MCP Ollama Server
Provides tools for interacting with Ollama models, including generating text, chat conversations, model management (list, pull, delete, info), and generating embeddings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Ollama Server generate a haiku about AI using llama3.2"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Ollama Server
A Model Context Protocol (MCP) server that provides direct access to Ollama models for AI inference.
Features
🚀 Direct Model Access: Generate responses and chat with any Ollama model
💬 Chat Support: Maintain conversation context with chat endpoints
📋 Model Management: List, pull, delete, and get info about models
🔢 Embeddings: Generate text embeddings for semantic search
🔧 Full Control: Configure temperature, max tokens, and system prompts
✅ Status Checking: Automatic Ollama availability detection
Related MCP server: Ollama MCP Server
Installation
Prerequisites:
Ollama installed and running
Node.js 18+ installed
Install the MCP server:
cd /Users/bard/Code/mcp-ollama npm install npm run buildAdd to Claude Desktop config: Edit
~/Library/Application Support/Claude/claude_desktop_config.json:{ "mcpServers": { "ollama": { "command": "node", "args": ["/Users/bard/Code/mcp-ollama/dist/index.js"], "env": { "OLLAMA_BASE_URL": "http://localhost:11434" } } } }Restart Claude Desktop
Usage
Generate Text
// Simple generation
ollama_generate({
prompt: "What is the meaning of life?"
})
// With system prompt and parameters
ollama_generate({
model: "llama3.2",
prompt: "Write a haiku about coding",
system: "You are a creative poet",
temperature: 0.9,
max_tokens: 100
})Chat Conversations
// Multi-turn conversation
ollama_chat({
model: "llama3.2",
messages: [
{ role: "system", content: "You are a helpful assistant" },
{ role: "user", content: "What is Python?" },
{ role: "assistant", content: "Python is a high-level programming language..." },
{ role: "user", content: "What makes it good for beginners?" }
]
})Model Management
// List available models
ollama_list()
// Pull a new model
ollama_pull({ model: "mistral" })
// Get model information
ollama_info({ model: "llama3.2" })
// Delete a model
ollama_delete({ model: "old-model" })Generate Embeddings
// Generate embeddings for semantic search
ollama_embeddings({
model: "nomic-embed-text",
prompt: "The quick brown fox jumps over the lazy dog"
})Available Models
Popular models you can use:
llama3.2- Fast, efficient general-purpose modeldeepseek-r1- Advanced reasoning modelmistral- Efficient 7B parameter modelgemma:2b- Google's small efficient modelphi3:mini- Microsoft's compact modelnomic-embed-text- For generating embeddings
Pull any model with:
ollama pull <model-name>Configuration
Environment Variables
OLLAMA_BASE_URL: Ollama API endpoint (default:http://localhost:11434)
Tool Parameters
ollama_generate
model: Model to use (default: "llama3.2")prompt: Input prompt (required)system: System prompt (optional)temperature: Sampling temperature 0-1 (default: 0.7)max_tokens: Maximum tokens to generate (default: 2048)stream: Stream responses (default: false)
ollama_chat
model: Model to use (default: "llama3.2")messages: Array of chat messages (required)temperature: Sampling temperature 0-1 (default: 0.7)max_tokens: Maximum tokens to generate (default: 2048)
Troubleshooting
Ollama not running
If you see "❌ Ollama is not running", start Ollama:
ollama serveNo models available
Pull a model first:
ollama pull llama3.2Different Ollama port
If Ollama runs on a different port, update the config:
{
"env": {
"OLLAMA_BASE_URL": "http://localhost:YOUR_PORT"
}
}Differences from ELVIS
This MCP server provides direct, synchronous access to Ollama models, unlike ELVIS which uses a delegation/queue pattern. Benefits:
Immediate responses: No waiting for task completion
Simpler API: Direct function calls instead of task management
Native chat support: Built-in conversation handling
Model management: Pull, delete, and inspect models
Embeddings support: Generate embeddings for RAG applications
Development
Running in development:
npm run devBuilding:
npm run buildTesting:
# Test generate
curl -X POST http://localhost:11434/api/generate \
-d '{"model": "llama3.2", "prompt": "Hello"}'
# Test chat
curl -X POST http://localhost:11434/api/chat \
-d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Hello"}]}'License
MIT
Available Tools
7 toolsollama_chatB
Chat with an Ollama model (maintains conversation context)
Inputs: messages (required), model, max_tokens, temperature.
ollama_deleteC
Delete a model from local storage
Inputs: model (required).
ollama_embeddingsC
Generate embeddings using an Ollama model
Inputs: prompt (required), model.
ollama_generateC
Generate a response from an Ollama model
Inputs: prompt (required), model, stream, system, +2 more.
ollama_infoC
Get detailed information about a model
Inputs: model (required).
ollama_listB
List available Ollama models
Inputs: no named parameters.
ollama_pullC
Pull/download a model from Ollama registry
Inputs: model (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a clearly distinct action: lifecycle operations (pull, delete, info, list) versus inference operations (generate, chat, embeddings). The only potentially confusable pair, generate vs chat, is explicitly differentiated by the 'maintains conversation context' note. An agent can select correctly from names alone.
Every tool uses the identical ollama_<verb> snake_case pattern with no deviations or mixed conventions. Names are short, predictable, and self-describing.
Seven tools is well within the ideal 3-15 range and covers both model management and inference without redundancy. No tool feels like filler or a near-duplicate of another.
The surface covers the full model lifecycle (pull, list, info, delete) plus all three primary inference modes (generate, chat, embeddings), which is solid core coverage. Minor gaps exist: no way to list running/loaded models, create a model from a Modelfile, copy, or push, but these are edge workflows agents can largely work around.
Maintenance
Related MCP Connectors
Chat with any LLM, generate images, browse models and check your usage and costs.
Run AI models, create deployments, and manage predictions via cloud API
Pay-per-call embeddings, sentiment, classify, PII, chat, translate and rerank. No API key.
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with locally running Ollama models through chat, generation, and model management operations. Supports listing, downloading, and deleting models while maintaining conversation history for interactive sessions.MIT
- AlicenseBqualityDmaintenanceEnables complete local Ollama management including listing models, chatting with local LLMs, starting/stopping the server, and getting intelligent model recommendations for specific tasks through natural language commands.94MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible AI assistants to manage and use local or cloud Ollama models for text generation, chat, embeddings, model operations, web search, and web content fetching.727 npmAGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to access local or cloud LLMs, manage and run models, generate completions and embeddings, chat with tool/function support, and use web search/fetch through Ollama Cloud.727 npmAGPL 3.0