Skip to content

Installation

farzad edited this page Aug 19, 2026 · 1 revision

Installation

Prerequisites

  • Python 3.10+ (the codebase uses X | None union syntax, which requires it)
  • (Optional) Docker / Docker Compose — see Docker and Deployment
  • (Optional) Ollama if you want a local LLM backend to talk to the server

Install from source

git clone https://github.com/farzadnadiri/MCP-CAN.git
cd MCP-CAN
pip install -r requirements.txt
pip install -e .

This installs the mcp-can console script (defined in pyproject.toml as mcp-can = mcp_can.cli:app).

Dependencies

From pyproject.toml:

Package Purpose
python-can CAN bus abstraction (virtual backend by default, SocketCAN optionally)
cantools DBC loading, encoding, decoding
mcp (pinned >=1.7.0,<2.0.0) MCP server SDK (FastMCP) — the <2.0.0 pin exists because mcp 2.0 removed the fastmcp API this project is built on
httpx-sse SSE client support
typer CLI framework
pydantic / pydantic-settings Structured tool output, env-based settings
uvicorn ASGI server underneath FastMCP
rich Colorized CLI tables/logging

Development install

For running tests/lint yourself, see Development and Testing — it adds pytest, ruff, and mypy on top of the above.

Verifying the install

mcp-can --help

should list simulate, server, demo, frames, decode, monitor, snapshot, dbc-info, obd-request, diag-request, fault. If that works, head to Quickstart.

Windows note

If your checkout lives under a cloud-synced folder (OneDrive, Dropbox, etc.), pip install -e . or git commands can fail with odd FileNotFoundError/Permission denied errors — that's the sync client interfering with the filesystem. Pause sync for that folder, or work from a local (non-synced) path.

Clone this wiki locally