Skip to content
← All MCP servers

Is the Ollama MCP server safe? What it can reach

What the Ollama MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Community serverChecked

Ollama does not publish an MCP server, so this covers rawveg/ollama-mcp, a community server (about 180 stars) that lets an agent manage and call models on an Ollama host. It runs locally over stdio and needs no login for a local Ollama. The most consequential tools pull, push and delete models, and the web tools send queries to Ollama Cloud with your API key.

Who maintains it

ImplementationKindStatus
ollama-mcp (rawveg, community)Communityactive

It runs as a local process on your machine.

How it signs in

A local Ollama host needs no credential. For Ollama Cloud, web search and web fetch you set OLLAMA_API_KEY, and the server acts on that cloud account. Whoever can reach OLLAMA_HOST can run the same calls.

What its tools can do

KindTools
Readollama_list, ollama_show, ollama_ps, ollama_generate, ollama_chat, ollama_embed, ollama_web_search, ollama_web_fetch
Writeollama_pull, ollama_copy, ollama_create
Can’t be undoneollama_delete, ollama_push

ollama_generate, ollama_chat and ollama_embed run model inference and change nothing, so they sit in read. ollama_push publishes a model to the Ollama library, which is why it is listed as destructive. Community server, not made by Ollama.

Built-in limits

OptionWhat it does
OLLAMA_HOSTSets which Ollama endpoint the server calls. The default is http://127.0.0.1:11434, so it stays on your machine unless you point it at ollama.com.
OLLAMA_API_KEYRequired only for cloud models and the two web tools. Leave it unset to keep web search and fetch from working.

The risks

  • A model name or output returned by a tool can carry injected text, and ollama_delete lets an agent remove models from local storage, which can mean large re-downloads.
  • ollama_push uploads a model to the Ollama library under your account, so an injected instruction could publish a private custom model.
  • ollama_web_fetch pulls untrusted web pages into the agent’s context, the most likely route for prompt injection in this server.
  • ollama_web_search and ollama_web_fetch send queries and URLs to ollama.com under your OLLAMA_API_KEY.
  • ollama_pull downloads whatever model it is told to, which can fill the disk and fetch models you did not vet.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add --env OLLAMA_HOST=... --env OLLAMA_API_KEY=... ollama -- npx -y ollama-mcp

Claude Code names MCP tools mcp__ollama__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "deny": [
      "mcp__ollama__ollama_delete",
      "mcp__ollama__ollama_push"
    ],
    "ask": [
      "mcp__ollama__ollama_pull",
      "mcp__ollama__ollama_create",
      "mcp__ollama__ollama_copy",
      "mcp__ollama__ollama_web_fetch",
      "mcp__ollama__ollama_web_search"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.ollama]
command = "npx"
args = ["-y", "ollama-mcp"]
env_vars = ["OLLAMA_HOST", "OLLAMA_API_KEY"]
disabled_tools = ["ollama_delete", "ollama_push"]

Checklist

  • Leave OLLAMA_API_KEY unset unless you need cloud tools.
  • Deny ollama_delete and ollama_push in your client.
  • Keep OLLAMA_HOST on 127.0.0.1 so it isn’t exposed on the network.
  • Ask before ollama_pull so models are vetted.

Checked against the vendor documentation on November 25, 2026. rawveg/ollama-mcp README · rawveg/ollama-mcp README (raw)

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing