Provides control and monitoring of Tesla vehicles through the Tessie API, including state queries (battery, range, location, climate, doors, charging status) and commands (lock/unlock, climate control, trunk operations, sentry mode, navigation)
Tesla MCP Server
Streamable HTTP MCP server for Tesla vehicle control via the Tessie API.
Author: overment
You connect this server to your MCP client at your own responsibility. Language models can make mistakes, misinterpret instructions, or perform unintended actions. Always verify commands before execution, especially for actions like unlocking, opening trunks, or sending navigation destinations.
The HTTP layer is designed for convenience during development, not production-grade security. If deploying remotely, harden it: proper token validation, secure storage, TLS termination, strict CORS/origin checks, rate limiting, and audit logging.
Notice
This repo works in two ways:
As a Node/Hono server for local workflows
As a Cloudflare Worker for remote interactions
Features
✅ State — Battery, range, location, climate, doors, charging status
✅ Commands — Lock/unlock, climate, trunks, sentry, navigation
✅ Location-aware — GPS coordinates for context-aware interactions
✅ Dual Runtime — Node.js/Bun or Cloudflare Workers
Design Principles
LLM-friendly: Two unified tools, not 1:1 API mirrors
Watch-ready: Designed for AI agents with location context
Secure: Tessie API key stored as secret, clients use separate bearer token
Clear feedback: Detailed command results and vehicle state
Installation
Prerequisites: Bun, Tessie Account.
Ways to Run (Pick One)
Local Development — Standard setup with bearer token auth
Cloudflare Worker (wrangler dev) — Local Worker testing
Cloudflare Worker (deploy) — Remote production
1. Local Development — Quick Start
Get Tessie credentials:
Visit developer.tessie.com
Go to Developer Settings → Generate Access Token
Copy your access token
Note your vehicle's VIN
Configure environment:
Edit .env:
Run:
Claude Desktop / Cursor:
2. Cloudflare Worker (Local Dev)
Create .dev.vars for local secrets:
Endpoint: http://127.0.0.1:8787/mcp
3. Cloudflare Worker (Deploy)
Create KV namespace for session storage:
Output will show:
Update
wrangler.tomlwith your KV namespace ID:
Set secrets:
Deploy:
Endpoint: https://<worker-name>.<account>.workers.dev/mcp
Client Configuration
Alice App
Add as MCP server with:
URL:
https://your-worker.workers.dev/mcpType:
streamable-httpHeader:
Authorization: Bearer <your-BEARER_TOKEN>
Claude Desktop / Cursor (Local Server)
Claude Desktop / Cursor (Cloudflare Worker)
MCP Inspector (Quick Test)
Tools
tesla_state
Get the current state of your Tesla vehicle.
tesla_command
Execute commands on your Tesla vehicle.
Commands Reference:
Command | Description | Parameters |
| Lock the vehicle | — |
| Unlock the vehicle | — |
| Start climate control | — |
| Stop climate control | — |
| Set cabin temperature |
(15-28°C) |
| Turn on max defrost | — |
| Turn off defrost | — |
| Open front trunk | — |
| Toggle rear trunk | — |
| Open charge port door | — |
| Close charge port door | — |
| Enable sentry mode | — |
| Disable sentry mode | — |
| Flash the lights | — |
| Honk the horn | — |
| Send destination to navigation |
,
|
Examples
1. Get vehicle state
2. Lock the car
3. Set temperature to 22°C
4. Start climate before leaving
5. Navigate to a destination
Authentication Flow
Key points:
BEARER_TOKEN: Random token you generate — authenticates clients to your MCP serverTESSIE_ACCESS_TOKEN: Your Tessie API key — used internally by the serverClients never see your Tessie credentials
HTTP Endpoints
Endpoint | Method | Purpose |
| POST | MCP JSON-RPC 2.0 |
| GET | Health check |
Development
Architecture
Environment Variables
Node.js (.env)
Variable | Required | Description |
| ✓ | Tessie API access token |
| ✓ | Tesla Vehicle VIN |
| ✓ | Auth token for MCP clients |
| Server port (default: 3000) | |
| Server host (default: 127.0.0.1) | |
| Enable auth (default: true) | |
|
(default) |
Cloudflare Workers (wrangler.toml + secrets)
wrangler.toml vars:
Secrets (set via
BEARER_TOKEN— Random auth token for clientsTESSIE_ACCESS_TOKEN— Tessie API access tokenTESSIE_VIN— Your vehicle's VIN
KV Namespace:
Troubleshooting
Issue | Solution |
401 Unauthorized | Check
is set and client sends
|
"TESSIE_ACCESS_TOKEN not configured" | Set secret:
|
"TESSIE_VIN not configured" | Set secret:
|
"Tessie API error" | Verify
is valid at developer.tessie.com |
Vehicle not found | Check
is correct (17 characters) |
Vehicle offline | Vehicle may be in deep sleep. Commands will wake it (takes ~30s) |
Command timeout | Tessie waits up to 90s for vehicle wake. Try again. |
KV namespace error | Run
and update wrangler.toml |
"ReadableStream is not defined" | Node.js version too old (needs 18+). Use full path to newer node. |
"spawn bunx ENOENT" | Claude Desktop can't find
. Use
instead. |
Debugging
Test with MCP Inspector:
Check Worker logs:
License
MIT