TeslaMate MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TIMEZONE | No | IANA timezone | Asia/Shanghai |
| HTTP_HOST | No | HTTP binding address | 0.0.0.0 |
| HTTP_PORT | No | HTTP port | 8080 |
| MCP_DEBUG | No | Enable debug logging | false |
| AMAP_API_KEY | No | AMAP (Gaode) API key for geocoding | |
| TESLA_CAR_ID | No | Default car ID | 1 |
| MCP_TRANSPORT | No | Transport mode: stdio or streamable-http | streamable-http |
| TESLA_GAS_MPG | No | ICE vehicle MPG | 28 |
| TESLA_GAS_PRICE | No | Gas price per gallon | 3.50 |
| QWEATHER_API_KEY | No | QWeather API key | |
| TESLA_CAR_PARAMS | No | JSON object mapping car_id to {kwh, range_km} | |
| USE_METRIC_UNITS | No | Use metric units | true |
| QWEATHER_API_HOST | No | QWeather API host (e.g. xxxx.re.qweatherapi.com) | |
| TESLAMATE_DB_HOST | Yes | PostgreSQL host | |
| TESLAMATE_DB_NAME | Yes | Database name | |
| TESLAMATE_DB_PASS | Yes | Database password | |
| TESLAMATE_DB_PORT | No | PostgreSQL port | 5432 |
| TESLAMATE_DB_USER | Yes | Database user | |
| TESLA_BATTERY_KWH | No | Battery capacity in kWh (single car fallback) | 78.4 |
| TESLA_AMAP_TIMEOUT | No | AMAP request timeout (seconds) | 8 |
| TESLA_LIMIT_DRIVES | No | Max drives returned | 500 |
| TESLA_LIMIT_CHARGING | No | Max charging records | 500 |
| TESLA_BATTERY_RANGE_KM | No | Full range in km (single car fallback) | 675 |
| TESLA_QWEATHER_TIMEOUT | No | QWeather request timeout (seconds) | 8 |
| TESLA_LIMIT_TPMS_HISTORY | No | Max TPMS history records | 60 |
| TESLA_TPMS_MAX_THRESHOLD | No | High tire pressure threshold (bar) | 3.5 |
| TESLA_TPMS_MIN_THRESHOLD | No | Low tire pressure threshold (bar) | 2.5 |
| TESLA_WEATHER_SAMPLE_MAX | No | Max trips for weather efficiency analysis | 60 |
| TESLA_LIMIT_STATE_HISTORY | No | Max state transitions | 500 |
| TESLA_LIMIT_VAMPIRE_DRAIN | No | Max vampire drain events | 50 |
| TESLA_ELECTRICITY_RATE_RMB | No | Electricity rate in RMB per kWh | 0.6 |
| TESLA_ELECTRICITY_RATE_USD | No | Electricity rate in USD per kWh (fallback) | 0.12 |
| TESLA_LIMIT_BATTERY_HEALTH | No | Max battery health snapshots | 60 |
| TESLA_LIMIT_BATTERY_SAMPLES | No | Fallback battery samples | 30 |
| TESLA_LIMIT_TRIP_CATEGORIES | No | Max trips for categories analysis | 500 |
| TESLA_LIMIT_LOCATION_HISTORY | No | Max location clusters | 50 |
| TESLA_LIMIT_SOFTWARE_UPDATES | No | Max software updates | 30 |
| TESLA_LIMIT_CHARGING_BY_LOCATION | No | Max charging locations | 50 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| tesla_versionA | Server version & diagnostic info — call first to confirm the build. Returns the running server version, Python/fastmcp versions, timezone, tool count, and whether the TeslaMate database is reachable. Useful for support, debugging, and confirming you hit the expected deployment. |
| tesla_carsA | List all vehicles registered in TeslaMate. Returns each car's ID, name, model, VIN, and efficiency. Use the car_id with other tools to query a specific vehicle. |
| tesla_statusB | Current vehicle state -- battery, range, location, climate, odometer. Returns the latest position snapshot and vehicle info from TeslaMate. |
| tesla_charging_historyB | Charging sessions over the last N days. Shows energy added, duration, battery range, and location for each session. |
| tesla_chargesB | Detailed charging sessions with location, energy, cost breakdown. Unlike tesla_charging_history which summarizes by process, this returns granular charging session data. |
| tesla_drivesC | Recent drives -- distance, duration, efficiency, start/end locations. Shows driving activity with energy consumption. |
| tesla_driving_scoreC | Driving score based on acceleration, braking, and speed habits. |
| tesla_trips_by_categoryC | Get trips filtered by category. |
| tesla_trip_categoriesC | Show count of trips by category for recent drives. |
| tesla_battery_healthB | Battery degradation trend -- range at 100% charge over time. Shows monthly snapshots of ideal range when battery is at 100%. |
| tesla_efficiencyB | Energy consumption trends -- Wh/mi over time. Shows weekly average efficiency from driving data. |
| tesla_location_historyB | Where the car has been -- top locations by time spent. Groups positions by proximity and shows time at each cluster. |
| tesla_state_historyB | Vehicle state transitions -- online, asleep, offline. Shows when the car was awake vs sleeping, useful for vampire drain analysis. |
| tesla_software_updatesB | Firmware version history -- all recorded software versions and install dates. |
| tesla_liveA | Latest polled vehicle state from TeslaMate -- battery, climate, location. Data comes from TeslaMate's positions table (polled periodically, not real-time). Fields like sentry mode, lock status, and media are not available in TeslaMate and are omitted. |
| tesla_savingsC | Gas savings scorecard -- how much you've saved vs a gas car. |
| tesla_trip_costA | Estimate trip cost to a destination -- kWh, cost, range check. Uses your personal 30-day average efficiency and current battery level. If QWeather is configured, the current weather at the origin and the destination is shown for reference only — it does NOT change the energy or cost estimate. |
| tesla_weatherA | Current weather at the car's location (via QWeather 和风天气). Uses the vehicle's latest GPS position to fetch real-time weather —
temperature, feels-like, humidity, wind, precipitation, visibility,
conditions. Complements TeslaMate's single Requires QWEATHER_API_KEY + QWEATHER_API_HOST env vars; otherwise returns a friendly hint and changes nothing else. |
| tesla_efficiency_by_tempC | Efficiency curve by temperature -- Wh/mi at different temps. Shows how outside temperature affects energy consumption. |
| tesla_efficiency_by_weatherA | Efficiency grouped by weather condition (via QWeather historical data). Unlike tesla_efficiency_by_temp (which only buckets by outside_temp), this back-fills each drive's actual weather (clear/rain/snow/fog/wind) from QWeather's historical API and shows how conditions — not just temperature — affect consumption. Same 5°C day can differ hugely: dry-clear vs rain/snow. Method (no database writes):
To stay within API limits only the most recent drives are sampled (TESLA_WEATHER_SAMPLE_MAX, default 60). Requires QWEATHER_API_KEY + QWEATHER_API_HOST; otherwise returns a friendly hint. |
| tesla_charging_by_locationC | Charging sessions grouped by location. |
| tesla_top_destinationsB | Most visited locations ranked by number of visits. |
| tesla_longest_tripsC | Top drives ranked by distance -- your epic road trips. |
| tesla_monthly_reportC | Monthly driving report with stats and comparison to previous month. |
| tesla_tpms_statusA | Current TPMS pressures with warnings for anomalies. Reads from the latest position record in TeslaMate. Warns if any tyre is below TESLA_TPMS_MIN_THRESHOLD or above TESLA_TPMS_MAX_THRESHOLD, or differs from the average by > 0.15 bar. |
| tesla_tpms_historyA | Recent TPMS pressure history from TeslaMate. Shows the average and min/max pressures recorded in positions table. Note: TeslaMate only stores positions during drives/charging, not while parked. |
| tesla_monthly_summaryA | Monthly driving summary -- splits energy into three independent categories:
Wh/km uses ONLY driving kWh so efficiency is not contaminated by charging losses or vampire drain. The three categories are summed independently from their respective primary sources and never mixed in calculations. |
| tesla_vampire_drainA | Vampire drain analysis -- battery loss while parked overnight. Checks for periods where the car was parked (no drives) for 8+ hours
and measures battery drop. A parked period is tagged "露营模式" when the
AVERAGE drain rate over the parked period is ≥
|
| calculate_eco_savings_vs_icevB | Calculate eco savings and carbon reduction compared to an ICEV (燃油汽车). Compares Tesla's actual electricity costs against a hypothetical ICEV consuming the same distance in fuel, plus CO2 savings and tree equivalents. |
| generate_travel_narrative_contextC | Generate a travel narrative timeline for LLM-powered travel blogging. Extracts structured drive and stop data within a time window for generating travel narratives or Vlog scripts. |
| get_vehicle_persona_statusA | Get vehicle persona status -- activity, fatigue, extremes, and health metrics. Provides structured metrics for an LLM to roleplay a "vehicle with personality", including idle ratio, longest continuous drive, max speed, and vampire drain. |
| check_driving_achievementsC | Scan recent drives and charging sessions to check for driving achievements. |
| get_charging_vintage_dataC | Get detailed physical parameters for a single charging session. Intended for LLM to roleplay a 'vintage data sommelier'. |
| generate_weekend_blindboxA | Discover rare one-time destinations as a weekend 'memory blindbox'. Finds places visited only once in the lookback period, where the car stayed for at least min_stay_hours -- good candidates for a surprise 'where was I?' weekend trip recommendation. |
| generate_monthly_driving_reportC | Generate a polished Markdown monthly driving report with Emoji. |
| get_driver_profileB | Get driver gamification profile -- rank, milestones, and Easter eggs. Returns the user's current driving rank, total stats, unlocked milestones, and hints for the next milestone. Easter egg triggers at 160,000 km. Returns JSON with: current_rank, total_distance_km, total_charges, milestones_unlocked (list), next_milestone_hint, and special_160k Easter egg. |
| check_daily_questB | Check today's daily driving quest and progress. Uses a deterministic hash of the current Beijing date to select one quest from the pool each day. Returns status: 未开始/进行中/已完成. |
| get_longest_trip_on_single_chargeB | Find the longest distance driven between two consecutive charges. Uses window functions on charging_processes to define charge windows, then sums drives within each window to find the record. Returns JSON with: record_distance_km, start_time, end_time, start_battery_pct, arrival_battery_pct, battery_consumed_pct, efficiency_comment. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 38 tools
Several tool pairs overlap heavily: tesla_status vs tesla_live both report current vehicle state; tesla_charging_history vs tesla_charges both return charging sessions; tesla_monthly_report, tesla_monthly_summary, and generate_monthly_driving_report all produce monthly summaries; tesla_savings vs calculate_eco_savings_vs_icev both compare against a gas car. Descriptions attempt to distinguish them, but the agent can easily pick the wrong one.
Most tools share a tesla_ prefix without a verb, while a sizable minority use get_/generate_/check_/calculate_ verb patterns. The mix is still readable, but it is not a single predictable convention.
With 38 tools, the surface is heavy for a read-only TeslaMate server, and many overlapping analytics could be parameters or consolidated. It far exceeds a well-scoped set and increases selection burden.
Coverage is broad: vehicle status, charging, drives, efficiency, battery health, TPMS, location, state history, software updates, savings, weather, and reports. Minor gaps exist around geofence/place management and deeper session drill-down, but typical analytics workflows are covered.