Labsco
MCP SERVER

Ollama MCP Server

by NewAITees

Puts a local Ollama model behind MCP tools for task decomposition and result evaluation — break a hard problem into subtasks, then score the output against your criteria.

Model Routing, Multi-Model Consultation & Cost Control
Summary
A second, local model doing the structured thinking.

The point is not to replace your assistant but to give it a place to offload decomposition and evaluation onto a model running on your own hardware — no per-token cost and nothing leaving the machine. It checks at startup whether the configured model exists and warns if not, which saves the confusing failure where every call errors for a reason nobody surfaces.

What it is

An MCP server that sits in front of a local Ollama instance and uses it for structured work rather than chat. The design pairs each tool with a prompt schema: the prompt shapes how the model thinks, the tool carries out the action, so decomposition and evaluation come back structured instead of as prose.

What you get
  • `add-task` — create a task from `name` and `description`, with optional `priority`, `deadline` and `tags`, returning its identifier
  • `decompose-task` — break a task into subtasks at a `granularity` of high, medium or low, capped by `max_subtasks`, returning dependencies and estimated complexity
  • `evaluate-result` — score a result against a `criteria` object, with `detailed` for the long form, returning a score and suggested improvements
  • `run-model` — run any Ollama model directly with a `prompt`, `temperature` and `max_tokens`
  • Matching prompts, `decompose-task` and `evaluate-result`, that give the model the structure each tool expects
  • Resources under three URI schemes — `task://` for individual tasks, `result://` for evaluations, `model://` for the models available
  • Connection pooling and an LRU cache, both sized in `config.py`, so repeated similar requests do not hit Ollama again
  • Errors that name what went wrong, including the list of available models when the one you asked for is missing
Requirements

A running Ollama with at least one model pulled — `ollama pull llama3` is the documented starting point. `OLLAMA_HOST` defaults to `http://localhost:11434`, `DEFAULT_MODEL` to `llama3`, and `LOG_LEVEL` controls verbosity. The model is chosen in order of precedence: the `model` parameter on the call, then the `env` block in your MCP config, then `OLLAMA_DEFAULT_MODEL`, then the default. The client runs it as `python -m ollama_mcp_server`. Package `ollama-mcp-server`.