
Mcp Tesla
io.github.jlestel由 GitHub 帳號 jlestel 發布v1.0.0更新於 Oct 24, 2026
MCP server wrapping the Tesla Fleet API and TeslaMate API
概覽
託管式 MCP 伺服器,封裝 Tesla Fleet API 與 TeslaMate API,讓助理讀取車輛、能源與充電資料並下達遠端車輛指令
- 可以做什麼
- 讀取車輛資料:車輛清單、即時狀態、中繼資料、服務資料、警示、保固與升級資格,以及駕駛人與共享邀請、車隊遙測和推播訂閱、簽章指令。下達車輛指令:鎖車解鎖、後車廂、空調與座椅、充電排程與上限、車窗、燈光與喇叭、媒體、導航、哨兵與代客模式、限速、軟體更新和遠端啟動。讀取並控制能源產品:Powerwall 與太陽能狀態、歷史、備用儲備、運作模式、風暴監看和電網進出設定。查看充電歷史與發票,並查詢 TeslaMate 資料如行程和能效。依需求產生圖表和儀表板。
- 適用情境
- 適合用自然語言詢問特斯拉車輛狀況、查看電量、充電或哨兵狀態、比較一段時間內的能耗,或下達鎖車、預熱、預約充電等遠端指令,而不必開啟應用程式。
- 執行需求
- 透過 streamable HTTP 連線 mcp.myteslamate.com 遠端端點,無需本機安裝。需要 Tesla 帳號進行 OAuth 登入,SSO 還需要 MyTeslaMate 帳號。不支援 OAuth 的用戶端可在 Authorization 標頭中使用 MyTeslaMate API 權杖。自架需要 Python 相依套件或 Docker;使用官方 Fleet API 需要 Tesla 開發者帳號和 Fleet API 註冊。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Tesla,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.jlestel%2Fmcp-tesla/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"tesla": {
"type": "http",
"url": "https://mcp.myteslamate.com/mcp"
}
}
}README
Tesla MCP Server: https://mcp.myteslamate.com/mcp
This repository provides a Model Context Protocol server that wraps both the Tesla Fleet API and the TeslaMate API. It includes vehicle endpoints, vehicle commands, energy endpoints (Powerwall/Solar), and charging endpoints. The implementation is modular and fully featured, exposing 98 MCP tools for the Tesla Fleet API and 9 MCP tools for the TeslaMate API.
✨ What You Can Do
This isn't just remote control — it's a conversational interface to your entire Tesla ecosystem. Express your use cases directly to your AI — describe what you want in plain language and let it figure out which tools to call, in what order, and with what parameters. No app to open, no menu to navigate.
⚡ Energy Optimization
"My Powerwall is at 40%. Should I charge my car now or wait for solar production this afternoon?"
"Analyze my last 30 days of energy data — am I losing money by exporting to the grid while paying to charge at night?"
"Set the Powerwall backup reserve to 20% and schedule the car to charge from 2am to 6am at 16A."
The AI can cross-reference your solar production, Powerwall state, grid rates, and vehicle battery level to give you a recommendation — and act on it immediately.
🚗 Smart Vehicle Management
"I have a road trip to Lyon next Thursday. Based on my usual efficiency, will I need to stop for charging? Find the best Supercharger on the route."
"Compare my energy consumption this month vs last month. What changed?"
"Pre-condition the car at 7:45am every weekday and set the charge limit back to 80% — it's currently at 100% from the trip."
📊 Data & Insights (with TeslaMate API)
"What's my average km/kWh over the last 3 months? Is it getting worse?"
"Show me my most expensive charging sessions this year and where they happened."
"How many hours per week is the car sitting with climate running? What's the energy cost?"
🔐 Security & Peace of Mind
"Is my car locked and is Sentry mode on? I forgot to check before my flight."
"My car is parked downtown. Turn on Sentry mode and send me the current location."
🎨 Generative UI — Custom dashboards on demand
Beyond pre-built widgets, the server exposes a Generative UI capability so the AI can build interactive Prefab UI components on the fly to answer with charts, tables and metric cards — not just text.
"Show me a bar chart of my charging cost per location for last month."
"Build a dashboard for this car: current SoC, last 7 drives, and battery health degradation."
"Compare my efficiency this winter vs last summer with two side-by-side metric cards."
The AI uses generative_generate_prefab_ui to author Python code in a sandbox (Pyodide + Deno on the server); the resulting widget is rendered directly in your chat through a Skybridge-mime iframe — no template authoring on your side, no extra round-trip. The companion generative_search_prefab_components lookup tool keeps the LLM honest about component signatures.
It works equally well for Tesla Fleet API and TeslaMate users — the same generative tool is gated by either subscription.
Skills — pre-framed analytical workflows
The server also ships MCP Skills: markdown workflows the LLM reads on demand to chain tools into a coherent answer. The first one available is drive-efficiency-coach:
"Run the drive efficiency coach for the last 30 days and show it as a report."
The skill walks the AI through fetching your TeslaMate drives, computing Wh/km percentiles, identifying outliers, cross-referencing speed/temperature/trip-length, and rendering a Generative UI report (metric cards + outliers table + 1–3 actionable coaching insights anchored in your own numbers).
🤝 Contribute a skill
Skills are the easiest way to extend this server without touching Python. Pull requests welcome — drop a new directory under tesla_mcp/skills/ and SkillsDirectoryProvider picks it up automatically.
A good skill is:
- Specific — answers one concrete question well rather than trying to do everything (e.g. "summarize my charging cost by location for a period" beats "manage my charging").
- Tool-aware — names the exact MCP tools to call (
teslamate_get_car_drives,energy_live_status, …) and the right arguments. - Numerically anchored — the coaching/insights step quotes numbers derived from the user's own data, not generic platitudes.
- Visual when it helps — wraps up with a
generative_generate_prefab_uirender for analytics/reports; plain text for one-shot questions. - Honest about pitfalls — calls out unit ambiguities, data gaps, edge cases the LLM should handle.
Minimal layout:
SKILL.md starts with YAML frontmatter (name, description) followed by the workflow. See drive-efficiency-coach/SKILL.md as a reference.
Ideas waiting for an author:
charging-cost-breakdown— group last month's charges by location, surface cost-per-100kmweekly-tesla-digest— drives + charges + battery snapshot + software updates as a Monday-morning email-style reportrange-anxiety-checker— given a destination, cross-reference SoC, weather, elevation and recent efficiency to call out a stop or reassurehome-charging-window-finder— using TOU settings + recent charge sessions, find the cheapest 4-hour window to plug in tonight
Available capabilities (98 tools for Tesla Fleet API + 9 for TeslaMate API + 2 Generative UI tools + skills):
- Vehicle control: lock/unlock, climate, trunk, windows, lights, horn
- Charging: start/stop, set limits, schedule, charging amps, charge history
- Powerwall & Solar: live status, energy history, backup reserve, storm mode, grid import/export, time-of-use settings
- Navigation: send destinations, find nearby Superchargers
- Security: Sentry mode, valet mode, speed limits, PIN to drive
- Data & analytics: vehicle data, trip history, drive statistics (TeslaMate API)
- Generative UI: on-demand Prefab dashboards (charts, metrics, tables) authored by the AI in a sandboxed Pyodide runtime
- Skills: pre-framed analytical workflows (e.g.
drive-efficiency-coach) the AI reads on demand to chain tools into a coherent answer
🔐 One-Click SSO — Connect with Your Tesla Account
The hosted server supports OAuth 2.0 Single Sign-On via Tesla's official authorization server. Compatible clients (ChatGPT, Claude.ai, VS Code…) trigger an automatic sign-in flow — no token copy-paste required.
The server proxies the OAuth flow to
auth.tesla.com, then exchanges your Tesla token for a MyTeslaMate token transparently. Your Tesla credentials never touch this server.
🤖 Setup on ChatGPT (Apps / MCP Connector)
ChatGPT supports native MCP connectors via Settings → Apps.
- In chat.openai.com, open Settings → Apps.
- Click Create app.
- Enter the MCP server URL:
- ChatGPT will auto-discover the OAuth metadata and prompt you to Connect.
- Sign in with your Tesla account — the authorization is handled automatically.
- The connector appears in your Enabled apps list and is available in all your chats.
🧠 Setup on Claude.ai (MCP Connector)
- Open claude.ai → Settings → Connectors.
- Click Add custom connector.
- Enter a name (e.g.
Tesla) and the MCP server URL: - Click Add — Claude will auto-discover the OAuth metadata and show a Connect button.
- Click Connect — you'll be redirected to Tesla's login page.
- After authorization, Claude will have access to all Tesla MCP tools.
Note: OAuth-based SSO requires a MyTeslaMate account. The server validates your Tesla token and links it to your MTM subscription automatically.
🤖 Claude Code Skills
Ready-to-use Claude Code skills for this MCP server are available in myteslamate/tesla-skills.
Install the /tesla slash command in one step:
Then in Claude Code:
🚀 Quick Start - Use Directly in VS Code, Claude Desktop, etc.
No installation required! Use the hosted MCP server directly. Two authentication options:
Option A — SSO (Recommended for Claude.ai & ChatGPT)
Simply provide the server URL and let the client handle the OAuth flow automatically (see sections above).
Option B — Manual Token (VS Code, Cursor, Claude Desktop)
For clients that don't support OAuth, use your MyTeslaMate API token directly in the Authorization header.
For VS Code / Cursor (with MCP Extension) and Other MCP Clients
Add both endpoints to your .vscode/mcp.json configuration to choose your preferred integration:
- Use
tesla_fleet_apifor direct access to Tesla's official Fleet API. - Use
teslamatefor integration via TeslaMate API.
For Claude Desktop
Add endpoints in the MCP Connector configuration with the same URLs and headers as above.:
Select the server according to your authentication method and API preference.
🔑 Getting Your Token (Manual Mode Only)
- Visit MyTeslaMate.com
- Sign in with your Tesla account
- Navigate to the API section in your dashboard
- Copy your personal API token
- Use it in your MCP configuration
🔧 Self-Hosting (Advanced)
If you prefer to run your own instance, this repository also support TeslaMate API and Tesla Fleet API (Requires Tesla Developer Account and proper Fleet API registration).
Features
- Modular package under
tesla_mcpwith a reusableTeslaClient. - Vehicle endpoints (29 read-only endpoints):
- Core Vehicle Info:
GET /api/1/vehicles- List vehiclesGET /api/1/vehicles/{vehicle_tag}- Get vehicle metadataGET /api/1/vehicles/{vehicle_tag}/vehicle_data- Get live vehicle dataPOST /api/1/vehicles/{vehicle_tag}/wake_up- Wake sleeping vehiclePOST /api/1/vehicles/fleet_status- Fleet statusGET /api/1/vehicles/{vehicle_tag}/mobile_enabled- Check mobile accessGET /api/1/vehicles/{vehicle_tag}/nearby_charging_sites- Nearby chargingGET /api/1/vehicles/{vehicle_tag}/service_data- Service dataGET /api/1/vehicles/{vehicle_tag}/release_notes- Firmware release notesGET /api/1/vehicles/{vehicle_tag}/recent_alerts- Recent alertsGET /api/1/dx/vehicles/options?vin={vin}- Vehicle optionsGET /api/1/dx/vehicles/upgrades/eligibility?vin={vin}- Eligible upgradesGET /api/1/dx/vehicles/subscriptions/eligibility?vin={vin}- Eligible subscriptions
- Drivers & Sharing (6 endpoints):
GET /api/1/vehicles/{vehicle_tag}/drivers- List allowed drivers (owner only)DELETE /api/1/vehicles/{vehicle_tag}/drivers- Remove driver accessGET /api/1/vehicles/{vehicle_tag}/invitations- List active share invites (paginated)POST /api/1/vehicles/{vehicle_tag}/invitations- Create share invite (24hr expiry, single-use)POST /api/1/invitations/redeem- Redeem share invitePOST /api/1/vehicles/{vehicle_tag}/invitations/{id}/revoke- Revoke share invite
- Fleet Telemetry (4 endpoints):
GET /api/1/vehicles/{vehicle_tag}/fleet_telemetry_config- Get fleet telemetry configPOST /api/1/vehicles/fleet_telemetry_config- Configure self-hosted fleet-telemetry serverDELETE /api/1/vehicles/{vehicle_tag}/fleet_telemetry_config- Remove fleet telemetry configGET /api/1/vehicles/{vehicle_tag}/fleet_telemetry_errors- Recent fleet telemetry errors
- Push Notification Subscriptions (4 endpoints):
GET /api/1/subscriptions- Get subscriptions for mobile devicePOST /api/1/subscriptions- Set subscriptions for mobile deviceGET /api/1/vehicle_subscriptions- Get vehicle subscriptionsPOST /api/1/vehicle_subscriptions- Set vehicle subscriptions
- Warranty & Signed Commands (2 endpoints):
GET /api/1/dx/warranty/details?vin={vin}- Get warranty informationPOST /api/1/vehicles/{vehicle_tag}/signed_command- Execute signed command (Tesla Vehicle Command Protocol)
- Core Vehicle Info:
- Vehicle commands (64 control endpoints):
- Doors & Access: door_lock, door_unlock, actuate_trunk
- Climate: auto_conditioning_start/stop, set_temps, set_climate_keeper_mode, set_bioweapon_mode, set_cabin_overheat_protection, set_cop_temp, set_preconditioning_max
- Seat & Steering: remote_seat_heater_request, remote_seat_cooler_request, remote_auto_seat_climate_request, remote_steering_wheel_heater_request, remote_steering_wheel_heat_level_request, remote_auto_steering_wheel_heat_climate_request
- Charging: charge_start, charge_stop, charge_port_door_open/close, set_charge_limit, charge_standard, charge_max_range, set_charging_amps, set_scheduled_charging, add/remove_charge_schedule, add/remove_precondition_schedule
- Windows & Sunroof: window_control, sun_roof_control
- Lights & Horn: flash_lights, honk_horn
- Media: adjust_volume, media_toggle_playback, media_next/prev_track, media_next/prev_fav, media_volume_down
- Navigation: navigation_request, navigation_gps_request, navigation_sc_request
- Security: set_sentry_mode, set_valet_mode, reset_valet_pin, speed_limit_set_limit, speed_limit_activate/deactivate/clear_pin, speed_limit_clear_pin_admin, set_pin_to_drive, reset_pin_to_drive_pin, clear_pin_to_drive_admin
- Software: schedule_software_update, cancel_software_update
- Misc: remote_start_drive, trigger_homelink, remote_boombox, set_vehicle_name, guest_mode, erase_user_data
- Energy endpoints (12 endpoints for Powerwall/Solar control):
- Information: energy_products (list all products), energy_site_info (site configuration), energy_live_status (real-time power/energy data)
- History: energy_history (energy measurements over time), energy_backup_history (off-grid events), energy_charge_history (wall connector usage)
- Control: energy_operation (set mode: autonomous/self_consumption), energy_backup (set backup reserve %), energy_off_grid_vehicle_charging_reserve (reserve for EV charging during outage)
- Grid Settings: energy_storm_mode (enable/disable storm watch), energy_grid_import_export (control grid charging/exporting), energy_time_of_use_settings (configure utility rate plans)
- Charging endpoints (3 endpoints for charging history and invoices):
- charging_history (paginated charging history with filters)
- charging_invoice (download PDF invoice for a charging event)
- charging_sessions (session information with pricing and energy data - business accounts only)
- Centralised error handling and basic logging so MCP clients surface useful diagnostics.
Configuration
API Endpoint Configuration
Configure the Tesla API base URL using the TESLA_BASE_URL environment variable:
For MyTeslaMate API (Default)
For Tesla Fleet API (Official)
Choose your regional endpoint:
Note: When using the official Tesla Fleet API, ensure you have:
- A registered Tesla Developer Account
- Proper Fleet API access permissions
- Valid OAuth 2.0 bearer tokens
Installation
Install the Python dependencies once:
Running the MCP server
You can start the server in multiple ways:
Option 1: Using uvicorn (Recommended)
Option 2: Docker compose method
Option 3: Legacy method
The server will start using HTTP Streaming on http://0.0.0.0:8084. Connect your MCP-compatible
client (such as Cursor or VS Code with the MCP extension) and configure a server
entry that points to this endpoint.
Usage Examples
Quick Start with MyTeslaMate
Using Tesla Fleet API (Official)
Docker Usage
Adding new modules
- Create a file under
tesla_mcp/modules/inheriting fromTeslaModule. - Register the module in
tesla_mcp/modules/__init__.py. - Expose new MCP tools inside
server.pythat delegate to the module methods.
This structure keeps the MCP layer thin while centralising all Tesla Fleet API
and TeslaMate API logic in the tesla_mcp package.
來源:README.md,提交 224b935
工具
0版本歷史
1- v1.0.0最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分