mcp-server-ollama

An MCP server that exposes local Ollama models as tools: list/show/ps, chat, generate, embeddings, pull/delete, and an opt-in code-execution tool. Companion package: mcprack-mcp-server-ollama. Binary: /usr/bin/mcp-server-ollama.

Packaged fork of pblagoje/mcp-ollama-python.

sudo apt install mcprack-mcp-server-ollama

Configuration

Variable

Required

Meaning

OLLAMA_HOST

no

Ollama URL (default http://localhost:11434)

OLLAMA_API_KEY

no

API key for a remote or cloud Ollama endpoint (secret store)

OLLAMA_READ_ONLY

no

true (companion default) hides pull, delete and execute

OLLAMA_EXECUTE_ENABLED

no

Opt-in for the code-execution tool

OLLAMA_ALLOW_REMOTE_HOST

no

Allow OLLAMA_HOST to point off-loopback

Registration:

sudo mcprack server show mcp-server-ollama
sudo mcprack server edit mcp-server-ollama \
    --set-env OLLAMA_HOST=http://127.0.0.1:11434

Read-only behaviour: companion sets OLLAMA_READ_ONLY=true.

Tools

Model listing, chat, generate and embeddings stay available in read-only mode; pull, delete and execute require turning read-only off (and enabling execute explicitly for that tool).