How anjor/ollama-mcp-client works
Project type and purpose
• This is an open-source Python client library for the Model Context Protocol (MCP) that uses the Ollama API.
• It implements the MCP Client tutorial, swapping out the Claude-specific code for an Ollama backend.
• It’s not a full-stack web app but a reusable library/tool that can be embedded in other Python code or run via CLI.
File structure
• Top-level:
• client.py – likely a CLI entrypoint or convenience wrapper
• examples/ollama_example.py – demo on how to invoke the client
• src/abstract/base_client.py – MCP Client abstract base class and interface
• src/clients/ollama_client.py – concrete implementation using Ollama stdio transport
• pyproject.toml, setup.py – packaging and dependency config
• Directory pattern:
• src/abstract: interface and shared base logic
• src/clients: pluggable implementations (currently only “ollama”)
• Transport: stdio only, spawning or connecting to an Ollama process.
README for additional insights
• Only stdio transport is supported now
• Installation: pip editable, usage via “uv run examples/ollama_example.py”
• Purpose: fetch the latest MCP data from an Ollama service.