MCP 客户端 for Ollama 标志

MCP 客户端 for Ollama

社区
jonigl

Harness the power of local LLMs with this TUI MCP Client for Ollama. Featuring all core MCP primitives (tools, prompts, resources), agent mode, multi-server, model switching, streaming responses, human-in-the-loop, thinking mode, model params config, system prompts, and saved preferences.

发布者jonigl
代码仓库mcp-client-for-ollama
语言Python
复刻数
129
星标数
825
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    MCP 客户端 for Ollama 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 825 个星标和 129 个复刻。


MCP Client for Ollama (ollmcp)

Pepy Total Downloads Python 3.11+ PyPI - Python Version PyPI - Python Version CI

Table of Contents

Overview

MCP Client for Ollama (ollmcp) is a modern, interactive terminal application (TUI) built for harness engineering, connecting local Ollama LLMs to one or more Model Context Protocol (MCP) servers. By fully supporting the core MCP primitives (tools, prompts, and resources), it provides a controlled terminal space where you steer, and the agent executes. With a rich, user-friendly interface, it lets you safely manage your setup in real time with no coding required. Whether you're building, testing, or exploring, this client streamlines your workflow with features like fuzzy autocomplete, advanced model configuration, MCP server hot-reloading for rapid development, and strict Human-in-the-Loop safety controls.

Features

  • 🤖 Agent Mode: Iterative tool execution when models request multiple tool calls, with a configurable loop limit and interactive choices when the limit is reached (continue, wrap up, or abort)
  • 🌐 Multi-Server Support: Connect to multiple MCP servers simultaneously
  • 🚀 Multiple Transport Types: Supports STDIO, SSE, and Streamable HTTP server connections
  • 📋 MCP Prompts Support: Browse, invoke, and manage prompts from MCP servers with argument collection, preview, and safe rollback
  • 📦 MCP Resources Support: Browse and read contextual data from MCP servers including files, documents, and structured data
  • ☁️ Ollama Cloud Support: Works seamlessly with Ollama Cloud models for tool calling, enabling access to powerful cloud-hosted models while using local MCP tools
  • 🌍 Multiple LLM Providers: Use Ollama (default) or OpenAI-compatible providers (OpenAI, OpenRouter, DeepSeek, etc.), with connection settings remembered per provider
  • 🎨 Rich Terminal Interface: Interactive console UI with modern styling
  • 🌊 Streaming Responses: View model outputs in real-time as they're generated
  • 📝 Answer Display Modes: Switch between Plain, Markdown, Both, or Markdown (blocks) response views while streaming
  • 🛠️ Tool Management: Enable/disable specific tools or entire servers during chat sessions
  • 🧑‍💻 Human-in-the-Loop (HIL): Review and approve tool executions before they run for enhanced control and safety
  • 🎮 Advanced Model Configuration: Fine-tune 15+ model parameters including context window size, temperature, sampling, repetition control, and more
  • 💬 System Prompt Customization: Define and edit the system prompt to control model behavior and persona
  • 🧠 Context Window Control: Adjust the context window size (num_ctx) to handle longer conversations and complex tasks
  • 🎨 Enhanced Tool Display: Beautiful, structured visualization of tool executions with JSON syntax highlighting
  • 🧠 Context Management: Control conversation memory with configurable retention settings
  • 🤔 Thinking Mode: Advanced reasoning capabilities with visible thought processes for supported models (e.g., gpt-oss, deepseek-r1, qwen3, etc.)
  • 💪 Reasoning Effort Levels: Set reasoning effort to auto, minimal, low, medium, high, or xhigh for supported models
  • 🖼️ Vision Tool Support: Images returned by tools are automatically forwarded to vision-capable models
  • 🗣️ Cross-Language Support: Seamlessly work with both Python and JavaScript MCP servers
  • 📜 History Management: View full conversation history, export to JSON for backup/analysis, and import previous sessions for continuity
  • 🔍 Auto-Discovery: Automatically find and use Claude's existing MCP server configurations
  • 🔁 Dynamic Model Switching: Switch between any installed Ollama model without restarting
  • 💾 Configuration Persistence: Save and load tool preferences and model settings between sessions
  • 🔄 Server Reloading: Hot-reload MCP servers during development without restarting the client
  • ✨ Fuzzy Autocomplete: Interactive, arrow-key command autocomplete with descriptions
  • 🏷️ Dynamic Prompt: Shows current model, thinking mode, and enabled tools
  • 📊 Performance Metrics: Detailed model performance data after each query, including duration timings and token counts
  • 🔌 Plug-and-Play: Works immediately with standard MCP-compliant tool servers
  • 🔔 Update Notifications: Automatically detects when a new version is available
  • 🖥️ Modern CLI with Typer: Grouped options, shell autocompletion, and improved help output
  • ⏹️ Abort Generation: You can abort model generation at any time by pressing 'a' during response streaming

