Two of the top five results for "ollama mcp" hand you a Python script: list the server's tools, reshape them into Ollama's tools format, loop over the tool calls. The Medium version stops after the first call and, by its author's own account, never feeds the tool's answer back to the model. Either way, you now maintain a bridge.
You rarely need one. Getting Ollama MCP working in 2026 is a client choice plus two settings, and when the settings are wrong every client fails the same way.
The short answer: Ollama does not ship an MCP client. The feature request has been open since November 2024, and no release note through v0.35.0 (September 28, 2026) mentions MCP. Use an MCP client that talks to Ollama's API: ollama launch wires Claude Code, Codex or OpenCode to it in one command, ollmcp gives you a terminal chat with tools, and Octomind's local: provider can keep every model call, background ones included, on your machine. Then check two things: the model has the tools capability, and the context window is bigger than your tool definitions. Below 24 GiB of VRAM Ollama gives you 4,096 tokens, and Playwright MCP's 25 tool definitions alone come to about 3,900.
Does Ollama Support MCP Natively?
No, as of v0.35.0, checked October 2, 2026. Ollama is the model server: its API accepts a tools array and returns tool_calls (Ollama tool calling docs). Starting MCP servers, listing their tools, running the calls and returning results is the client's job, and Ollama doesn't do it.
The receipts: issue #7865 is open with 220 reactions; an Ollama maintainer's last word there, in July 2025, was "We're working on it!"; a contributor posted an unmerged client branch in August 2026. A search of every Ollama release note returns no MCP mention. The only MCP code Ollama documents is a Python server that exposes Ollama's web search to other clients.
What Ollama does ship is ollama launch (since v0.15.0, January 2026), which configures and starts external agents against your Ollama server. Those agents are MCP clients, so that is the shortest path for most people.
"Ollama MCP server" also gets used for the opposite direction, which is why the top result confuses people. Pick by direction:
- You want Claude Desktop or Cline to drive your local models (pull them, chat with them): that is rawveg/ollama-mcp, an AGPL-3.0 server with 14 tools such as
ollama_chatandollama_pull. - You want your local model to call tools (files, a browser, a database): you need an MCP client that uses Ollama as its model. That's the rest of this guide. If you're fuzzy on clients versus servers, start with what MCP is.
Which Ollama MCP Client Should You Use?
Pick by where you already work. Every client below was checked on October 2, 2026.
| Client | Reaches Ollama via | Add an MCP server | License · latest release | Catch |
|---|---|---|---|---|
Claude Code (ollama launch claude) | Anthropic-compatible /v1/messages | claude mcp add --transport stdio <name> -- <cmd> | Proprietary · v2.1.287 | Tool search switches off for a non-Anthropic base URL, so every MCP tool loads into every request |
Codex (ollama launch codex) | Responses API on /v1 | codex mcp add <name> -- <cmd> | Apache-2.0 · 0.160.0 | Open bug #19871: MCP calls unreliable with Ollama since Codex 0.117.0 |
OpenCode (ollama launch opencode) | OpenAI-compatible /v1 | "mcp" block in opencode.json, "type": "local" | MIT · v1.18.34 | Ollama says it needs 64k+ context |
| ollmcp | Ollama's native API | ollmcp mcp add <name> -- <cmd> | MIT · v0.35.1 | A chat TUI, not a coding agent; Python 3.11+ |
| ollama-mcp-bridge | Proxy on port 8000 in front of /api/chat | mcp-config.json | MIT · v0.12.2 | Only /api/chat gets tools; OpenAI-style /v1 calls pass through without them |
| Goose | Its Ollama provider (OLLAMA_HOST) | goose configure or ~/.config/goose/config.yaml | Apache-2.0 · v1.52.0 | Its docs blame extension trouble on the 4,096-token default |
| Open WebUI | Its Ollama connection | Admin > Integrations, type MCP (Streamable HTTP) | Open WebUI License (BSD-3 plus a branding clause) · v0.11.4 | No stdio servers without the mcpo proxy |
| Octomind (ours) | OpenAI-compatible /v1/chat/completions | [[mcp.servers]] in TOML | Apache-2.0 · 0.55.2 | Context must be set on the Ollama server; three model profiles to repoint |
Sources for each row: Ollama's Claude Code, Codex and OpenCode integration pages, Claude Code MCP docs, Codex MCP docs, OpenCode MCP docs, Goose provider docs, Open WebUI MCP docs, and each project's GitHub releases.
Two names from older guides are gone. MCPHost, the tool in ClickHouse's walkthrough, is archived; its README points users to its successor, Kit, which supports Ollama and MCP servers. Continue shipped a final 2.0.0 release and its repository is now read-only.
- Pick
ollama launchwith an agent you already use if you code in one. Prefer OpenCode or Claude Code over Codex until #19871 closes. - Pick ollmcp to try an MCP server against a local model with three commands. It asks before each tool runs (on by default) and sets
num_ctxper session. - Pick ollama-mcp-bridge when an existing app already calls Ollama's
/api/chatand you want tools without touching its code. The bridge runs tool calls itself, round after round, until the model stops asking. - Pick Goose or Open WebUI for a desktop or browser UI, Open WebUI when several people share one server.
- Pick Octomind when every model call, including background ones, must stay local and you want the setup in one config file you can commit or script.
The two quickest paths, as the projects document them:
# An agent you already use: register the server, then launch against Ollama
claude mcp add --transport stdio playwright -- npx -y @playwright/mcp@latest
ollama launch claude --model <model>
# A terminal chat with tools
uv tool install --upgrade ollmcp
ollmcp mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects/demo
ollmcp --model <model>Both fail on the same two settings, so check them before you blame the client.
First Check: Can Your Model Call Tools?
If the model lacks the tools capability, Ollama rejects any request that carries tools with an HTTP 400. Look for tools before anything else:
ollama show <model> # "tools" should appear under Capabilities
curl -s http://localhost:11434/api/show -d '{"model":"<model>"}' | jq .capabilitiesExpected: an array such as ["completion","tools","thinking"], the capabilities field of Ollama's show-model API. Browse candidates with the tools filter on ollama.com, and see which open-weight models hold up on coding if that's the work.
Error: registry.ollama.ai/library/<model> does not support tools. This is the exact 400 users report in issue #14795. In Ollama v0.35.0 the check happens before the model loads (scheduleRunner in server/routes.go), so this is a hard failure, not the silent tool-ignoring some guides describe. It usually hits models you imported yourself.
From v0.30, which added GGUF models from Hugging Face, a GGUF's embedded chat template grants tools when it mentions tools, and Ollama prefers it over a Modelfile TEMPLATE without tool support (server/images.go at v0.35.0). So on current versions the error means that embedded template has no tool handling, or something forces Ollama's own rendering over it: a RENDERER or PARSER in your Modelfile, or OLLAMA_GO_TEMPLATE=1 on the server. Fix it with a GGUF build whose embedded template handles tools, by removing that override, or by pulling a tools-tagged library model.
Symptom: the model has tools but answers in prose. That's a model-size problem, not a wiring one. In ClickHouse's own test, an 8B Qwen model had to be told explicitly to list databases before querying, and the authors suggest a 14B model to partly fix it. Name the tool in your prompt, load fewer tools, or move up a size.
The Ollama Context Length Trap: MCP Tools Eat the Default Window
Every request carries every tool definition, and Ollama's default window is small. Unless you set it, Ollama's context-length docs give 4k below 24 GiB of VRAM, 32k at 24–48 GiB and 256k above; the v0.35.0 source sets the same tiers. The same page recommends at least 64,000 tokens for "web search, agents, and coding tools".
The default doesn't depend on the model: the Qwen 3.5 library page lists a 256K window for every size from 0.8B to 122B, and on a 16 GB machine you still get 4,096.
I measured what popular MCP servers cost. I started each one with npx, ran initialize and tools/list over stdio, converted the tools to the {"type":"function","function":{…}} shape Ollama's templates embed, and counted compact JSON with OpenAI's o200k_base tokenizer:
| MCP server (version) | Tools | Tokens | Share of a 4,096 window |
|---|---|---|---|
Filesystem (@modelcontextprotocol/server-filesystem 2026.8.31) | 14 | 1,736 | 42% |
| octofs 0.16.1 (ours) | 6 | 2,193 | 54% |
| Playwright MCP 0.0.83 | 25 | 3,889 | 95% |
| Chrome DevTools MCP 1.10.1 | 30 | 5,689 | 139% |
| Filesystem + Playwright | 39 | 5,625 | 137% |
Your model's tokenizer will count differently, so treat these as estimates. They also exclude the template's tool instructions, the client's system prompt and the client's own built-in tools, so real use costs more. Tool count is a poor proxy: octofs has 6 tools and costs more than the filesystem server's 14.
What overflow looks like. Ollama's chat handler drops the oldest messages first, always keeping the system messages and the latest one (server/prompt.go), and logs that only at debug level. Earlier tool calls and their results go with those old turns, so expect repeated calls or answers that ignore what a tool already returned. If even the system prompt, tools and latest message don't fit, v0.35.0's llama-server runner, depending on its context-shift setting, either logs truncating input prompt or returns the prompt is longer than the context length currently available to the model.
Claude Code with Ollama pays in full. ollama launch claude points ANTHROPIC_BASE_URL at your Ollama server, and Claude Code turns tool search off for non-first-party hosts, per its MCP docs. Every server's definitions go upfront, and Ollama's Anthropic compatibility page lists deferred tools as "not fully supported" anyway.
The fix: set the window on the server.
# Server you start yourself
OLLAMA_CONTEXT_LENGTH=65536 ollama serve
# macOS app (or use the context slider in Settings), then restart Ollama
launchctl setenv OLLAMA_CONTEXT_LENGTH 65536
# Linux service: run `sudo systemctl edit ollama.service`, add the two lines below, restart
[Service]
Environment="OLLAMA_CONTEXT_LENGTH=65536"Native-API clients such as ollmcp can send num_ctx per request instead. OpenAI-compatible clients can't: per Ollama's OpenAI compatibility docs, that API "does not have a way of setting the context size". For those, use the server variable or bake a variant with a Modelfile containing FROM <model> and PARAMETER num_ctx 65536, then ollama create <model>-64k -f Modelfile.
Verify with ollama ps: the CONTEXT column shows what the loaded model got. The server log line vram-based default context shows the default Ollama picked (~/.ollama/logs/server.log on macOS, journalctl -u ollama on Linux).
Then budget memory and tools. A bigger window needs more memory, and the Ollama FAQ notes RAM scales with OLLAMA_NUM_PARALLEL × OLLAMA_CONTEXT_LENGTH. If ollama ps shows part of the model on CPU, drop to 32k and cut tools instead. Most clients can filter: limiting Playwright to browser_navigate, browser_snapshot, browser_click and browser_type measured 610 tokens instead of 3,889, an 84% cut. If a tool is one shell command away, consider skipping the MCP server entirely.
Fully Local Ollama MCP Setup With Octomind
Octomind is ours. It fits the strict case, where model, supervisor, compression and MCP servers share one config and nothing goes to a hosted model; the model side is covered in running a coding agent on Ollama.
Prerequisites: Octomind 0.55.2 (macOS or Linux; Windows through Git Bash or MSYS2), Node.js for npx, Git, Ollama with a tools-capable model, and network access once so the built-in tap can download the developer:general specialist.
1. Start Ollama with cloud features off and a 64k window.
OLLAMA_NO_CLOUD=1 OLLAMA_CONTEXT_LENGTH=65536 ollama serve
ollama pull qwen3.5:9b # or any model whose capabilities include toolsExpect Ollama cloud disabled: true in the server log (Ollama FAQ).
2. Add one overlay file. Octomind merges every *.toml in its config directory, so create ~/.local/share/octomind/config/ollama-mcp.toml:
telemetry = false
max_session_tokens_threshold = 56000
[model]
name = "local:qwen3.5:9b"
max_tokens = 8192
[supervisor.model]
name = "local:qwen3.5:9b"
[compression]
threshold = 40000
[compression.model]
name = "local:qwen3.5:9b"
[[mcp.servers]]
name = "playwright"
type = "stdio"
command = "npx"
args = ["-y", "@playwright/mcp@latest"]
timeout_seconds = 60
tools = ["browser_navigate", "browser_snapshot", "browser_click", "browser_type"]
auto_bind = ["developer:general"]local: defaults to http://localhost:11434/v1/chat/completions, and all three profiles point there because -m changes only the conversation model. Octomind's default ceilings, a 200,000-token context cap and compression at 70,000 (compression doc), both exceed a 65,536 window, so the file caps the context at 56,000 (leaving 8,192 for output) and compresses from 40,000; nearing the cap forces a compression fold and the session carries on. Those three numbers are arithmetic from the documented defaults for a 64k window, not measured values.
tools is the filter measured above; auto_bind attaches the server to the specialist (MCP tools doc). Telemetry never sends code or prompts, but it is on by default, so the file turns it off.
octomind config --validateI ran this exact file through octomind config --validate on 0.55.2 and got "Configuration is valid."; octomind config --show listed local:qwen3.5:9b as the root model and Playwright with its four tools.
3. Run and inspect.
octomind run developer:general -m local:qwen3.5:9bInside the session, /mcp list should list playwright, and /mcp full shows the schemas your enabled servers advertise. Ask "Open https://example.com and tell me the page title". The model should call browser_navigate, then browser_snapshot. In a second terminal, ollama ps should show your model with 65536 under CONTEXT.
[AUTHOR: Run steps 1–3 end to end on Octomind 0.55.2 with local:qwen3.5:9b and paste the /mcp list output, the browser_navigate call and the ollama ps line. Did the supervisor and compression calls succeed on a 9B model?]
Undo: delete ollama-mcp.toml, then restart Ollama without the two variables (launchctl unsetenv OLLAMA_CONTEXT_LENGTH for the macOS app).
Where Local MCP Still Breaks
Small models choose tools badly. The wiring can be perfect and a small model will still need the tool named for it, as ClickHouse found with an 8B Qwen. Every extra server also eats the window measured above. Start with one server and a filter.
Memory decides the window, not the model card. A 256K-capable model on a 16 GB laptop is a 4K model until you raise the setting, and raising it may push layers onto the CPU. ollama ps tells you which happened.
Client bugs are real and dated. Codex's Ollama MCP regression has been open since April 2026. Claude Code on Ollama loses tool search. Open WebUI won't run stdio servers natively.
Octomind costs more local inference per turn. Supervisor and compression are extra model calls on your GPU, which a plain chat client like ollmcp doesn't make. Octomind also has no approval popups: a local model with a browser acts without asking. Scope it with a role, with guardrails, and with --sandbox, which limits writes to the working directory on Linux and macOS while reads stay open.
Get Octomind — point local: at Ollama and give the model only the tools you choose.
FAQ
Does Ollama support MCP?
Not natively. As of Ollama v0.35.0 (September 2026), Ollama serves models and supports tool calling, but it has no MCP client; the feature request, issue #7865, has been open since November 2024. To use MCP with Ollama, run an MCP client that uses Ollama as its model, such as an agent started with ollama launch, ollmcp, Goose, Open WebUI or Octomind.
What is the Ollama MCP server on GitHub?
The best-known one, rawveg/ollama-mcp, works in the opposite direction: it exposes Ollama to another assistant such as Claude Desktop or Cline through 14 tools like ollama_chat and ollama_pull. It is AGPL-3.0. If you want a local Ollama model to call MCP tools, you need an MCP client instead.
Why does my Ollama model ignore MCP tools?
Check three things in order. First, the model needs the tools capability (ollama show <model>); without it Ollama returns a 400 "does not support tools" error. Second, the context window must hold the tool definitions: Ollama defaults to 4,096 tokens below 24 GiB of VRAM, and one Playwright MCP server needs about 3,900. Third, small models often answer from memory, so name the tool in the prompt or use a larger model.
What context length do I need for MCP with Ollama?
Ollama's documentation recommends at least 64,000 tokens for agents and coding tools. Measured tool definitions run from about 1,700 tokens for the filesystem server to about 5,700 for Chrome DevTools MCP, before the system prompt and conversation. Set OLLAMA_CONTEXT_LENGTH=65536 on the server, or a Modelfile num_ctx, because OpenAI-compatible clients can't set it per request.



