Teslamate MCP logo

Teslamate MCP

by cobanov

Query TeslaMate PostgreSQL data for vehicle health, trips, charging, costs, battery trends, and driving analytics.

Install Teslamate MCP

Run the project’s own setup commands, in order.

Setup steps from the project

cobanov/teslamate-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/cobanov/teslamate-mcp.git
    
  2. 2. Run
    cd teslamate-mcp
    
  3. 3. Configure
    cp env.example .env      # set DATABASE_URL
    
  4. 4. Install
    uv sync
    
  5. 5. Configure
    cp env.example .env          # set DATABASE_URL, and set AUTH_TOKEN for remote use
    
  6. 6. Start the server
    docker compose up -d
    

Overview

cobanov/teslamate-mcp connects MCP clients to a TeslaMate PostgreSQL database and exposes vehicle reports, searches, estimates, and detailed trip and charging records. Its tools cover battery degradation, health checks, driving behavior, charging costs, climate usage, timelines, routes, and state history. Run it locally over stdio or deploy it over authenticated HTTP for remote clients. Reach for it when an AI assistant needs to answer questions from your own TeslaMate history rather than from live Tesla APIs.

Use cases

  • Check Tesla battery health and degradation
  • Compare driving, charging, and cost metrics across periods
  • Estimate trip energy and arrival battery percentage
  • Find charging sessions and analyze their costs
  • Investigate parked drain, wake-ups, and logging gaps

Key features

  • TeslaMate PostgreSQL reporting
  • Vehicle health and battery analytics
  • Drive, route, and charging-session search
  • Trip-energy and charging-time estimates
  • Charging costs, efficiency, and fuel-savings analysis
  • stdio and authenticated HTTP transports

Tools37

What Teslamate MCP lets your agent do. Expand a tool for its parameters.

Self-reported~1.5k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

22/22 checks healthy over the last 112d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars143Stargazers on the source repository.
Last commit15d agoMost recent push to the default branch.
Tools exposed37Callable tools this server registers over MCP.
Directory activity7 viewsConfig copies, upvotes, and views on AllMCPs.

How Teslamate MCP works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Teslamate MCP

cobanov/teslamate-mcp is an MCP server that connects AI assistants to a TeslaMate PostgreSQL database. Its main tools report vehicle health, battery trends, drives, charging sessions, costs, climate use, timelines, routes, and estimates such as trip energy and charging time from recorded TeslaMate data.

Install it locally by cloning the repository, copying `env.example` to `.env`, setting `DATABASE_URL`, and running `uv sync`. Register `uv run teslamate-mcp stdio` through the client configuration, or use Docker Compose for the HTTP deployment.

Yes, cobanov/teslamate-mcp works with Cursor through its stdio configuration. The documented setup starts the server with `uv`, points to the cloned repository, and runs the `teslamate-mcp stdio` command.

Run the HTTP transport with Docker Compose and expose the MCP endpoint at `/mcp`; set `AUTH_TOKEN` for bearer-token authentication. The server also provides `/health`, which checks database reachability with `SELECT 1`.

Yes, `get_trip_energy_estimate` estimates energy use, battery percentage consumed, and arrival battery percentage from the car's comparable past drives. You can constrain the estimate by temperature, motorway use, or average speed, and request a conservative figure.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTeslamate MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cobanov-teslamate-mcp?style=directory)](https://allmcps.com/mcp/cobanov-teslamate-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/cobanov-teslamate-mcp"><img src="https://allmcps.com/api/badge/cobanov-teslamate-mcp?style=directory" alt="Teslamate MCP on AllMCPs" /></a>