MCP Teslamate Fleet logo

MCP Teslamate Fleet

by lodordev

Combines TeslaMate analytics with Tesla Fleet API live data and remote vehicle commands.

Install MCP Teslamate Fleet

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "lodordev-mcp-teslamate-fleet": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/lodordev/mcp-teslamate-fleet",
        "mcp-teslamate-fleet"
      ],
      "env": {
        "TESLAMATE_DB_HOST": "YOUR_VALUE_HERE",
        "TESLAMATE_DB_PASS": "YOUR_VALUE_HERE",
        "TESLA_VIN": "YOUR_VALUE_HERE",
        "TESLA_TOKEN_FILE": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env TESLAMATE_DB_HOST=YOUR_VALUE_HERE --env TESLAMATE_DB_PASS=YOUR_VALUE_HERE --env TESLA_VIN=YOUR_VALUE_HERE --env TESLA_TOKEN_FILE=YOUR_VALUE_HERE --transport stdio lodordev-mcp-teslamate-fleet -- uvx --from git+https://github.com/lodordev/mcp-teslamate-fleet mcp-teslamate-fleet

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Automated check passedβ€” started and listed 29 tools correctly ().

Overview

This MCP server exposes TeslaMate driving, charging, vehicle-state, and energy analytics alongside Fleet API live data and commands. Use it with a TeslaMate Postgres database, Fleet API credentials, or both. Fleet API commands require a Tesla HTTP proxy, while live data only requires a token.

Use cases

  • Analyze driving and charging history
  • Track battery health and energy efficiency
  • Compare charging costs with gasoline costs
  • Check live vehicle data
  • Control climate, charging, locks, and sentry mode

Key features

  • 29 tools across TeslaMate and Fleet API backends
  • Driving, charging, location, and vehicle-state history
  • Energy, efficiency, savings, and trip-cost analytics
  • Live Tesla vehicle data
  • Remote climate, charging, lock, trunk, horn, light, and sentry commands
  • Confirmation required for unlock and trunk commands

Tools29

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

Verified live~1.6k 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.

32/32 checks healthy over the last 117d

What it can do

From the 29 tools this server returned when we ran it.

Can delete or modify data Β· 1Read-only tools Β· 28
Network at startup2 connections
Files written at startup17

Observed 2026-11-11 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev Β· mcp-teslamate-fleet (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars2Stargazers on the source repository.
Last commit8mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed29Callable tools this server registers over MCP.
Directory activity13 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

TeslaMate + Fleet API MCP Server

mcp-teslamate-fleet MCP server

MCP server combining TeslaMate historical analytics with Fleet API live data and commands. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.

The first MCP server to bring both data sources together β€” use TeslaMate for deep analytics and Fleet API for real-time control, or configure just one.

Features

29 tools across four categories:

CategoryToolsBackend
Status & Historytesla_status, tesla_drives, tesla_charging_history, tesla_battery_health, tesla_efficiency, tesla_location_history, tesla_state_history, tesla_software_updatesTeslaMate
Analyticstesla_savings, tesla_trip_cost, tesla_efficiency_by_temp, tesla_charging_by_location, tesla_top_destinations, tesla_longest_trips, tesla_monthly_summary, tesla_vampire_drainTeslaMate
Live Datatesla_liveFleet API
Commandstesla_climate_on/off, tesla_set_temp, tesla_charge_start/stop, tesla_set_charge_limit, tesla_lock, tesla_unlock, tesla_honk, tesla_flash, tesla_trunk, tesla_sentryFleet API

Safety: unlock and trunk commands require confirm=True. All commands are rate-limited to 40/day.

Quick Start

Claude Code (.mcp.json)

config.json
{
  "mcpServers": {
    "tesla": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/lodordev/mcp-teslamate-fleet", "mcp-teslamate-fleet"],
      "env": {
        "TESLAMATE_DB_HOST": "localhost",
        "TESLAMATE_DB_PASS": "your_password",
        "TESLA_VIN": "your_vin",
        "TESLA_TOKEN_FILE": "/path/to/tokens.json",
        "TESLA_CLIENT_ID": "your_client_id",
        "TESLA_CLIENT_SECRET": "your_client_secret",
        "TESLA_PROXY_URL": "https://localhost:4443",
        "TESLA_VERIFY_SSL": "false"
      }
    }
  }
}

Claude Desktop (claude_desktop_config.json)

Same structure β€” add under mcpServers.

Local install

bash
git clone https://github.com/lodordev/mcp-teslamate-fleet
cd tesla-mcp
pip install -e .

Prerequisites

You need at least one of these backends configured. Both is ideal.

TeslaMate (analytics + history)

TeslaMate is an open-source Tesla data logger. It records driving, charging, and vehicle state to a Postgres database.

If you already run TeslaMate, you just need the database connection details. If not, see the TeslaMate installation guide.

Fleet API (live data + commands)

Tesla's Fleet API provides real-time vehicle data and remote commands. Setup requires:

  1. Register an app at developer.tesla.com
  2. Generate OAuth tokens β€” use Tesla's token generation flow
  3. Set up the HTTP proxy β€” commands must be signed using the Tesla Vehicle Command Protocol. Deploy the tesla-http-proxy from that repo

The proxy is only needed for commands (tesla_climate_on, tesla_lock, etc.). tesla_live works with just a token.

Tesla provides a $10/month free credit for Fleet API, which is more than enough for personal MCP use.

Configuration

All configuration is via environment variables.

TeslaMate Database

VariableDefaultDescription
TESLAMATE_DB_HOST(required)Postgres host
TESLAMATE_DB_PORT5432Postgres port
TESLAMATE_DB_USERteslamatePostgres user
TESLAMATE_DB_PASS(required)Postgres password
TESLAMATE_DB_NAMEteslamateDatabase name

Fleet API

VariableDefaultDescription
TESLA_VIN(required)Vehicle VIN
TESLA_TOKEN_FILE(required)Path to tokens.json with OAuth tokens
TESLA_CLIENT_IDFleet API client ID (for token refresh)
TESLA_CLIENT_SECRETFleet API client secret (for token refresh)
TESLA_PROXY_URLHTTP proxy URL for commands
TESLA_FLEET_URLNA regionFleet API endpoint (regional options)
TESLA_VERIFY_SSLtrueSet false for self-signed proxy certs

Vehicle Configuration

VariableDefaultDescription
TESLA_CAR_ID1TeslaMate car ID (for multi-car instances)
TESLA_BATTERY_KWH75Usable battery capacity in kWh
TESLA_BATTERY_RANGE_KM525EPA range at 100% in km

Energy consumption is estimated from ideal range deltas using these values. Adjust for your vehicle:

VehicleBattery (kWh)Range (km)
Model 3 Standard Range54350
Model 3 Long Range75500
Model Y Long Range75525
Model S Long Range100650
Model X Long Range100560

Cost Defaults

These are defaults β€” tesla_savings and tesla_trip_cost accept per-call overrides.

VariableDefaultDescription
TESLA_ELECTRICITY_RATE0.12Electricity cost in $/kWh
TESLA_GAS_PRICE3.50Gas price in $/gallon (for comparison)
TESLA_GAS_MPG28Comparable gas vehicle MPG

Architecture

Single-file Python server (~1400 lines) using FastMCP. Two data paths:

Code
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  TeslaMate   │────▢│   Postgres   │──┐
β”‚  (logger)    β”‚     β”‚  (telemetry) β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                       β”œβ”€β”€β–Άβ”‚ tesla.py  │────▢│ MCP Client β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚ (server)  β”‚     β”‚ (Claude,   β”‚
β”‚  Tesla       │────▢│ HTTP Proxy   β”‚β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  Cursor)   β”‚
β”‚  Fleet API   β”‚     β”‚ (commands)   β”‚                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Limitations

  • Single vehicle β€” queries use a configurable car_id but tools don't accept it as a parameter. Multi-car users should run separate server instances.
  • Imperial units β€” output is in miles, Β°F, and PSI. Metric support is planned.
  • Estimated kWh β€” TeslaMate's drives table doesn't include energy consumed directly. We estimate from ideal range deltas using your configured battery capacity. Accuracy is ~90-95%.

Credits

Inspired by cobanov/teslamate-mcp. Built with FastMCP and TeslaMate.

License

MIT

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about MCP Teslamate Fleet

It uses TeslaMate's Postgres database for historical analytics and Tesla's Fleet API for live data and remote commands.

Yes. The server requires at least one backend, so you can configure TeslaMate, Fleet API, or both.

A Tesla HTTP proxy is required for vehicle commands because they must be signed with the Tesla Vehicle Command Protocol. The tesla_live tool works with only a token.

Yes. All commands are limited to 40 per day, and unlock and trunk also require confirm=True.

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 PreviewMCP Teslamate Fleet AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/lodordev-mcp-teslamate-fleet?style=directory)](https://allmcps.com/mcp/lodordev-mcp-teslamate-fleet)
HTML Embed
<a href="https://allmcps.com/mcp/lodordev-mcp-teslamate-fleet"><img src="https://allmcps.com/api/badge/lodordev-mcp-teslamate-fleet?style=directory" alt="MCP Teslamate Fleet on AllMCPs" /></a>