mcpField
M
MCP-Ollama Client

MCP-Ollama Client

Local
github.com/Nagharjun17AI & Agents8Updated 65w ago

About MCP-Ollama Client

MCP-Ollama Client is a command-line chat client using a local Ollama model to query multiple MCP servers. It starts configured servers, merges their tools, and prefixes tool names to avoid collisions, keeping interactions local.

Key features

  1. 01Use local models through Ollama
  2. 02Launch multiple servers from config
  3. 03Merge and prefix tool names
  4. 04Offline natural-language interaction

Use cases

  1. 01Ask a local model questions offline
  2. 02Call multiple servers in one session
  3. 03Retrieve data from file or database servers

MCP support

The client launches stdio MCP servers listed in config.json, collects and merges their tools, and lets the model choose which server to call.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP-Ollama Client

Small command‑line chat client that

  1. Runs entirely offline with a local LLM via Ollama
  2. Talks to any number of Model‑Context‑Protocol (MCP) servers, all declared in one config.json

At start‑up the client launches every server, fetches their tool schemas, prefixes tool names (postgres.*, filesystem.*, …) and gives the merged list to the model. The LLM decides which server to call for each user request.


Features

FeatureNotes
Local LLM firstDefault model is qwen3:14b, but any function‑calling model that Ollama exposes will work. No cloud keys required.
Multi‑server out‑of‑the‑boxPostgres, filesystem, or your own MCP servers can run side‑by‑side; all are defined in config.json.
Collision‑free tool namesTools are exposed as <server>.<tool> so names never clash.

Requirements

ComponentVersion tested
Python≥ 3.12
Ollama≥ 0.8.0
MCP server(s)Anything that supports stdio transport

Quick start

# 1. clone
git clone https://github.com/Nagharjun17/MCP-Ollama-Client.git
cd mcp-ollama-client

# 2. set up environment
uv venv
source .venv/bin/activate
uv pip sync pyproject.toml         # or: uv pip install -r uv.lock

# 3. pull a local model
ollama pull qwen3:14b

# 4. edit Model Name, DATABASE_URI etc. in config.json and download required MCP Servers. In my case:
uv pip install postgres-mcp

# 5. run
uv run client.py

Example boot log:

🔌 Starting MCP server: postgres
🔌 Starting MCP server: filesystem
🛠️  Aggregated tools: ['postgres.list_schemas', 'filesystem.read_file', ...]
>>>

MCP Client Startup

Type natural language queries; the model will decide when and how to call the exposed tools.


config.json format

{
  "llm": {
    "model": "qwen3:14b",
    "temperature": 0.7,
    "max_tokens": 2048
  },

  "mcpServers": {
    "postgres": {
      "command": "postgres-mcp",
      "args": ["--access-mode=restricted"],
      "env": {
        "DATABASE_URI": "postgresql://user:pass@localhost:5432/db"
      }
    },

    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/mnt/smbshare/"
      ]
    }
  }
}

Keys under mcpServers become prefixes (postgres.*, filesystem.*).

Each server starts as its own stdio subprocess.

Add or remove servers without touching client.py.

Everything stays local, everything is configurable in one file.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.