home / mcp / tesla mcp server

Tesla MCP Server

MCP Server for interacting with Tesla (via Tessie API). Written in TypeScript, Node and Hono.dev

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "iceener-tesla-streamable-mcp-server": {
      "url": "https://<worker-name>.<account>.workers.dev/mcp",
      "headers": {
        "TESSIE_VIN": "5YJSA1E26JF1XXXXX",
        "BEARER_TOKEN": "your-random-auth-token",
        "TESSIE_ACCESS_TOKEN": "tessie-access-token"
      }
    }
  }
}

This MCP server provides a streamable HTTP interface to control your Tesla vehicle via the Tessie API, plus local and Cloudflare-based runtimes. It exposes vehicle state and a range of commands you can use from compatible MCP clients, with location context and secure token-based authentication for safe operation.

How to use

You connect your MCP client to the server and authenticate with a bearer token. Once connected, you can query the current vehicle state to read battery level, location, climate status, doors, and more, and you can issue commands such as locking or unlocking, adjusting climate, opening trunks, or sending a navigation destination. The system keeps you informed with detailed feedback about each action and the latest vehicle state, so you know exactly what happened and what changed.

For remote usage, you can deploy to a Cloudflare workers endpoint and connect your MCP client to that public URL. For local workflows, you can run the server on your machine or test with a local Cloudflare worker runner. In all cases, you manage access with a bearer token and keep Tessie credentials internal to the server.

How to install

Prerequisites: install Bun and have a Tessie account ready. You also need a Tessie API token and your vehicle VIN for full operation.

Step 1 — Prepare the environment locally and install dependencies.

cd tesla-mcp
bun install
cp .env.example .env

Step 2 — Configure environment variables in .env with your Tessie credentials and a bearer token for MCP clients.

PORT=3000
AUTH_ENABLED=true
AUTH_STRATEGY=bearer

# Generate this value with a secure random generator
BEARER_TOKEN=your-random-auth-token

TESSIE_ACCESS_TOKEN=your-tessie-access-token
TESSIE_VIN=your-vehicle-vin

Step 3 — Run the server locally.

bun dev
# MCP: http://127.0.0.1:3000/mcp

Additional setup options

If you want to test with Claude Desktop or Cursor against a local server, you can point at the local MCP endpoint. For remote testing via a Cloudflare Worker, follow the deploy steps below and use the worker URL in your MCP client configuration.

Configuration and runtime options

You have three ways to run or deploy the MCP server: locally with Bun, or as a Cloudflare Worker either in local dev mode or deployed to production. Each method uses the same underlying MCP API and shares the same environment variables for Tessie access and client authentication.

Examples

Get the current vehicle state to verify connectivity and state data.

Send a command to lock the vehicle, or adjust climate for arriving passengers.

Notes on security and access

The Tessie API key is stored securely as a secret on the server, and clients use a separate bearer token for authentication. If you deploy remotely, harden the setup with proper token validation, TLS, strict CORS/origin checks, and audit logging.

Troubleshooting

401 Unauthorized: Ensure BEARER_TOKEN is configured and clients send Authorization: Bearer <token>.

Tessie API errors: Verify TESSIE_ACCESS_TOKEN and TESSIE_VIN are correct and valid in Tessie.

Architecture overview

The project is designed to be run as a Node.js/Bun server for local workflows or as a Cloudflare Worker for remote interactions, with a clear separation between client authentication and internal Tessie API usage.

Tools

- tesla_state: Get the current state of your Tesla vehicle.

- tesla_command: Execute commands on your Tesla vehicle.

Available tools

tesla_state

Get the current state of your Tesla vehicle.

tesla_command

Execute commands on your Tesla vehicle.