ollama
An MCP Server for Ollama
claude mcp add --transport stdio rawveg-ollama-mcp npx -y ollama-mcp \ --env OLLAMA_HOST="http://127.0.0.1:11434" \ --env OLLAMA_API_KEY=""
How to use
This MCP server exposes the complete Ollama SDK as MCP tools, allowing you to manage local models and perform generation, chat, embeddings, and web-enabled operations through MCP clients like Claude Desktop and Cline. The available tools are grouped into model management (list, show, pull, push, copy, delete, create), model operations (ps, generate, chat, embed), and web tools that leverage Ollama Cloud (web_search and web_fetch). You can also run in hybrid mode to access both local Ollama models and cloud capabilities via an API key. To use, run the MCP server per the installation instructions and configure your MCP client to connect to the ollama MCP entry (e.g., ollama with the ollama-mcp package). When using web tools, you’ll need an Ollama Cloud API key and proper environment variables as described in the configuration section.
How to install
Prerequisites:
- Node.js (recommended LTS) and npm installed on your machine
- Optional: Ollama server running locally or cloud access configured
Installation steps:
-
Install the MCP server globally: npm install -g ollama-mcp
-
Start the MCP server (example): npm run ollama-mcp start // Or rely on your system manager to run the installed CLI binary if provided
-
Configure your MCP client to connect to the ollama MCP server. For Claude Desktop or Cline, add an entry similar to: { "mcpServers": { "ollama": { "command": "npx", "args": ["-y", "ollama-mcp"] } } }
-
Optional: override host or API key via environment variables for cloud or custom setups as described in the configuration section of the README.
Additional notes
Tips and considerations:
- Environment variables: OLLAMA_HOST defines the Ollama endpoint (local by default); OLLAMA_API_KEY is required for web tools and cloud features.
- Hybrid mode: you can combine local and cloud models by setting OLLAMA_HOST to your local Ollama instance and providing an API key for cloud web tools.
- Retry behavior: the server includes automatic retry logic for transient errors when using web tools (429, 500, 502, 503, 504) with configurable backoff and respect for Retry-After headers. Ensure network access to Ollama APIs and Ollama Cloud when enabled.
- Tool discovery: Ollama MCP auto-discovers tools at startup; zero-config setup is supported for common environments.
- Cloud features require an Ollama Cloud API key and may incur usage costs.
Related MCP Servers
fastapi_mcp
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
claude-talk-to-figma
A Model Context Protocol (MCP) that allows Claude Desktop and other AI tools (Claude Code, Cursor, Antigravity, etc.) to read, analyze, and modify Figma designs
mcp-tasks
A comprehensive and efficient MCP server for task management with multi-format support (Markdown, JSON, YAML)
omega-memory
Persistent memory for AI coding agents
mcp-sysoperator
MCP for Ansible, Terraform, LocalStack, and other IaC tools. Create and iterate IaC
metabase-ai-assistant
🚀 The most powerful MCP Server for Metabase - 111+ tools for AI SQL generation, dashboard automation & enterprise BI. Works with Claude, Cursor, ChatGPT.