Requirements

  • Python 3.11+ (Installation guide)
  • Ollama running locally (Installation guide)
    • After installation, run ollama list to see available models. If no models are installed, you can pull one using ollama pull <model_name>. For example, ollama pull gemma4:latest.
  • UV package manager (Installation guide)

Quick Start

Install ollmcp via pip, add an MCP server, and run the client:

bash
# Install ollmcp via uv
uv tool install --upgrade ollmcp
# or via pip
pip install --upgrade ollmcp
# Add an MCP server (example: playwright stdio server)
ollmcp mcp add playwright -- npx @playwright/mcp@latest
# Run the client (check optional flags with `ollmcp --help`)
ollmcp # once running, use /help for interactive commands

Installation Options

Option 1: Install with uv and run (recommended)

bash
uv tool install --upgrade ollmcp
ollmcp

Option 2: Install with pip and run

bash
pip install --upgrade ollmcp
ollmcp

Option 3: Only run without installing (requires uv package manager)

bash
uvx ollmcp

Option 4: Install from source and run using virtual environment

bash
git clone https://github.com/jonigl/mcp-client-for-ollama.git
cd mcp-client-for-ollama
uv run -m mcp_client_for_ollama

Troubleshooting

Could not find a version that satisfies the requirement ollmcp (from versions: none)

This almost always means the Python you are using is older than the required 3.11+. This is common on macOS, where the system Python (/usr/bin/python3) or the Xcode-bundled Python can be 3.9 or older. When no release matches requires-python >= 3.11, pip filters out every version and reports the misleading "from versions: none".

First check your version:

bash
python3 --version   # must be 3.11 or newer

Then install with a modern Python. The simplest option is uv, which fetches a suitable Python for you automatically:

bash
uv tool install --upgrade ollmcp   # recommended, installs the CLI in an isolated environment
# or, if you prefer pip, make sure to use a Python 3.11+ interpreter:
python3.11 -m pip install --upgrade ollmcp
# Then run the client:
ollmcp

Take a look at the Installation Options.

error: externally-managed-environment (PEP 668)

On recent Debian/Ubuntu (Python 3.12+), the system pip is intentionally locked to protect OS-managed packages, so pip install ollmcp is blocked. This is a system policy (PEP 668), not an issue with ollmcp. Install it into an isolated environment instead:

bash
uv tool install --upgrade ollmcp   # recommended, installs the CLI in an isolated environment
# or, if you prefer pip, use a virtual environment:
python3.11 -m venv ollmcp-env
source ollmcp-env/bin/activate
python3.11 -m pip install --upgrade ollmcp
# Then run the client:
ollmcp

Take a look at the Installation Options.

[!WARNING] Avoid pip install --break-system-packages ollmcp. It works, but it installs into the system Python and can break packages your OS depends on.

Managing MCP Servers via CLI

ollmcp can manage its own MCP server configurations directly from the command line, similar to claude mcp:

bash
# Remote servers (Streamable HTTP or SSE)
ollmcp mcp add --transport http <name> <url>
ollmcp mcp add --transport sse <name> <url>

# Local stdio servers - everything after `--` is the command to run
ollmcp mcp add [options] <name> -- <command> [args...]

# List configured servers
ollmcp mcp list

# Remove a server
ollmcp mcp remove <name>

# For more details on options and usage, run:
ollmcp mcp --help
ollmcp mcp add --help

Examples:

[!TIP] Once you have added some servers, simply running ollmcp will connect to them automatically.

bash
ollmcp mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer $YOUR_GITHUB_PAT"
ollmcp mcp add --transport stdio playwright npx @playwright/mcp@latest
ollmcp mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /allowed-dir1 ~/allowed-dir2 # stdio transport by default
ollmcp mcp add --env API_KEY=YOUR_KEY --transport sse my-sse-server http://localhost:8000/sse

mcp add options

  • --transport, -t: stdio (default), sse, or http.
  • --header, -H: HTTP header as "Name: Value" for sse/http servers. Repeatable.
  • --env, -e: Environment variable as KEY=value for stdio servers. Repeatable.
  • --scope, -s: Where to store the server (see scopes below). Default: local.

Scopes

ScopeLoads inShared with teamStored in
localCurrent project onlyNo~/.config/ollmcp/mcp.local.json (keyed by project path)
projectCurrent project onlyYes (via VCS).mcp.json in the project root
userAll your projectsNo~/.config/ollmcp/mcp.json

The project scope writes a standard .mcp.json file at your project root, compatible with Claude Code and other MCP-aware tools. If the same server name exists in multiple scopes, precedence is local > project > user.

[!NOTE] Servers added via ollmcp mcp add are always loaded as the base layer. Any flags (--mcp-server, --mcp-server-url, --servers-json, --claude-desktop) add on top. To include servers from Claude Desktop, pass --claude-desktop explicitly.

