Skip to content
MCP Server Directory logo
developer-tools

Ollama Mcp

An MCP Server for Ollama

Reviewed overview

MCP 服务器概览

What is the project about? Ollama MCP Server is an implementation of the Model Context Protocol (MCP) that exposes the full Ollama SDK as MCP tools. It lets MCP-compatible clients (e.g., Claude Desktop, Cline) access local and Ollama Cloud LLM models and SDK functionality through a standardized tool interface.

How to use the project?

  • Quick install: npm install -g ollama-mcp or run via npx in your MCP client config.
  • Configure your MCP client (Claude Desktop, Cline) to launch the server (example JSON provided in repo).
  • Set environment variables: OLLAMA_HOST (default http://127.0.0.1:11434) and OLLAMA_API_KEY (required for Ollama Cloud web tools).
  • Invoke tools via MCP calls (examples: ollama_chat, ollama_generate, ollama_embed, ollama_web_search).
  • For hybrid mode, point OLLAMA_HOST to a local instance and set OLLAMA_API_KEY to enable cloud-only features.

Key features

  • Full Ollama SDK exposed as 14+ MCP tools (model management, chat, generate, embed, web search/fetch).
  • Ollama Cloud support and hybrid local+cloud operation.
  • Hot-swap autoloader: add new tools by dropping files into src/tools without server changes.
  • Type-safe TypeScript implementation with Zod validation and high test coverage (~96%).
  • Zero runtime dependencies and designed for drop-in integration with MCP clients.
  • Robust retry and backoff logic for web tools (handles 429, certain 5xx, respects Retry-After, 30s timeouts).

Use cases

  1. Enable assistant apps (Claude Desktop, Cline) to call local Ollama models for chat, generation, and embeddings.
  2. Centralize model management (list, pull, push, copy, delete, create) via MCP tools for automation or tooling UIs.
  3. Combine local privacy-preserving inference with cloud web search/fetch for up-to-date context.
  4. Build tool-enabled assistants that call models and web fetches reliably with retry/backoff handling.
  5. Rapidly extend capabilities by adding custom MCP tools for domain-specific functions.

FAQ

  • Do I need Ollama running locally?

    For local models: yes, point OLLAMA_HOST at your Ollama instance. For cloud models and web tools, supply OLLAMA_API_KEY and use https://ollama.com.

  • What clients are supported?

    Any MCP-compatible client (tested with Claude Desktop and Cline). The server is a drop-in MCP server.

  • How do I add new tools?

    Create a new file exporting toolDefinition under src/tools/ and the autoloader will discover it automatically. Add tests per project guidelines.

  • What about retries and timeouts?

    Web tools auto-retry on transient errors (429, 500, 502, 503, 504) with exponential backoff and jitter (max 3 retries). Requests timeout after 30s and Retry-After is respected when provided.

  • What is the license?

    AGPL-3.0 (GNU Affero General Public License v3.0).