# cobanov/teslamate-mcp [Health: Active]

**Category:** 🚆 Travel & Transportation  
**Repository:** https://github.com/cobanov/teslamate-mcp  
**GitHub Stars:** 143  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cobanov-teslamate-mcp

## Description
A Model Context Protocol (MCP) server that provides access to your TeslaMate database, allowing AI assistants to query Tesla vehicle data and analytics.

## Tools
Capabilities this server exposes over MCP:

- **get_health_checks** — "Is anything wrong?": eight checks per car, worst first, each with alert, warn, ok, or unknown, a value, and what it means: days since TeslaMate last logged the car, drives and charges left open, tire pressure spread and a tire losing more than the others (a slow leak), rated km lost per day parked…
- **get_battery_capacity_trend** — Usable capacity in kWh, estimated from charging sessions (energy added ÷ SOC gained), per month and car
- **get_projected_range_by_mileage** — Rated range at 100 % per odometer bucket (1000 km by default), from charges that ended at 50 % or more, with the drop from the car's best bucket; degradation per km, like TeslaMate's Projected Range dashboard
- **get_driving_style** — Per month: hard accelerations and hard regenerative braking per 100 km, time above a speed (120 km/h by default), top speed, the share of energy regen recovered, and a 0–100 style score; thresholds are parameters
- **get_charging_hours** — Charging sessions by the local hour they started, AC and DC apart, with kWh and each hour's share; shows whether home charging lands in a night tariff
- **get_vampire_drain** — Range lost while parked between drives; gaps that contain a charge do not count
- **get_charging_efficiency** — kWh added vs kWh drawn per car, split into AC and DC
- **get_charging_by_geofence** — Charging totals per TeslaMate geofence, plus an "Ungeofenced" group
- **get_soc_hygiene** — Share of samples above 80% and below 20% state of charge
- **get_period_comparison** — The last N days vs the N days before, one row per metric
- **get_activity_report** — A month by day or a year by month: drives, distance, consumption, charging, and cost per bucket, empty days included
- **get_recap** — A year or month in review in one row: totals, distance against the period before (cut at the same point while it runs), charging and cost, and highlights: longest drive, busiest day, most efficient day or month, favourite destination and charging spot, top speed, temperature range, software updates
- **get_parked_climate_sessions** — Times the climate ran while parked (preconditioning, cooling down after arriving, Keep Climate / Dog / Camp mode): minutes, estimated battery kWh, cooling or heating, temperatures, and where
- **get_climate_usage** — The same per month: sessions, preconditioning count, hours, hours plugged in, estimated kWh and cost
- **get_trip_energy_estimate** — "Will I make it?": energy and battery % a drive of a given distance takes, from this car's own drives at a similar temperature (optionally motorway drives only, or drives at a given average speed), with a conservative figure and the arrival battery %
- **get_charging_time_estimate** — "How long will the stop take?": minutes from one battery % to another per charger type (Supercharger, other fast charger, AC), from the time past sessions spent at each percent, with a slow figure and the kWh added
- **get_timeline** — What the car did, in order: drives, charges, the time parked between them, and software updates, with places, battery %, kWh, and cost; answers "what did my car do on Saturday?"
- **get_state_history** — Per car and local day: hours online, asleep, and offline, driving and charging hours, idle awake hours (online while parked and not charging), and wake-ups
- **get_idle_awake_periods** — The online periods that kept the car awake while parked, longest first, with where it was parked; answers "why isn't my car sleeping?"
- **get_logging_gaps** — Logging holes: drives and charges TeslaMate never closed, and stretches with no position across which the odometer moved or the battery level rose (a drive or charge that was not logged). A parked car logs nothing, so long parks stay out
- **search_drives** — Drives filtered by date range, location text, distance, and car; sortable. Each drive has its Wh/km against what the car usually uses at the same outside temperature
- **search_charging_sessions** — Charging sessions filtered by date range, location, energy, and car
- **get_drive_details** — Full statistics for one drive, with ideal range, the start and end geofence names, and the energy the motors used and regenerative braking recovered
- **get_drive_route** — GPS track points for one drive, downsampled
- **get_charging_curve** — Power and SOC curve for one charging session, downsampled
- **get_charging_session** — One charging session, AC or DC: energy added and used, battery % at start and end, cost, duration, geofence, AC phases, cable, and peak power
- **get_charging_costs** — Costs grouped by month, location, or car, with the number of sessions that have no cost
- **get_charging_cost_estimates** — An estimated cost for each session with none: free Supercharging, a price you give, the geofence tariff, what you paid at the same place, or the typical price for that charger type
- **get_cost_per_distance** — Per month: distance, kWh added split into AC and DC, cost, the AC, DC, and overall price per kWh, cost per 100 km, and kWh charged per 100 km
- **get_fuel_savings** — What the same distance would have cost in fuel, against what charging cost, per car
- **get_geofences** — Each TeslaMate geofence with its center, radius, and tariff: cost per unit, session fee, and billing type
- **get_trips** — One row per trip: legs, stops and charging stops, distance, driving vs stopped time, moving speed, battery % at start and end, kWh added on the way; filter by date, car, distance, legs, or a place the trip passed through
- **get_trip_details** — One trip's timeline: each drive, and each stop with where and how long, plus kWh and battery % for charging stops
- **get_trip_route** — GPS track of a whole trip across its drives, downsampled, with the stop before each leg
- **get_fast_charging_sessions** — DC sessions with peak power, average power, average power across 20–80% (the fair comparison), minutes from 20% to 80%, whether the battery heater ran, and cost
- **get_fast_charging_by_location** — The same per location and charger type: which fast chargers are fastest and cheapest for your car
- **get_charging_curve_comparison** — Power against battery % for several sessions, for overlaying their curves

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/cobanov/teslamate-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/cobanov/teslamate-mcp.git
```

2. Run:

```sh
cd teslamate-mcp
```

3. Configure:

```sh
cp env.example .env      # set DATABASE_URL
```

4. Install:

```sh
uv sync
```

5. Configure:

```sh
cp env.example .env          # set DATABASE_URL, and set AUTH_TOKEN for remote use
```

6. Start the server:

```sh
docker compose up -d
```

## Documentation

## What cobanov/teslamate-mcp does

cobanov/teslamate-mcp turns TeslaMate history into MCP tools for AI assistants. It reads the TeslaMate PostgreSQL database and provides vehicle, driving, charging, battery, climate, cost, and operational analysis. The available reports can identify battery-capacity changes, parked energy loss, charging efficiency, charging costs, driving style, tire-pressure concerns, idle-awake periods, and logging gaps.

The server also supports targeted searches and detailed records. You can find drives or charging sessions by date, location, distance, energy, or car; inspect one drive or charge in detail; retrieve a downsampled route or charging curve; and reconstruct a vehicle timeline. Estimates use the vehicle's own recorded history, including trip-energy estimates based on similar temperature conditions and charging-time estimates based on prior sessions.

## How it works

Reports query the TeslaMate PostgreSQL database and return typed metric rows. Filters such as car, date range, location, distance, thresholds, and limits can be supplied where applicable. Results use TeslaMate's configured unit preferences for assistant responses, while chart output remains metric.

Daily, weekly, and monthly grouping follows the timezone configured through `REPORT_TIMEZONE`. The server provides 77 tools, 12 prompts, MCP instructions, and interactive charts for clients that support them. Chart-oriented capabilities include charging curves, battery degradation, drive and trip maps, activity dashboards, review cards, visited-place maps, driven-road maps, and consumption-versus-temperature views; clients without chart support receive ordinary rows instead.

## Setup and configuration

A TeslaMate installation with its PostgreSQL database is required. Local installation needs Python 3.11 or newer. Clone the project, copy `env.example` to `.env`, set `DATABASE_URL`, install dependencies with `uv sync`, and register the `teslamate-mcp stdio` command in the MCP client. The documented client configuration uses `uv` with the repository directory and starts the server through `uv run`.

For a container deployment, copy `env.example` to `.env` and run `docker compose up -d`. The HTTP endpoint is `http://localhost:8888/mcp`, and `/health` performs a database `SELECT 1`, returning HTTP 503 when the database cannot be reached. Remote HTTP use can be protected with `AUTH_TOKEN`. A GHCR image is published for `linux/amd64` and `linux/arm64` using the `latest` tag.

