能力标签
MCP客户端
🔌
MCP工具

MCP客户端

基于 Python · 让 AI 助手直接操作你的系统与工具
英文名:mcp-client-for-ollama
⭐ 716 Stars 🍴 97 Forks 💻 Python 📄 MIT 🏷 AI 7.5分
7.5AI 综合评分
mcpai命令行工具python
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,MCP客户端 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。

📚 深度解析

MCP客户端 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 MCP客户端,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。MCP客户端 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 MCP客户端 评为 AI 评分 7.5 分,属于同类工具中的优质选择。

📋 工具概览

MCP客户端 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 716
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
MIT
AI 综合评分
7.5 分
工具类型
MCP工具
Forks
97

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

MCP客户端 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/jonigl/mcp-client-for-ollama

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "mcp---": {
      "command": "npx",
      "args": ["-y", "mcp-client-for-ollama"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 MCP客户端 执行以下任务...
Claude: [自动调用 MCP客户端 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "mcp___": {
      "command": "npx",
      "args": ["-y", "mcp-client-for-ollama"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 50/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

<p align="center">

<img src="https://github.com/jonigl/mcp-client-for-ollama/blob/main/misc/ollmcp-logo-512.png?raw=true" width="256" /> </p> <p align="center"> <i>A simple yet powerful Python client for interacting with Model Context Protocol (MCP) servers using Ollama, allowing local LLMs to use tools.</i> </p>

---

Overview

MCP Client for Ollama (ollmcp) is a modern, interactive terminal application (TUI) for connecting local Ollama LLMs to one or more Model Context Protocol (MCP) servers, enabling advanced tool use and workflow automation. With a rich, user-friendly interface, it lets you manage tools, models, and server connections in real time—no coding required. Whether you're building, testing, or just exploring LLM tool use, this client streamlines your workflow with features like fuzzy autocomplete, advanced model configuration, MCP servers hot-reloading for development, and Human-in-the-Loop safety controls.

Features

  • 🤖 Agent Mode: Iterative tool execution when models request multiple tool calls, with a configurable loop limit to prevent infinite loops
  • 🌐 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
  • 🎨 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, or Both 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.)
  • 🖼️ 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

Autocomplete and Prompt Features

Requirements

Quick Start

Option 1: Install with pip and run

pip install --upgrade ollmcp
ollmcp

Option 2: One-step install and run

uvx ollmcp

Option 3: Install from source and run using virtual environment

git clone https://github.com/jonigl/mcp-client-for-ollama.git
cd mcp-client-for-ollama
uv venv && source .venv/bin/activate
uv pip install .
uv run -m mcp_client_for_ollama

Usage

Run with default settings:

ollmcp
If you don't provide any options, the client will use auto-discovery mode to find MCP servers from Claude's configuration.

Usage Examples

Simplest way to run the client:

ollmcp
> [!TIP] > This will automatically discover and connect to any MCP servers configured in Claude's settings and use the default model qwen2.5:7b or the model specified in your configuration file.

Connect to a single server:

```bash ollmcp --mcp-server /path/to/weather.py --model llama3.2:3b

Tips: where to put MCP server configs and a working example

A common point of confusion is where to store MCP server configuration files and how the TUI's save/load feature is used. Here's a short, practical guide that has helped other users:

  • The TUI's save-config / load-config (or sc / lc) commands are intended to save TUI preferences like which tools you enabled, your selected model, thinking mode, display mode, and other client-side settings. They are not required to register MCP server connections with the client.
  • For MCP server JSON files (the mcpServers object shown above) we recommend keeping them outside the TUI config directory or in a clear subfolder, for example:
~/.config/ollmcp/mcp-servers/config.json

You can then point ollmcp at that file at startup with -j / --servers-json.

[!IMPORTANT] When using HTTP-based MCP servers, use the streamable_http type (not just http). Also check the Common MCP endpoint paths section below for typical endpoints.

Here a minimal working example let's say this is your ~/.config/ollmcp/mcp-servers/config.json:

{
  "mcpServers": {
    "github": {
      "type": "streamable_http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer mytoken"
      }
    }
  }
}
[!TIP] When using GitHub MCP server, make sure to replace "mytoken" with your actual GitHub API token.

With that file in place you can connect using:

ollmcp -j ~/.config/ollmcp/mcp-servers/config.json

Here you can find a GitHub issue related to this common pitfall: https://github.com/jonigl/mcp-client-for-ollama/issues/112#issuecomment-3446569030

Demo

A short demo (asciicast) that should help anyone reproduce the working setup quickly. This example uses an MCP server example with streamable HTTP protocol usage:

asciicast

Common MCP endpoint paths

Streamable HTTP MCP servers typically expose the MCP endpoint at /mcp (e.g., https://host/mcp), while SSE servers commonly use /sse (e.g., https://host/sse). Below is an excerpt from the MCP specification (2025-06-18): > The server MUST provide a single HTTP endpoint path (hereafter referred to as the MCP endpoint) that supports both POST and GET methods. For example, this could be a URL like https://example.com/mcp.

You can find more details in the MCP specification version 2025-06-18 - Transports.

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

  • System Prompt: Set the model's role and behavior to guide responses.
  • 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.

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 approve all tools for current query
  • Query Abort: Use "abort" during confirmation to immediately stop the query without saving
  • Re-enable: Use the hil command anytime to turn confirmations back on

Benefits: - Enhanced Safety: Prevent accidental or unwanted tool executions - Awareness: Understand what actions the model is attempting to perform - Selective Control: Choose which operations to allow on a case-by-case basis - Flexible Workflow: Session mode for efficient multi-tool queries, individual approval for sensitive operations - Clean Abort: Stop problematic queries immediately without polluting conversation history - Peace of Mind: Full visibility and control over automated actions

Configuration Management

[!TIP] It will automatically load the default configuration from ~/.config/ollmcp/config.json if it exists.

The client supports saving and loading tool configurations between sessions:

  • When using save-config, you can provide a name for the configuration or use the default
  • Configurations are stored in ~/.config/ollmcp/ directory
  • The default configuration is saved as ~/.config/ollmcp/config.json
  • Named configurations are saved as ~/.config/ollmcp/{name}.json

The configuration saves:

  • Current model selection
  • Advanced model parameters (system prompt, temperature, sampling settings, etc.)
  • Enabled/disabled status of all tools
  • Context retention settings
  • Thinking mode settings
  • Answer display mode preference
  • Tool execution display preferences
  • Performance metrics display preferences
  • Human-in-the-Loop confirmation settings

Server Configuration Format

The JSON configuration file supports STDIO, SSE, and Streamable HTTP server types (MCP 1.10.1):

{
  "mcpServers": {
    "stdio-server": {
      "command": "command-to-run",
      "args": ["arg1", "arg2", "..."],
      "env": {
        "ENV_VAR1": "value1",
        "ENV_VAR2": "value2"
      },
      "disabled": false
    },
    "sse-server": {
      "type": "sse",
      "url": "http://localhost:8000/sse",
      "headers": {
        "Authorization": "Bearer your-token-here"
      },
      "disabled": true
    },
    "http-server": {
      "type": "streamable_http",
      "url": "http://localhost:8000/mcp",
      "headers": {
        "X-API-Key": "your-api-key-here"
      },
      "disabled": false
    }
  }
}
> [!NOTE] > MCP 1.10.1 Transport Support: The client now supports the latest Streamable HTTP transport with improved performance and reliability. If you specify a URL without a type, the client will default to using Streamable HTTP transport.

🎯 aiskill88 AI 点评 A 级 2026-05-27

高质量的MCP客户端,易于使用

⚡ 核心功能

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

请参考项目文档和示例代码
💡 AI Skill Hub 点评

AI Skill Hub 点评:MCP客户端 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 MCP客户端
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 mcp-client-for-ollama
原始描述 开源MCP工具:A text-based user interface (TUI) client for interacting with MCP servers using 。⭐716 · Python
Topics mcpai命令行工具python
GitHub https://github.com/jonigl/mcp-client-for-ollama
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/jonigl/mcp-client-for-ollama

收录时间:2026-05-27 · 更新时间:2026-05-27 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。