Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mcp-client-for-ollama

> AI 编程
Open source

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, mo

783 stars0 likes3 views
WebsiteGitHub

About

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, mo

A simple yet powerful Python client for interacting with Model Context Protocol (MCP) servers using Ollama, allowing you to harness local LLMs for advanced tool execution.

English | 简体中文 | Español


MCP Client for Ollama (ollmcp)

Sponsored by

Learn how to use Atlas Cloud with ollmcp in the Sponsors section

Watch this demo as an Asciinema recording

Table of Contents

  • Overview
  • Features
  • Requirements
  • Quick Start
  • Installation Options
  • Troubleshooting
  • ✨NEW Managing MCP Servers via CLI
    • mcp add options
    • Scopes
    • Command-line Arguments
      • MCP Server Configuration
      • ✨NEW Inference Provider Configuration
      • General Options
    • ✨NEW Supported Inference Providers
      • API key resolution order
    • Usage Examples
    • How Tool Calls Work
    • Agent Mode
  • Interactive Commands
    • MCP Tools
    • MCP Prompts
    • MCP Resources
    • ✨NEW Answer Display Modes
    • Input Mode
    • Model Selection
    • Advanced Model Configuration
    • ✨NEW Thinking Mode and Reasoning Effort
    • Server Reloading for Development
    • Human-in-the-Loop (HIL) Tool Execution
      • Human-in-the-Loop (HIL) Configuration
    • Performance Metrics
    • History Management
  • Autocomplete and Prompt Features
    • Typer Shell Autocompletion
    • FZF-style Autocomplete
    • MCP Prompts Autocomplete
    • Contextual Prompt
  • Configuration Management
    • ✨NEW Per-provider profiles
  • Server Configuration Format
    • Tips: Where to Put MCP Server Configs and a Working Example
  • Compatible Models
    • Ollama Cloud Models
  • ✨NEW Sponsors
    • Atlas Cloud
    • Become a sponsor
  • Where Can I Find More MCP Servers?
  • Related Projects
  • Security
  • License
  • Acknowledgments

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 . 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  
ollmcp mcp add --transport sse  

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

# List configured servers
ollmcp mcp list

# Remove a server
ollmcp mcp remove 

# 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.
  • `--en

Issues· 17 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonagentic-aiaicommand-line-toolharness

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.