A feature-rich command line interface that connects local AI models (via Ollama) to a suite of powerful tools using the Model Context Protocol (MCP). Built with LangGraph, it enables your local LLM to leverage external intelligence gracefully and deterministically.
The core script, client.py, operates an AI agent powered by locally running models. This agent communicates with five intelligent MCP Servers that provide specialized tools through the Model Context Protocol (MCP).
-
🔢 Math (
servers/math_server.py):- Basic arithmetic:
add(),subtract(),multiply(),divide() - Powers & roots:
power(),square_root(),factorial() - Logarithms:
log()(natural, base-10, or custom) - Trigonometry:
sin(),cos(),tan()(in degrees) - Number theory:
gcd(),lcm(),is_prime(),fibonacci() - Statistics:
mean(),median(),std_deviation()
- Basic arithmetic:
-
📐 Units (
servers/unit_server.py):- Length: mm, cm, m, km, inch, foot, mile, nautical mile, light-year
- Weight: mg, g, kg, oz, lb, stone, ton
- Volume: ml, l, gallon, quart, pint, cup, fl oz, m³
- Speed: m/s, km/h, mph, knots, ft/s
- Area: m², km², cm², acres, hectares, sq miles
- Time: seconds, minutes, hours, days, weeks, months, years
- Temperature: Celsius ↔ Fahrenheit ↔ Kelvin
-
🌤️ Weather (
servers/weather_server.py):- Real-time weather:
get_current_weather(location)— temperature, humidity, wind, precipitation - Multi-day forecast:
get_weather_forecast(location, days)— up to 14 days - Hourly forecast:
get_hourly_weather(location)— precise hour-by-hour data - Compare weather between multiple locations
- Real-time weather:
-
🌐 Translation (
servers/translate_server.py):- Translate text to 50+ languages via Google Translate
- Language detection:
detect_language(text)— identify source language - List all supported languages:
list_supported_languages()
-
🎬 Media (
servers/ffmpeg_server.py):- Media info:
get_media_info(file_path) - Processing:
trim_media(),convert_media(),compress_video(),extract_audio(),merge_videos() - Requires FFmpeg installed on your system.
- Media info:
- Python 3.10+
- Ollama installed with at least one model pulled (e.g.,
ollama pull qwen3.5:9b) - FFmpeg (optional, for media processing tools)
Clone the repository, create a virtual environment, and install dependencies.
# Create and activate a Virtual Environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install the necessary python packages
pip install uv
uv pip install -r requirements.txtEnsure Ollama is running in the background (ollama serve), then start the multi-agent CLI:
python client.py/help— Show all available CLI commands/tools— List all loaded MCP tools (from all servers)/models— List all locally available Ollama models/model [NAME]— Switch to a different model on-the-fly (clears history)/clear— Clear current conversation history/exit— Quit the CLI
The AI agent uses explicit tool selection rules to avoid hallucinations:
- Weather queries → Uses
get_current_weather()or related tools. - Math & calculations → Always uses math tools, never calculates in your head.
- Unit conversions → Always uses conversion tools, never convert manually.
- Media Processing → Uses FFmpeg tools for high-performance file operations.
- LLM: Ollama (local models)
- Agent Framework: LangGraph (deterministic tool-using loop)
- MCP Implementation:
langchain-mcp-adapters - CLI: Rich (beautiful terminal output)
- Weather: Open-Meteo (free, no API key)
- Translation: Google Translate (free, via deep-translator)
- Media: Local processing via FFmpeg