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
Tento balíček zatím možná není v naší databázi zaindexován. Zkuste to prosím později, nebo zkontrolujte přímo repozitář balíčků.