Ollama MCP Agent allows you to use LLM models locally on your PC for free. Using Ollama's locally installed LLM models along with MCP (Model Context Protocol) additional features, you can easily extend LLM functionality.
- contains Ollama(main.py), Gemini(gemini.py) example
- Inspired by: Teddynote-lab's mcp agents, langchain mcp adapters
- Contributor: odeothx
- Run LLM models locally on your PC (no additional costs)
- Extend LLM capabilities through MCP
- Streaming response output
- Tool call information monitoring
- Python 3.12 or higher
- Ollama installation
- uv - Fast Python package installer and resolver
- MCP server (optional)
- Clone repository
git clone https://github.com/godstale/ollama-mcp-agent
cd ollama-mcp-agent- Install uv (if not installed)
# Using pip
pip install uv
# Or using curl (Unix-like systems)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using PowerShell (Windows)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"- Create virtual environment and install dependencies
# Install dependencies
uv sync- Install Ollama and download model
# Install Ollama (refer to https://ollama.ai for platform-specific installation)
# Download LLM model which supports Tool calling feature
ollama pull qwen3:14b