claude-ollama-mcp
Claude Ollama
让 Claude Desktop 可以查询和管理本地 Ollama 服务器。无需打开终端,即可列出已安装的模型、检查模型详情、针对任何本地模型运行一次性 generate/chat 补全,或从注册表中拉取/删除模型。
典型用途:将 Claude 的回答与本地模型针对同一提示词的回答进行比较、针对量化模型运行低成本的批量补全,或检查您导入到 Ollama 中的自定义训练检查点模型。
要求
正在运行的 Ollama 服务器(
ollama serve或 Ollama 应用程序)。默认端点为
http://localhost:11434。如果您在不同的主机或端口上运行 Ollama,请通过 Claude Desktop 扩展设置中的ollama_url用户配置进行覆盖。无 npm 依赖——纯 Node 通过 HTTP API 实现。
Related MCP server: Ollama MCP Server
安装 (Claude Desktop)
从 Releases 页面下载最新的
Ollama.mcpb。在 Claude Desktop 中:设置 → 扩展 → 扩展开发者 → 安装扩展 → 选择
.mcpb文件。(可选) 在扩展设置中,如果您在非默认主机/端口上运行 Ollama,请设置
Ollama server URL。如果使用http://localhost:11434,请留空。
工具
工具 | 注解 | 用途 |
| 只读 | 健康检查 + 服务器版本 |
| 只读 | 本地模型(包含大小、摘要、系列、参数量、量化信息) |
| 只读 | 当前加载在显存 (VRAM) 中的模型 |
| 只读 | 模型详情:模型文件、参数、模板、能力 |
| 开放世界 | 一次性文本补全(非流式) |
| 开放世界 | 带有消息历史的聊天补全(非流式) |
| 开放世界 | 从注册表下载模型 |
| 破坏性 | 删除本地安装的模型 |
提示词示例
“我安装了哪些本地模型,目前哪个模型加载在显存中?”
“使用
forge:b6c1运行此提示词:''。将输出结果与你自己的回答进行比较。”“向我展示
forge:b7c1的模型文件 (modelfile) —— 我想检查一下温度设置。”“拉取
llama3.1:70b。” (对于大型模型,请耐心等待)“删除
forge:b5c3模型 —— 我不再需要那个检查点了。”
隐私政策
此扩展完全在您的本地机器上运行,仅向您的 Ollama 服务器(默认 http://localhost:11434)发送 HTTP 请求。除非您明确配置 ollama_url 指向远程 Ollama 实例,否则没有任何数据会离开您的机器;如果配置了远程实例,提示词和响应将会传输到该服务器。
Claude 可见的信息包括:
您传递给
generate和chat的所有提示词和聊天消息(这些消息会发送到 Ollama 服务器,服务器可能会根据其配置记录这些信息)。Ollama 返回的补全全文。
每个已安装模型的元数据(名称、摘要、大小、量化、模型文件内容)。
当前加载在显存中的模型及其大小占用。
如果您安装的模型包含专有的微调数据或带有敏感元数据的模型文件,请注意,当您调用 show_model 或 list_models 时,Claude 将会看到这些信息。
delete_model 是破坏性的,且无法通过此扩展撤销——如果误删,必须从注册表重新拉取(或从源二进制文件重新导入)。
故障排除
“无法连接到 http://localhost:11434 上的 Ollama — 服务器是否在运行?” — 请使用 ollama serve 启动 Ollama 或运行 Ollama 应用程序。使用 curl http://localhost:11434/ 进行验证(应返回 "Ollama is running")。
pull_model 长时间挂起 — Ollama 的 stream: false 拉取 API 会阻塞直到完整下载完成,对于多 GB 的模型,这可能需要几分钟。如果您正在拉取大型模型,请改在终端中运行 ollama pull <name> —— 您可以在那里看到流式进度,后续的 MCP 调用将发现模型已安装。
自定义/远程 Ollama 端点 — 在扩展设置中设置 ollama_url(例如 http://192.168.1.42:11434)。需要重启扩展。
list_running 在您停止使用后仍显示模型 — Ollama 会将模型保持在显存中,直到达到可配置的 TTL(默认 5 分钟)。expires_at 时间戳会告诉您它何时卸载。这是 Ollama 的行为,而非扩展的行为。
开发
单个约 400 行的 Node.js 脚本,零 npm 依赖。重新构建 .mcpb:
cd bundle-source
zip -j ../Ollama.mcpb manifest.json package.json server.js README.md LICENSE icon.png glama.json许可证
MIT。请参阅 LICENSE。
相关
claude-terminal-mcp — shell、文件系统和后台作业。
claude-rocm-mcp — AMD GPU 监控;非常适合检查 Ollama 加载的模型是否占满了显存。
claude-sessions-mcp — 用于长时间运行作业的 tmux 会话管理。
claude-linux-mcp — X11 桌面控制。
Available Tools
8 toolschatA
Run a chat completion against a local model with message history (non-streaming). Returns the assistant's reply plus timing.
Inputs: model (required), messages (required), options.
delete_modelADestructive
Delete a locally-installed model. Does not affect the remote registry copy. Free the disk space of a model you no longer need.
Inputs: name (required).
generateA
Run a one-shot text completion against a local model (non-streaming). Returns the full response text plus timing and tokens/second.
Inputs: model (required), prompt (required), system, options.
list_modelsARead-only
List locally-installed models: name, size in bytes, digest, modified timestamp, family (e.g. llama), parameter size (e.g. 8.0B), and quantization level (e.g. Q4_K_M).
Inputs: no named parameters.
list_runningARead-only
List models currently loaded into VRAM with their size, VRAM footprint, and expiry timestamp. Empty list means Ollama is idle.
Inputs: no named parameters.
ollama_statusARead-only
Health check: whether the Ollama server is reachable and its version. Use this as a precondition before other tools if you're unsure whether Ollama is running.
Inputs: no named parameters.
pull_modelA
Download a model from the Ollama registry. Blocks until complete — can take a long time for multi-GB models. For very large pulls, prefer ollama pull in a terminal where you can watch progress.
Inputs: name (required).
show_modelARead-only
Show detailed information for a specific model: modelfile excerpt, parameters, template, capabilities, architecture details, quantization level.
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: chat vs generate differentiate by context (with/without history); model management tools (list, pull, delete, show, list_running) are non-overlapping; ollama_status is a standalone health check. No ambiguity in roles.
Most names follow a verb_noun pattern (e.g., delete_model, list_models, pull_model). 'chat' and 'generate' are single verbs but still actions. 'ollama_status' deviates slightly (noun_noun) but is readable. Overall consistent with minor exceptions.
8 tools cover the essential operations for a local Ollama server: model management (list, pull, delete, show, list_running), two inference modes (chat, generate), and a health check. Well-scoped without bloat or deficiency.
Core CRUD and inference are covered, but streaming support is absent (only non-streaming provided). No tool to adjust model parameters or embeddings. Minor gaps for advanced use, but sufficient for standard workflows.
Maintenance
Related MCP Connectors
Shared notes, logs, issues and secrets for Claude, ChatGPT and local models.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with locally running Ollama models through chat, generation, and model management operations. Supports listing, downloading, and deleting models while maintaining conversation history for interactive sessions.MIT
- AlicenseBqualityDmaintenanceEnables complete local Ollama management including listing models, chatting with local LLMs, starting/stopping the server, and getting intelligent model recommendations for specific tasks through natural language commands.94MIT
- AlicenseAqualityCmaintenanceA bridge that enables Claude Code to interact with local Ollama instances for text generation, multi-turn chat, and vision-based analysis. It supports model management tasks such as listing, pulling, and showing details, alongside generating text embeddings.61MIT
- AlicenseNot gradedqualityDmaintenanceExposes local Ollama instances as tools for Claude Code, allowing users to offload code generation, text drafting, and embedding tasks to local GPUs. It supports multi-turn conversations and model management through the Model Context Protocol.MIT