Blog/MCP with local LLMs
Agents and tools · November 2026

MCP with local LLMs in November 2026: which clients work, what the model needs, setup and security

By Samuel Seidel · Published November 7, 2026 · Sources checked November 7, 2026

You can use Model Context Protocol (MCP) servers with a local model, but the MCP client is a separate program from the model server. On 7 November 2026 the working combinations are LM Studio (an MCP host since 0.3.17), Open WebUI (native MCP over Streamable HTTP since v0.6.31), llama.cpp's llama-server (experimental MCP flags), Claude Code pointed at Ollama's or LM Studio's Anthropic-compatible endpoint, and ollmcp 0.35.1 for Ollama; Ollama itself has no MCP client. The current spec is version 2026-07-28. The model must support tool calling and needs a large context: a 94-tool GitHub server's schemas take about 17,600 tokens, four times Ollama's 4k default on cards under 24 GiB.

ClientMCP sinceServer transportsLocal model it talks toSource
LM Studio 0.4.280.3.17Local and remote, mcp.json (Cursor notation)Its own llama.cpp or MLX engineLM Studio docs
Open WebUIv0.6.31Streamable HTTP only; stdio and SSE through mcpoOllama or any OpenAI-compatible serverOpen WebUI docs
llama-server (llama.cpp)Experimental flags in current READMEServer-side config file; web UI proxy for remote HTTP serversItselfllama-server README
Claude CodeBuilt instdio and HTTPOllama (port 11434) or LM Studio (port 1234) via /v1/messagesClaude Code docs
ollmcp (mcp-client-for-ollama) 0.35.1Its purposestdio, SSE, Streamable HTTPOllamaPyPI, 2026-09-30
Ollama v0.40.15None in its docsn/an/aOllama docs

Read 7 November 2026. "MCP since" is the first version the vendor names. Open WebUI's quick start mentions version 0.12.3 in an October 2026 test, so current builds are well past v0.6.31.

Which clients run MCP tools against a local model?

Any client that speaks MCP on one side and an OpenAI- or Anthropic-style API on the other; the model server never sees MCP, only tool definitions and tool results inside ordinary chat requests. That split explains the table above. LM Studio is the one product that is both model runner and MCP host in one app (the LM Studio vs Ollama comparison covers its license and server modes). Everything else pairs a client with a model server.

In my view Claude Code is the most complete MCP client in the list, and it works with local models because Ollama and LM Studio both answer the Anthropic Messages API. Ollama's Claude Code page gives three environment variables (or the shortcut ollama launch claude) and asks for a 64k or larger context. LM Studio's Anthropic docs do the same on port 1234. Claude Code then runs its MCP servers exactly as it would against a hosted model.

llama-server is the newest entry. Its README now lists --mcp-servers-config and --mcp-servers-json (Cursor-compatible definitions, marked experimental), built-in agent tools behind --tools, and a CORS proxy for the web UI behind --ui-mcp-proxy, each with the warning "do not enable in untrusted environments". In a GitHub discussion from March to June 2026, users got Streamable HTTP servers working through the web UI proxy while SSE endpoints failed, and a collaborator wrote that llama.cpp does not support the SSE variants.

Open WebUI's native client accepts Streamable HTTP servers only and keeps them admin-only, because they run inside its trust boundary with the connecting user's access. For a stdio server, wrap it in mcpo, which exposes MCP tools as an OpenAPI server. The broader Open WebUI tool system is covered in the Open WebUI tools guide.

What changed in the MCP specification in 2026?

The 2026-07-28 revision made the protocol stateless, and two of its deprecations matter for local setups. Per the changelog against the previous 2025-11-25 version:

Sampling was the feature that let an MCP server borrow the client's model, which was attractive with a free local model. The spec now suggests servers integrate with model APIs directly; with a local setup that means pointing the server at your own OpenAI-compatible endpoint. The SSE deprecation lines up with the llama.cpp report above: build new local servers on stdio or Streamable HTTP. Expect a mixed year in which some clients speak the new revision and many servers still speak 2025-11-25; that is the first thing to check when a server connects and lists no tools.

What does the local model need?

