MCP server exposing local Ollama models as tools
console applicationNetworkSystemapt install mcp-server-ollamaOllama MCP Server exposes a local Ollama instance as a Model Context Protocol server, so AI clients can list, pull, run and chat with local models.
Supercharge your AI assistant with local LLM access โ run powerful AI models on your own computer, no internet required.
A Python MCP server that exposes your local Ollama models as tools for AI assistants like Windsurf, VS Code, Claude Desktop, and more.
| Links | |
|---|---|
| Docs | Full documentation |
| PyPI | mcp-ollama-python |
| VS Code UI | Companion extension: mcp-ollama-extension ยท docs ยท Marketplace |
These two repositories work together:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ mcp-ollama-extension (VS Code) โ โ start/stop, models UI, logs
โ https://github.com/pblagoje/ โ
โ mcp-ollama-extension โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ stdio / MCP
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ mcp-ollama-python (this repo) โ โ MCP tools for Ollama
โ https://github.com/pblagoje/ โ
โ mcp-ollama-python โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ HTTP :11434
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ Ollama โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
pip install mcp-ollama-python.You can also wire this server into any MCP client (Windsurf, Cursor, Claude Desktop, etc.) without the extension โ see Quick Start below.
Connect your local LLMs to any MCP-compatible AI assistant. No cloud APIs needed.
| Tool | What it does |
|---|---|
ollama_chat |
Chat with any local model (multi-turn, tool-calling) |
ollama_generate |
Generate text completions |
ollama_embed |
Create vector embeddings |
ollama_list |
List installed models |
ollama_show |
Inspect model details |
ollama_pull |
Download new models |
ollama_delete |
Remove models |
ollama_ps |
List running models |
Prerequisites: Python 3.10+, Ollama running locally
pip install mcp-ollama-python
mcp-ollama-python is installed (the extension can offer Install Now if missing)Details: extension docs ยท repo
Add to your MCP config (e.g. mcp_config.json):
{
"mcpServers": {
"ollama": {
"command": "py",
"args": ["-m", "mcp_ollama_python"],
"disabled": false
}
}
}
Restart your editor โ done. Your AI assistant can now use local Ollama models.
Type in your AI assistant's chat:
MCP Tool: ollama / ollama_chat โ Use model llama3.1 and explain quantum computing
tools/, it's auto-discovered| Guide | Description |
|---|---|
| Installation | Setup and prerequisites |
| Available Tools | All tools with examples |
| Configuration | Environment variables, model config |
| Windsurf Integration | Complete Windsurf setup guide |
| VS Code Integration | VS Code setup + companion extension |
| Architecture | How it works, adding tools |
| Server Control | Start/stop/manage the server |
| Interactive Manager | Menu-driven management UI |
| Development | Contributing, code quality |
| Security | Threat model, host validation, opt-in execute |
ollama_execute is opt-in โ set OLLAMA_EXECUTE_ENABLED=1; shell/bash removedOLLAMA_HOST validation โ loopback by default; set OLLAMA_ALLOW_REMOTE_HOST=1 for LAN/remote OllamaDetails: docs/SECURITY.md
mcp>=2.0.0,<3.0.0)on_* constructor callbacks and snake_case types__version__ mismatch with package versiontests/test_security.py and docs/SECURITY.md| Project | Role | Links |
|---|---|---|
| mcp-ollama-extension | VS Code UI for this server | GitHub ยท Docs ยท Marketplace |
| Ollama | Local LLM runtime | ollama.ai |
Made with โค๏ธ using Python, Poetry, and Ollama
This package may not be indexed in our database yet. Please try again later or check the package repository directly.