## Tools and capabilities

- Analyze battery capacity by month and projected rated range by odometer bucket.
- Check vehicle health, logging freshness, open drives or charges, tire pressure, parked drain, sleep behavior, and battery conditions.
- Compare periods, build daily or monthly activity reports, and summarize a year or month in review.
- Examine driving style, efficiency, regenerative braking, speed, climate use, state history, and idle-awake periods.
- Group charging by time, geofence, charger type, cost, efficiency, and location.
- Estimate trip energy, arrival battery percentage, charging duration, missing charging costs, and fuel savings.
- Search drives and charging sessions, then inspect routes, curves, detailed records, and timelines.

## Limitations and notes

The database must contain the relevant TeslaMate history for reports and estimates to be useful. Parked periods during which TeslaMate records nothing are excluded from logging-gap analysis. Charging-cost estimates can use configured prices, geofence tariffs, prior prices, or typical charger-type prices, but one opt-in capability can write charging costs and is subject to confirmation and a column-scoped database grant.

The HTTP transport uses bearer-token authentication. Interactive charts may not render through the documented Cloudflare MCP Server Portal because it rewrites `ui://` resource URIs; a direct Cloudflare Access connection is needed for those charts in that deployment pattern.

_Full upstream README: https://allmcps.com/mcp/cobanov-teslamate-mcp/readme_

