mcp-ollama-python
Provides tools to interact with local Ollama models for chat, generation, embeddings, and model management.
Click on "Install 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-pythonChat with llama3.1 about quantum computing"
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.
๐ฆ Ollama MCP Server (Python)
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 | |
PyPI | |
VS Code UI | Companion extension: mcp-ollama-extension ยท docs ยท Marketplace |
Ecosystem
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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโThis package is the MCP server (required). Install with
pip install mcp-ollama-python.MCP Ollama Manager is the optional VS Code UI to manage that server. Prefer it if you use VS Code and want status bar controls, model sidebar, and log viewing without editing JSON by hand.
You can also wire this server into any MCP client (Windsurf, Cursor, Claude Desktop, etc.) without the extension โ see Quick Start below.
Related MCP server: MCP-Demo
What It Does
Connect your local LLMs to any MCP-compatible AI assistant. No cloud APIs needed.
Tool | What it does |
| Chat with any local model (multi-turn, tool-calling) |
| Generate text completions |
| Create vector embeddings |
| List installed models |
| Inspect model details |
| Download new models |
| Remove models |
| List running models |
Quick Start
Prerequisites: Python 3.10+, Ollama running locally
pip install mcp-ollama-pythonOption A โ VS Code with the companion extension (recommended for VS Code)
Install MCP Ollama Manager from the Marketplace
Ensure
mcp-ollama-pythonis installed (the extension can offer Install Now if missing)Command Palette โ MCP Ollama: Configure Server โ MCP Ollama: Start Server
Details: extension docs ยท repo
Option B โ Any MCP client (Windsurf / VS Code MCP / Cursor / โฆ)
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.
Try It
Type in your AI assistant's chat:
MCP Tool: ollama / ollama_chat โ Use model llama3.1 and explain quantum computing
Key Features
๐ง 8 MCP tools โ Full Ollama SDK access
๐ Hot-swap architecture โ Drop a file in
tools/, it's auto-discovered๐ฏ Type-safe โ Pydantic models throughout
๐ Lightweight โ Minimal dependencies, fast startup
๐ Universal โ Works with any MCP client
Documentation
Guide | Description |
Setup and prerequisites | |
All tools with examples | |
Environment variables, model config | |
Complete Windsurf setup guide | |
VS Code setup + companion extension | |
How it works, adding tools | |
Start/stop/manage the server | |
Menu-driven management UI | |
Contributing, code quality | |
Threat model, host validation, opt-in execute |
Security (v1.0.8)
ollama_executeis opt-in โ setOLLAMA_EXECUTE_ENABLED=1; shell/bash removedOLLAMA_HOSTvalidation โ loopback by default; setOLLAMA_ALLOW_REMOTE_HOST=1for LAN/remote OllamaNo HTTP redirects โ reduces SSRF risk toward internal endpoints
Details: docs/SECURITY.md
Changelog
1.0.8
Security hardening: host validation, execute tool gating, env allowlist, input limits
Fixed
__version__mismatch with package versionAdded
tests/test_security.pyanddocs/SECURITY.md
Related Projects
Project | Role | Links |
VS Code UI for this server | GitHub ยท Docs ยท Marketplace | |
Local LLM runtime |
License
Made with โค๏ธ using Python, Poetry, and Ollama
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA universal MCP server that integrates with local Ollama instances, enabling AI-powered chat, model management, and text generation from any MCP-compatible IDE or application.Last updated1083MIT
- AlicenseBqualityBmaintenanceAn MCP server that turns your machine or LAN of ollama nodes into a local token generator, enabling coding agents to delegate bounded processing tasks to local models and save cloud credits.Last updated51MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pblagoje/mcp-ollama-python'
If you have feedback or need assistance with the MCP directory API, please join our Discord server