If a server with the same name is also provided via one of those flags, both connections are currently opened, but only one is kept active under that name. Avoid reusing a registry server's name in --mcp-server/--mcp-server-url/--servers-json/--claude-desktop.

Command-line Arguments

[!TIP] The CLI now uses Typer for a modern experience: grouped options, rich help, and built-in shell autocompletion. Advanced users can use short flags for faster commands. To enable autocompletion, run:

bash
ollmcp --install-completion

Then restart your shell or follow the printed instructions.

MCP Server Configuration:

  • --mcp-server, -s: Path to one or more MCP server scripts (.py or .js). Can be specified multiple times.
  • --mcp-server-url, -u: URL to one or more SSE or Streamable HTTP MCP servers. Can be specified multiple times. See Common MCP endpoint paths for typical endpoints.
  • --servers-json, -j: Path to a JSON file with server configurations. See Server Configuration Format for details.
  • --claude-desktop: Load servers from Claude Desktop's config file (~/Library/Application Support/Claude/claude_desktop_config.json). Merged with servers added via ollmcp mcp add and any other flags.

[!IMPORTANT] Breaking change: --auto-discovery / -a has been replaced by --claude-desktop. Additionally, servers added via ollmcp mcp add are now always loaded automatically, they are no longer a fallback that disappears when other flags are used. Claude Desktop servers are never loaded automatically; use --claude-desktop to include them.

Inference Provider Configuration:

  • --model, -m MODEL: Model to use. Default: your saved configuration's model if set, otherwise the first model available in Ollama
  • --provider, -p PROVIDER: LLM provider to use (e.g. ollama, openai, atlascloud, openrouter, deepseek). Default: ollama
  • --host, -H HOST: LLM host / API base URL. Defaults to Ollama's http://localhost:11434 for the ollama provider, or the provider's own default endpoint otherwise.
  • --api-key, -k KEY: API key for the LLM provider. Also read from the $OLLMCP_API_KEY environment variable, which is provider-agnostic (it applies to whichever provider you select with --provider). Keys passed via $OLLMCP_API_KEY are never written to the config file; only keys passed with --api-key are saved. Not needed for ollama.

[!NOTE] Currently supported providers: ollama, openai, atlascloud, and any OpenAI-compatible provider (openrouter, deepseek, perplexity, etc.). More providers coming soon.

General Options:

  • --version, -v: Show version and exit
  • --help, -h: Show help message and exit
  • --install-completion: Install shell autocompletion scripts for the client
  • --show-completion: Show available shell completion options

MCP Server Logging:

Whatever an MCP server reports is written to ~/.config/ollmcp/logs/<session>/<server>.log, one directory per run, keeping the last 5. Nothing a server prints reaches the screen unless you ask for it — otherwise it would draw over the answer being streamed.

Servers report through two channels: their stderr (only stdio servers, since a remote one runs elsewhere) and MCP log notifications (any server). Both flags only change what you see on screen — the log file gets everything either way:

written to the log fileshown on screen
(no flag)everything the server sendsnothing from the server
--debugeverything the server sendsall of it, as it arrives
--log-level LEVELeverything the server sendsonly notifications of LEVEL or higher
--debug --log-level LEVELeverything the server sendsstderr in full + notifications of LEVEL or higher

LEVEL is one of debug, info, notice, warning, error, critical, alert, emergency.

With no flag, no level is requested at all: the server decides what it emits and all of it is recorded. --log-level filters what you see, and is also sent to the server (logging/setLevel) when it advertises the logging capability — such a server may then stop emitting the lower levels, which are missing from the file too. Servers without that capability keep sending everything and the filtering happens here.

When a server fails to connect, the error points at its log file: whatever the server printed on its way out is in there, and that is usually the real reason.

[!NOTE] What ollmcp itself reports goes to ~/.config/ollmcp/logs/<session>/ollmcp.log, next to the server files. It is written on every run, no --debug needed, and it is the file the on-screen warning points at when a response stream ends early. Work in progress: for now it records mostly provider and streaming errors, and more will be logged there over time.

Supported Inference Providers

[!WARNING] Non-Ollama providers are experimental. Support for providers other than Ollama was added recently and is still being stabilized, not everything may work correctly yet.

ollmcp works with Ollama plus any OpenAI-compatible provider that any-llm exposes. Select one with --provider. Provide the key with --api-key or $OLLMCP_API_KEY (both work for any selected provider) or via the provider's own environment variable shown below. $OLLMCP_API_KEY and the provider-native env vars are never written to disk; only a key passed with --api-key is saved to the config.