Trained tool calling, a chat template the runtime understands, and enough context for every tool schema plus the conversation. On templates: LM Studio's tool use docs distinguish native support (hammer badge; Qwen, Llama 3.1 and 3.2 and Mistral families listed) from a default mode that injects its own format, and warn that smaller or untrained models may emit malformed calls that come back as plain text. On vLLM, tool calls are parsed only with --enable-auto-tool-choice and the right --tool-call-parser (36 parsers in the tool calling docs). llama-server applies Jinja chat templates by default. Model choice is in the sibling article on the best open models for tool calling.

Context is where local setups fail quietly. StackOne's March 2026 analysis puts MCP tool schemas at 500 to 1,400 tokens each and GitHub's official server (94 tools) at 17,600 tokens of definitions per request. A worked budget, by my calculation:

ItemTokensNote
Ollama default context, GPU under 24 GiB4,096Ollama docs
GitHub MCP server, all 94 tools17,600StackOne
Two small servers, 10 tools at 500 to 1,400 each5,000 to 14,000StackOne per-tool range × 10
System prompt, task and a few file reads10,000 to 30,000My estimate for a coding agent
Sensible minimum context for a local agent65,536Ollama's and Claude Code integration's advice: 64k or more

Tool schema figures as reported by StackOne (published 31 March 2026, updated 22 October 2026), which attributes the GitHub figure to Atlassian. Rows 3 and 4 are my arithmetic and estimate.

Context costs memory. For Qwen3.8-27B, whose config.json has 16 full-attention layers with 4 KV heads of dimension 256, the KV cache is 64 KiB per token at f16 by my calculation, so a 64k context costs 4 GiB on top of an 18 GB 4-bit model: about 22 GB, which fits a 24 GB card only barely and a 32 GB card comfortably. Trimming tools is cheaper than buying memory. The GitHub MCP server enables five toolsets by default and takes a --toolsets allow-list (or GITHUB_TOOLSETS) and a --read-only flag.

How do you set it up?

Three working patterns, from one developer to a shared chat. First, Claude Code against Ollama with one MCP server, using the variables from Ollama's docs and the syntax from Claude Code's:

# terminal 1: the model server, with a 64k context
OLLAMA_CONTEXT_LENGTH=65536 ollama serve

# terminal 2: point Claude Code at it
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434

claude mcp add --transport stdio \
  --env GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT github \
  -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN \
     -e GITHUB_TOOLSETS=repos,issues ghcr.io/github/github-mcp-server

claude --model qwen3.8:27b

Second, LM Studio: open the Program tab, choose Install, then Edit mcp.json, and add servers in Cursor's notation. The docs' remote example takes a URL and optional headers:

{
  "mcpServers": {
    "internal-wiki": {
      "url": "https://wiki.example.internal/mcp",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}

Third, Open WebUI for a team: run stdio servers behind mcpo and add the result under Admin, Integrations, External Tool Servers as an OpenAPI connection. Remote servers that already speak Streamable HTTP go in the same place with the type set to MCP (Streamable HTTP):

uvx mcpo --port 8001 --api-key "a-long-random-key" -- uvx mcp-server-time --local-timezone=Europe/Prague

Open WebUI's docs also say to set WEBUI_SECRET_KEY, or OAuth-connected tools break with "Error decrypting tokens" when the container is recreated. Base installation of Open WebUI is in the Open WebUI setup guide, and the editor-agent configs for Continue, Cline and aider are in the coding agents guide.

How safe are local MCP servers?

Running the model locally does not make the tools safe: an MCP server is code with your permissions, and 2026 produced a steady stream of advisories against servers and the hosts that launch them. The MCP spec itself says tools "represent arbitrary code execution" and that hosts must get consent before invoking one.

AdvisoryWhat happenedFixed inSourceDate
CVE-2025-66414, MCP TypeScript SDK (High)No DNS rebinding protection by default, so a malicious web page could reach an unauthenticated localhost HTTP server; stdio not affectedSDK 1.24.0GitHub advisory2025-12-02
OX Security "MCP by design" disclosureProducts passed the stdio "command" field to the OS unchecked: 14 CVEs, among them LiteLLM, Flowise, Windsurf; Anthropic listed as won't fixPer productOX Security2026-04-15
CVE-2026-30623, LiteLLM (Critical)Authenticated users could add stdio servers with arbitrary commandsv1.83.7-stableLiteLLM2026-04-21
CVE-2026-45018, Chainlit (CVSS 9.8)Unauthenticated remote code execution through the MCP stdio endpoint, e.g. via "npx -c"2.12.0GitHub advisory2026-08-25
Reference servers: filesystem, git, fetch, everythingPath and symlink check bypasses, a TOCTOU file write, SSRF guard bypasses, git repository confinement bypass (9 advisories, Moderate or Low)See each advisorymodelcontextprotocol/servers2026-10-25 to 10-28

Read 7 November 2026. The OX Security list names 14 CVEs and three entries without CVEs; LM Studio, Ollama and Open WebUI do not appear in it.

The rules I follow on a local machine:

Where the model and tools run on a rented machine rather than a laptop, the same rules apply plus network hardening; the guide to security hardening a rented GPU covers ports and keys.

Which setup should you pick?

For one developer I would use Claude Code against a local 27B to 35B model in Ollama or LM Studio, with two or three servers and their toolsets trimmed, and a 64k context. That combination has the most mature MCP client and costs nothing per token. For a team chat, Open WebUI with Streamable HTTP servers behind authentication, admin-managed, is the setup the docs are built for. llama-server's MCP support is promising for a single binary with no Python, but it is flagged experimental and SSE servers did not work for users in 2026, so I would wait before relying on it. For the lighter tool-calling path without MCP, the function calling guide shows plain OpenAI-style tools against your own endpoint.

FAQ

Does Ollama support MCP?

Not by itself. Ollama serves the model; an MCP client has to sit in front of it. On 7 November 2026 the options include Claude Code pointed at Ollama's Anthropic-compatible /v1/messages endpoint, Open WebUI (native MCP since v0.6.31), and mcp-client-for-ollama (ollmcp 0.35.1, 30 September 2026), which supports stdio, SSE and Streamable HTTP servers and asks before each tool call by default.

Does LM Studio support MCP servers?

Yes, since LM Studio 0.3.17. Servers go in an mcp.json file in Cursor's notation, edited from the Program tab, and both local and remote servers are supported. LM Studio's docs warn that servers built for cloud models can use many tokens and overflow a local model's context, and that MCP servers can run code, read files and use your network.

Which local models work with MCP?

Models trained for tool calling with a chat template the runtime understands. LM Studio marks native tool-use models with a hammer badge and lists Qwen, Llama 3.1 and 3.2 and Mistral families as native. vLLM needs --enable-auto-tool-choice and the matching --tool-call-parser. The model also needs context: tool schemas take 500 to 1,400 tokens each, per StackOne's March 2026 analysis.

What is the current MCP specification version?

2026-07-28, which replaced 2025-11-25. It removes protocol-level sessions and the initialize handshake so every request carries its own protocol version and capabilities, adds a server/discover call, and deprecates the Roots, Sampling and Logging features and the old HTTP+SSE transport. Clients and servers on older versions get an UnsupportedProtocolVersionError on a mismatch.

Is it safe to run MCP servers locally?

Only with care. OX Security disclosed in April 2026 that many products passed MCP stdio commands straight to the operating system, leading to 14 CVEs including LiteLLM's CVE-2026-30623. The MCP TypeScript SDK before 1.24.0 left localhost HTTP servers open to DNS rebinding (CVE-2025-66414). Prefer stdio for local servers, confirm each tool call, and scope tokens to read-only.

Sources

Every figure above is attributed to its source in the sentence or table where it appears. Pages were read on 7 November 2026 unless a date says otherwise.

Related pages

First top-up: pay $20, get $30 in credit

Give tool-heavy agents room for context.

A rented DGX Spark has 128 GB of unified memory, enough for a 100B-class model plus a 64k-token context of tool schemas, billed by the minute from $0.79 per hour.

A dedicated DGX Spark in the EU, $0.79/hour, billed per minute. $30 of credit is about 37 hours of compute.

Create account Connect Open WebUI to internal tools