Tesla MCP Server
Provides tools to interact with Tesla's Owner API, enabling management of vehicles and solar systems, including authentication, vehicle data retrieval, command sending, and solar system monitoring.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tesla MCP Server list my vehicles"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Tesla MCP Server
Model Context Protocol (MCP) server for connecting Claude with the Tesla Owner API. It provides tools for authentication and data retrieval for Tesla vehicles and solar systems.
Requirements
Python 3.11
Model Context Protocol (MCP) Python SDK
httpx
python-dotenv
Related MCP server: Enphase Solar MCP Server
Setup
1. Install uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh2. Clone this repository
git clone https://github.com/yourusername/tesla-mcp-server.git
cd tesla-mcp-server3. Create and activate a virtual environment
# Create virtual environment
uv venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate4. Sync project dependencies
uv syncUsage
Authentication Setup
This server uses Tesla's Owner API and implements a secure OAuth2 authentication flow. Before using the server with Claude Desktop, you must first run the authentication setup script.
1. Run Authentication Setup
IMPORTANT: You must run this setup script before using the server with Claude:
python setup_auth.pyThis script will:
Prompt you to authenticate via your browser
Walk you through the Tesla OAuth2 flow
Create a
refresh_token.txtfile for future sessionsTest the API connection to ensure everything works
Do not commit refresh_token.txt to version control.
2. Authentication Flow Details
On first run of
setup_auth.py, you will be prompted to authenticate via your browserFollow the instructions in the terminal to complete the OAuth2 flow
After successful authentication, a
refresh_token.txtfile will be created and used for future sessionsThe refresh token will be automatically used by the MCP server for subsequent API calls
Configure Claude Desktop
To use this server with Claude Desktop, you need to add it to your Claude Desktop configuration.
Run the following from the
tesla_mcp_serverdirectory to configure Claude Desktop:
mcp install src/tesla_mcp_server/server.py --name "Tesla" --with-editable .If you open your Claude Desktop App configuration file
claude_desktop_config.json, it should look like this:
{
"mcpServers": {
"Tesla": {
"command": "/Users/<USERNAME>/.cargo/bin/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with-editable",
"/path/to/tesla-mcp-server",
"mcp",
"run",
"/path/to/tesla-mcp-server/src/tesla_mcp_server/server.py"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}Where /path/to/ is the path to the tesla-mcp-server code folder in your system.
Restart Claude Desktop.
Use the MCP server with Claude
Once the server is running and Claude Desktop is configured, you can use the following tools to interact with your Tesla systems:
tesla_auth_status: Check Tesla authentication statusget_vehicles: Get a list of all your vehiclesget_vehicle: Get detailed information about a specific vehiclesend_command: Send a command to a vehicleget_solar_system: Get status of a solar systemget_solar_history: Get history of a solar systemget_system_summary: Get a summary of all Tesla systems
Re-authentication
If you ever need to re-authenticate, simply delete
refresh_token.txtand runpython setup_auth.pyagain.
Development and testing
Install development dependencies and run the test suite with:
uv sync --all-extras
pytest -v testsRunning the server locally
To start the server manually (useful when developing or testing), run:
mcp run src/tesla_mcp_server/server.pyLicense
The GNU General Public License v3.0
Available Tools
7 toolsget_solar_historyD
Get history of a solar system
Inputs: site_id (required), period.
get_solar_systemC
Get status of a solar system
Inputs: site_id (required).
get_system_summaryC
Get a summary of all Tesla systems
Inputs: no named parameters.
get_vehicleC
Get detailed information about a specific vehicle
Inputs: vehicle_id (required).
get_vehiclesA
Get list of all vehicles
Inputs: no named parameters.
send_commandC
Send a command to a vehicle
Inputs: vehicle_id (required), command (required), parameters.
tesla_auth_statusB
Check Tesla authentication status
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target distinct resources (solar history, solar status, system summary, vehicle detail, vehicle list, auth status, and a general command sender). However, 'get_system_summary' might overlap with vehicle and solar status tools, causing some potential confusion.
Tool names use mixed patterns: most start with 'get_', one with 'send_', and one with 'tesla_auth_status' (no verb prefix). This inconsistency could hinder agent prediction of similar operations.
With 7 tools, the server covers both vehicle and solar domains without being overwhelming. The count feels appropriate for a focused Tesla integration.
Basic retrieval is covered for vehicles and solar, and vehicle commands are supported via a generic tool. However, missing operations like solar command/settings or vehicle-specific action tools (e.g., lock, climate) leave notable gaps.
Related MCP Connectors
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Connect ChatGPT or Claude to your CRM, store or shipping API. Keys stay out of the chat.
Related MCP Servers
- AlicenseBqualityFmaintenanceEnables Claude Desktop to access Tesla vehicle data through the Tessie API. Users can query their car's location, battery level, mileage, driving history, and charging status using natural language.59MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude Desktop to the Enphase Developer API v4 for read-only access to solar production, consumption, battery, and EV charger data, with optional write tools for battery settings and EV charging.1MIT
- FlicenseBqualityDmaintenanceConnects Claude or any MCP client to the Strava API v3, enabling access to fitness data such as activities, athletes, clubs, segments, routes, and streams.37-
- FlicenseNot gradedqualityDmaintenanceEnables Claude to interact with Basecamp API for project and to-do management via OAuth authentication.-