Provider (--provider)API key env var
ollama (default)- (local)
atlascloudATLASCLOUD_API_KEY
azureopenaiAZURE_OPENAI_API_KEY
dashscopeDASHSCOPE_API_KEY
databricksDATABRICKS_TOKEN
deepinfraDEEPINFRA_API_KEY
deepseekDEEPSEEK_API_KEY
fireworksFIREWORKS_API_KEY
gatewayGATEWAY_API_KEY
inceptionINCEPTION_API_KEY
llamaLLAMA_API_KEY
llamacpp- (local)
llamafile- (local)
lmstudioLM_STUDIO_API_KEY
minimaxMINIMAX_API_KEY
moonshotMOONSHOT_API_KEY
mzaiANY_LLM_KEY
nebiusNEBIUS_API_KEY
openaiOPENAI_API_KEY
openrouterOPENROUTER_API_KEY
perplexityPERPLEXITY_API_KEY
portkeyPORTKEY_API_KEY
qiniuQINIU_API_KEY
sambanovaSAMBANOVA_API_KEY
vllmVLLM_API_KEY
zaiZAI_API_KEY

[!NOTE] Local OpenAI-compatible servers (ollama, llamacpp, llamafile, lmstudio, vllm) typically run without an API key, point ollmcp at them with --host. Providers any-llm offers that are not OpenAI-compatible (e.g. anthropic, gemini, mistral, groq, cohere) are not supported yet.

[!WARNING] Capability detection limitation: ollmcp only reads real per-model capabilities (tools, vision, thinking) from Ollama. For every non-Ollama provider, all three capabilities are currently assumed available and shown as such in the model list and badges, so a model may be reported as supporting tools, vision, or thinking even when it doesn't. If a model lacks a capability, the provider's API will return an error when you try to use it.

API key resolution order

For the selected provider, ollmcp resolves the API key in this order, from highest to lowest precedence:

  1. The --api-key / -k flag.
  2. The $OLLMCP_API_KEY environment variable (provider-agnostic, applies to whichever provider you selected with --provider).
  3. The per-provider key saved in ~/.config/ollmcp/config.json (present only if it was once passed via --api-key).
  4. The provider's own native environment variable, detected by any-llm (e.g. OPENAI_API_KEY, OPENROUTER_API_KEY).

[!WARNING] A saved per-provider key (3) takes precedence over the provider's native environment variable (4). So if you previously saved a wrong or expired key, setting OPENAI_API_KEY (or the equivalent) alone will not override it. To fix it, either pass the correct key with --api-key, or remove the stale apiKey from that provider's profile in ~/.config/ollmcp/config.json.

Usage Examples

Simplest way to run the client:

bash
ollmcp

[!TIP] This connects to all servers registered via ollmcp mcp add and uses the model from your saved configuration file, or the first available model in Ollama if none is saved. Pass --claude-desktop to also include servers from Claude Desktop's config.

Connect to a single server:

bash
ollmcp --mcp-server /path/to/weather.py --model llama3.2:3b
# Or using short flags:
ollmcp -s /path/to/weather.py -m llama3.2:3b

Connect to multiple servers:

bash
ollmcp --mcp-server /path/to/weather.py --mcp-server /path/to/filesystem.js
# Or using short flags:
ollmcp -s /path/to/weather.py -s /path/to/filesystem.js

[!TIP] If --model is not specified, the model from your saved configuration file is used; otherwise the first available model in Ollama is selected automatically (you'll be told how to pull one if none are installed).

Use a JSON configuration file:

bash
ollmcp --servers-json /path/to/servers.json --model llama3.2:1b
# Or using short flags:
ollmcp -j /path/to/servers.json -m llama3.2:1b

[!TIP] See the Server Configuration Format section for details on how to structure the JSON file.

Use a custom Ollama host:

bash
ollmcp --host http://localhost:22545 --servers-json /path/to/servers.json
# Or using short flags:
ollmcp -H http://localhost:22545 -j /path/to/servers.json

Use a different LLM provider (OpenAI or any OpenAI-compatible API):

bash
ollmcp --provider openai --api-key $OPENAI_API_KEY --model gpt-5.5
# OpenAI-compatible providers (e.g. OpenRouter, DeepSeek); override the endpoint with --host if needed:
ollmcp --provider openrouter --api-key $OPENROUTER_API_KEY -m openrouter/free

[!TIP] Provider settings (model, host, API key) are remembered per provider. Once saved with /save-config, plain ollmcp resumes your last-used provider. See Configuration Management for details.

Connect to SSE or Streamable HTTP servers by URL:

bash
ollmcp --mcp-server-url http://localhost:8000/sse --model qwen2.5:latest
# Or using short flags:
ollmcp -u http://localhost:8000/sse -m qwen2.5:latest

Connect to multiple URL servers:

bash
ollmcp --mcp-server-url http://localhost:8000/sse --mcp-server-url http://localhost:9000/mcp
# Or using short flags:
ollmcp -u http://localhost:8000/sse -u http://localhost:9000/mcp

Mix local scripts and URL servers:

bash
ollmcp --mcp-server /path/to/weather.py --mcp-server-url http://localhost:8000/mcp --model qwen3:1.7b
# Or using short flags:
ollmcp -s /path/to/weather.py -u http://localhost:8000/mcp -m qwen3:1.7b

Include Claude Desktop servers alongside other sources:

bash
ollmcp --mcp-server /path/to/weather.py --mcp-server-url http://localhost:8000/mcp --claude-desktop
# Or using short flags:
ollmcp -s /path/to/weather.py -u http://localhost:8000/mcp --claude-desktop

How Tool Calls Work

  1. The client sends your query to Ollama with a list of available tools
  2. If Ollama decides to use a tool, the client:
    • Displays the tool execution with formatted arguments and syntax highlighting
    • Shows a Human-in-the-Loop confirmation prompt (if enabled) allowing you to review and approve the tool call
    • Extracts the tool name and arguments from the model response
    • Calls the appropriate MCP server with these arguments (only if approved or HIL is disabled)
    • Shows the tool response in a structured, easy-to-read format (including image and unsupported-media summaries)
    • If the tool returned images and the current model supports vision, attaches the images to the next LLM message; otherwise displays a warning
    • Sends the tool result back to Ollama
    • If in Agent Mode, repeats the process if the model requests more tool calls
  3. Finally, the client:
    • Displays the model's final response incorporating the tool results

Agent Mode

Some models may request multiple tool calls in a single conversation. The client supports an Agent Mode that allows for iterative tool execution:

  • When the model requests a tool call, the client executes it and sends the result back to the model
  • This process repeats until the model provides a final answer or reaches the configured loop limit
  • You can set the maximum number of iterations using the /loop-limit (/ll) command
  • The default loop limit is 7 to prevent infinite loops

When the loop limit is reached

Instead of silently stopping, the client pauses and asks you how to proceed:

ChoiceKeyDescription
Continuec (default)Grant another batch of iterations (same size as the current limit)
NumbernChoose exactly how many more iterations to allow
UnlimiteduRemove the cap and run until the model stops requesting tools
Wrap upwAsk the model to summarise what it gathered so far and produce a final answer — preserves all tool results collected before the limit
AbortaDiscard the turn entirely (nothing saved to history)

[!NOTE] If you want to prevent using Agent Mode, simply set the loop limit to 1.

Agent Mode Quick Demo:

asciicast

Interactive Commands

During chat, use these commands:

[!IMPORTANT] NEW: Built-in interactive commands now require a leading /.

  • Use /help, /model, /tools, /prompts, etc.
  • Bare command names like help or model are no longer executed as commands.
  • Prompt invocations also use /, with /server:prompt_name recommended to avoid collisions.

ollmcp main interface

CommandShortcutDescription
abortaWhile model is generating, abort the current response generation
/clear, /new/ccClear conversation history and context
/cls/clear-screenClear the terminal screen
/context/cToggle context retention
/context-info/ciDisplay context statistics
/export-history/ehExport chat history to a JSON file
/full-history/fhDisplay all conversation history
/help/hDisplay help and available commands
/import-history/ihImport chat history from a JSON file
/human-in-the-loop/hilToggle Human-in-the-Loop confirmations for tool execution
/load-config/lcLoad tool and model configuration from a file
/loop-limit/llSet maximum iterative tool-loop iterations (Agent Mode). Default: 7
/model/mList and select a different Ollama model
/model-config/mcConfigure advanced model parameters and system prompt
/display-mode/dmChoose Plain, Markdown, Both, or Markdown (blocks) answer display modes
/input-mode/imChoose Single-line or Multiline chat input mode
/prompts/prBrowse and view all available MCP prompts
/server:prompt_name/prompt_nameInvoke a prompt (qualified is recommended)
/resources/resBrowse and view all available MCP resources
@uri-Read a specific resource by URI (e.g., @server://info)
/quit, /exit, /bye/q, Ctrl+C, or Ctrl+DExit the client
/reload-servers/rsReload all MCP servers with current configuration
/reset-config/rcReset configuration to defaults (all tools enabled)
/save-config/scSave current tool and model configuration to a file
/show-metrics/smToggle performance metrics display
/show-thinking/stToggle thinking text visibility (visible by default)
/thinking-mode/tmToggle thinking mode on supported models
/reasoning-effort/reSet reasoning effort level (auto/minimal/low/medium/high/xhigh) when thinking mode is on. Default: medium
/show-tool-execution/steToggle tool execution display visibility
/tools/tOpen the tool selection interface

MCP Tools

The tool and server selection interface allows you to enable or disable specific tools:

ollmcp tool and server selection interface

  • Enter numbers separated by commas (e.g. 1,3,5) to toggle specific tools
  • Enter ranges of numbers (e.g. 5-8) to toggle multiple consecutive tools
  • Enter S + number (e.g. S1) to toggle all tools in a specific server
  • a or all - Enable all tools
  • n or none - Disable all tools
  • d or desc - Show/hide tool descriptions
  • j or json - Show detailed tool JSON schemas on enabled tools for debugging purposes
  • s or save - Save changes and return to chat
  • q or quit - Cancel changes and return to chat

MCP Prompts

MCP Prompts provide reusable, server-defined conversation starters and context templates. Servers can expose prompts with descriptions, required arguments, and pre-formatted messages that help you quickly start specific types of conversations or inject structured context into your chat.

Features

  • 📋 Browse Prompts: View all available prompts from connected servers with descriptions and argument requirements
  • ⚡️ Quick Invocation: Use slash syntax to invoke prompts (/server:prompt_name recommended)
  • 🔤 Autocomplete: Type / to see prompt suggestions with fuzzy matching
  • 📝 Argument Collection: Interactive prompts guide you through required parameters
  • 👁️ Preview: Review prompt content before injection to ensure it fits your needs
  • 🎯 Flexible Injection: Choose to execute immediately or inject-only (add to history without triggering model)
  • 🧠 Context-Aware: Automatically adapts behavior based on whether prompt ends with user or assistant message
  • 🔄 Safe Rollback: Automatic history cleanup if you abort or encounter errors
  • 💬 Text Content: Supports text-based prompt messages (image/audio/resource support coming soon)

How to Use MCP Prompts

Browse Available Prompts:

/prompts  # or '/pr'

This displays all prompts grouped by server, showing their names, required arguments, and descriptions.

Invoke a Prompt:

/server:prompt_name

For example, if a server named docs provides a "summarize" prompt:

/docs:summarize

If a prompt name is unique across connected servers, you can use the short form:

/summarize

If multiple servers expose the same prompt name, the client will ask you to use the qualified form and suggest valid /server:prompt_name options.

Autocomplete:

  • Type / to see all available prompts with descriptions
  • Continue typing to filter prompts with fuzzy matching
  • Use arrow keys to navigate and press Enter to select

[!TIP] Prompts are discovered automatically when you connect to MCP servers. If a server supports prompts, they'll be available immediately in the prompts list and autocomplete.

Workflow:

  1. Type /server:prompt_name (recommended) or select from autocomplete
  2. If the prompt requires arguments, you'll be prompted to provide them
  3. Review the prompt preview showing what will be injected
  4. Choose how to use the prompt:
    • y/yes (default): Send the prompt to the model and get a response
      • For prompts ending with a user message: Uses that message as the query
      • For prompts ending with an assistant message: Adds "Please respond based on the above context." as the query
    • i/inject: Just add the prompt to conversation history without triggering the model (lets you type your own query afterward)
    • n/no: Cancel and return to chat
  5. The prompt is injected based on your choice
  6. If you abort during model generation (press 'a'), changes are automatically rolled back

Example: ollmcp prompt feature screenshot

[!WARNING] Content Type Limitations: MCP Prompts currently support text content only. The following content types are not yet supported and will be automatically skipped:

  • 🖼️ Images - Image content in prompts
  • 🎵 Audio - Audio content in prompts
  • 📦 Resources - Embedded resource content

MCP Resources

MCP Resources provide access to contextual data exposed by MCP servers-files, documents, structured data, and more. Servers can expose resources with metadata (name, description, MIME type) that you can browse and read into your conversation context.

Features

  • 📋 Browse Resources: View all available resources from connected servers with URIs, names, MIME types, and descriptions
  • 📖 Read Resources: Use @uri syntax to read resource content, standalone or inline within a query
  • 📝 Text Content: Full support for text-based resources (markdown, code, logs, etc.)
  • 🖼️ Vision Image Support: Image resources (image/*) are automatically forwarded as base64 images to vision-capable models
  • 🎯 Context Injection: Resource content is buffered and injected as context alongside your next query
  • 🔍 Autocomplete: Type @ to see available resource and template suggestions with fuzzy matching
  • 🛡️ Binary Safety: Non-image binary content (audio, video, PDFs, archives) is detected and gracefully skipped with informative messages

How to Use MCP Resources

Browse Available Resources:

/resources  # or '/res'

This displays all resources and templates grouped by server, showing URIs, names, MIME types, and descriptions. Binary resources are marked with a [binary] tag and templates with a [template] tag.

Read a Resource:

@<uri>

For example, to read a file resource:

@file:///path/to/document.md

There are two ways to use @uri:

1. Standalone (buffer then query): Type @uri on its own. The resource is fetched and buffered. Then type your query on the next prompt. The resource content is injected as context automatically.

2. Inline (single turn): Include @uri anywhere inside your query text. The resource is fetched and the query is processed immediately in one step.

Standalone example:

qwen3/show-thinking/6-tools❯ @server://info
✅ Read resource 'get_server_info' (197 chars)

Preview:
This is a simple MCP server with streamable HTTP transport. It supports tools for greeting, adding numbers, generating
random numbers, and calculating BMI. It also provides a BMI calculator prompt.

1 resource(s) buffered. Type your query, or include @another_uri inline.

qwen3/show-thinking/6-tools❯ Next question here

Inline example:

qwen3/show-thinking/6-tools❯ summarize the key features from @server://info
✅ Read resource 'get_server_info' (197 chars)

Preview:
This is a simple MCP server with streamable HTTP transport. It supports tools for greeting, adding numbers, generating
random numbers, and calculating BMI. It also provides a BMI calculator prompt.
[model response]

[!TIP] Resources are discovered automatically when you connect to MCP servers. If a server supports resources, they'll be available immediately in the resources list and @ autocomplete.

[!NOTE] 🖼️ Images (image/*) are supported, they are passed directly to vision-capable models as base64 data. Binary Content: The following resource types are not supported as context and will be skipped with an informative message:

  • 🎵 Audio - audio/* MIME types
  • 📹 Video - video/* MIME types
  • 📄 PDFs - application/pdf
  • 🗜️ Archives - application/zip, application/octet-stream

Answer Display Modes

The /display-mode (/dm) command lets you choose how model answers are shown while they stream:

  • Plain: Streams the response once as plain text with no final markdown re-render
  • ✨NEW Markdown (default): Streams formatted markdown line by line — lines above a small live tail are printed once and never redrawn, so it stays reliable even with emojis or terminal resizes
  • Both: Streams plain text first, then renders the completed response again as markdown
  • Markdown (blocks): Renders the response as markdown one block at a time, append-only each paragraph/list/table/code block prints once when it completes and is never redrawn, so it cannot duplicate lines

Use /display-mode or /dm during chat to open the interactive picker.

Why you might switch modes:

  • Plain is the least noisy option if you want minimal redraw or flicker
  • Markdown combines line-by-line streaming with coherent markdown formatting; at most the last few lines are ever redrawn, so glitches stay bounded even with emojis or resizes
  • Both gives you fast streaming feedback plus a clean final markdown rendering
  • Markdown (blocks) is the most conservative way to see formatted markdown while streaming, at the cost of block-by-block (rather than line-by-line) updates

[!TIP] Your selected display mode is saved with /save-config and restored with /load-config, so you can keep different viewing preferences for different workflows.

Input Mode

The /input-mode (/im) command controls how you write chat messages:

  • Single-line (default): Press Enter to send immediately after typing your message
  • Multiline: Press Enter to add a new line, then press Esc followed by Enter to send the entire message when you're done. This allows for more complex messages with multiple paragraphs or code blocks.
  • Ctrl+J also inserts a new line in multiline mode as a reliable fallback across terminals

Use /input-mode or /im during chat to open the interactive picker.

[!IMPORTANT] Multiline send shortcuts can vary by terminal emulator and OS keyboard handling. This client relies on Esc then Enter as the portable submit shortcut in multiline mode. Shift+Enter and Meta+Enter may work in some terminals, but they are not guaranteed.

Model Selection

The model selection interface shows all available models in your Ollama installation:

ollmcp model selection interface

  • Enter the number of the model you want to use
  • s or save - Save the model selection and return to chat
  • q or quit - Cancel the model selection and return to chat

Advanced Model Configuration

The /model-config (/mc) command opens the advanced model settings interface, allowing you to fine-tune how the model generates responses:

ollmcp model configuration interface

System Prompt

  • System Prompt: Set the model's role and behavior to guide responses.

Key Parameters

  • Context Window (num_ctx): Set how much chat history the model uses. Balance with memory usage and performance.
  • Keep Tokens: Prevent important tokens from being dropped
  • Max Tokens: Limit response length (0 = auto)
  • Seed: Make outputs reproducible (set to -1 for random)
  • Temperature: Control randomness (0 = deterministic, higher = creative)
  • Top K / Top P / Min P / Typical P: Sampling controls for diversity
  • Repeat Last N / Repeat Penalty: Reduce repetition
  • Presence/Frequency Penalty: Encourage new topics, reduce repeats
  • Stop Sequences: Custom stopping points (up to 8)
  • Batch Size (num_batch): Controls internal batching of requests; larger values can increase throughput but use more memory.

Commands

  • Enter parameter numbers 1-15 to edit settings
  • Enter sp to edit the system prompt
  • Use u1, u2, etc. to unset parameters, or uall to reset all
  • h/help: Show parameter details and tips
  • undo: Revert changes
  • s/save: Apply changes
  • q/quit: Cancel

Example Configurations

  • Factual: temperature: 0.0-0.3, top_p: 0.1-0.5, seed: 42
  • Creative: temperature: 1.0+, top_p: 0.95, presence_penalty: 0.2
  • Reduce Repeats: repeat_penalty: 1.1-1.3, presence_penalty: 0.2, frequency_penalty: 0.3
  • Balanced: temperature: 0.7, top_p: 0.9, typical_p: 0.7
  • Reproducible: seed: 42, temperature: 0.0
  • Large Context: num_ctx: 8192 or higher for complex conversations requiring more context

[!TIP] All parameters default to unset, letting Ollama use its own optimized values. Use help in the config menu for details and recommendations. Changes are saved with your configuration.

Thinking Mode and Reasoning Effort

Enable thinking mode with /thinking-mode (/tm) to activate extended reasoning on supported models (e.g., qwen3, deepseek-r1, Claude with extended thinking). Use /show-thinking (/st) to toggle whether the reasoning process is visible in the response.

Use /reasoning-effort (/re) to control how much reasoning effort the model applies when thinking mode is on:

LevelDescription
autoProvider's default effort (recommended for cloud)
minimalFastest, least reasoning
lowLight reasoning
mediumBalanced — default
highMore thorough reasoning
xhighMaximum reasoning effort

[!NOTE] Some providers or models may ignore reasoning effort settings.

Server Reloading for Development

The /reload-servers command (/rs) is particularly useful during MCP server development. It allows you to reload all connected servers without restarting the entire client application.

Key Benefits:

  • 🔄 Hot Reload: Instantly apply changes to your MCP server code
  • 🛠️ Development Workflow: Perfect for iterative development and testing
  • 📝 Configuration Updates: Automatically picks up changes in server JSON configs or Claude configs
  • 🎯 State Preservation: Maintains your tool enabled/disabled preferences across reloads
  • ⚡️ Time Saving: No need to restart the client and reconfigure everything

When to Use:

  • After modifying your MCP server implementation
  • When you've updated server configurations in JSON files
  • After changing Claude's MCP configuration
  • During debugging to ensure you're testing the latest server version

Simply type /reload-servers or /rs in the chat interface, and the client will:

  1. Disconnect from all current MCP servers
  2. Reconnect using the same parameters (servers added via ollmcp mcp add, server paths, config files, --claude-desktop)
  3. Restore your previous tool enabled/disabled settings
  4. Display the updated server and tool status

This feature dramatically improves the development experience when building and testing MCP servers.

Human-in-the-Loop (HIL) Tool Execution

The Human-in-the-Loop feature provides an additional safety layer by allowing you to review and approve tool executions before they run. This is particularly useful for:

  • 🛡️ Safety: Review potentially destructive operations before execution
  • 🔍 Learning: Understand what tools the model wants to use and why
  • 🎯 Control: Selective execution of only the tools you approve
  • 🚫 Prevention: Stop unwanted tool calls from executing
  • 🔄 Session Mode: Auto-approve all tools for the current query session
  • 🛑 Query Abort: Abort entire query without saving to history

HIL Confirmation Display

When HIL is enabled, you'll see a confirmation prompt before each tool execution:

Example:

ollmcp HIL confirmation screenshot

HIL Confirmation Options

When prompted, you can choose from the following options:

  • y/yes: Execute this specific tool call
  • n/no: Skip this tool call and continue with the query
  • s/session: Execute this and all subsequent tool calls for the current query without further prompts
  • d/disable: Permanently disable HIL confirmations (can be re-enabled with the /hil command)
  • a/abort: Abort the entire query immediately without saving to history

[!TIP] The session option is particularly useful when the model needs to execute multiple tools in sequence. Instead of confirming each one individually, you can approve all tools for the current query session, then HIL will reset automatically for the next query.

Human-in-the-Loop (HIL) Configuration

  • Default State: HIL confirmations are enabled by default for safety
  • Toggle Command: Use /human-in-the-loop or /hil to toggle on/off
  • Persistent Settings: HIL preference is saved with your configuration
  • Quick Disable: Choose "disable" during any confirmation to turn off permanently
  • Session Auto-Approve: Use "session" during confirmation to approv

安装

TypingMind
{
  "mcpServers": {
    "mcp-client-for-ollama": {
      "command": "uvx",
      "args": [
        "ollmcp"
      ]
    }
  }
}

将 MCP 客户端 for Ollama MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP 客户端 for Ollama 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 MCP 客户端 for Ollama 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP 客户端 for Ollama MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcp-client-for-ollama": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP 客户端 for Ollama MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP 客户端 for Ollama MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP 客户端 for Ollama 帮我完成这项任务吗?
MCP 客户端 for Ollama
当然,我看过了。
以下是我使用 MCP 客户端 for Ollama 得到的结果。

常见问题

MCP 客户端 for Ollama MCP 服务器有什么用途?

MCP 客户端 for Ollama 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP 客户端 for Ollama MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 MCP 客户端 for Ollama。

为什么在 TypingMind 中使用 MCP 客户端 for Ollama MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 MCP 客户端 for Ollama 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP 客户端 for Ollama MCP 连接到 TypingMind?

MCP 客户端 for Ollama 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP 客户端 for Ollama MCP 在 TypingMind 中提供哪些工具?

MCP 客户端 for Ollama 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP 客户端 for Ollama MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 MCP 客户端 for Ollama 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