TeslaMate MCP Server
Provides tools to interact with TeslaMate, a self-hosted data logger for Tesla vehicles, enabling health checks, logging suspension/resume, and GPX data retrieval.
Click on "Install 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., "@TeslaMate MCP Servercheck health of TeslaMate"
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.
teslamate-mcp
MCP server built from skeleton-mcp that exposes TeslaMate HTTP APIs.
What This Server Exposes
TeslaMate endpoints covered by dedicated tools:
GET /health_checkPUT /api/car/:id/logging/suspendPUT /api/car/:id/logging/resumeGET /drive/:id/gpx
Additional MCP tools:
teslamate_connection_infoteslamate_scope_infoteslamate_list_endpointsteslamate_query_suggestion(query recommendation + schema discovery across all tools)teslamate_api_request(generic passthrough to support all currently available TeslaMate routes)
Related MCP server: mcp-teslamate-fleet
License
MIT
Tool Catalog
Each definition below includes usage boundaries, risk level, prerequisites, input constraints, response shape, and examples.
teslamate_query_suggestion
Purpose: Recommends which TeslaMate MCP tools to call for a natural-language goal and can return schema discovery for all tools.
Use when:
You want a guided sequence before making API calls.
You need a quick catalog of each tool's expected inputs and risk profile.
Do not use when:
You already know the exact tool and inputs to invoke.
Risk: Read-only.
Permissions and prerequisites:
No admin key required.
Parameters:
query(optional, string): natural-language intent such as "export drive gpx" or "suspend logging for car 1".includeSchemas(optional, boolean, defaulttrue): include full per-tool schema discovery output.maxRecommendations(optional, integer, default5, max8): number of ranked recommendations.
Expected response shape:
JSON object with ranked recommendations, rationale, safe usage sequence, and optional full schema discovery.
Recommended prerequisite tools:
None.
Recommended follow-up tools:
teslamate_scope_info,teslamate_connection_info,teslamate_health_check, and the top-ranked recommendation.
Example invocation:
{
"name": "teslamate_query_suggestion",
"arguments": {
"query": "suspend logging for car 1",
"includeSchemas": true,
"maxRecommendations": 4
}
}teslamate_connection_info
Purpose: Returns sanitized MCP and TeslaMate connection/auth configuration status.
Use when:
You need to verify effective transport/auth wiring.
You need a quick preflight check before calling TeslaMate operation tools.
Do not use when:
You need vehicle or drive data.
You need to test TeslaMate API responsiveness (
teslamate_health_checkis better).
Risk: Read-only.
Permissions and prerequisites:
No admin key required.
Server must be running with valid env configuration.
Environment-selection behavior:
Uses default user scope unless
userIdis provided.Returns scope-aware effective config status, never raw secrets.
Parameters:
userId(optional, string): explicit user profile scope.
Expected response shape:
JSON object with transport/auth/config status fields and redacted secret indicators.
Common failure conditions:
Invalid
userIdscope mapping.Server startup misconfiguration.
Recommended prerequisite tools:
teslamate_scope_info
Recommended follow-up tools:
teslamate_health_check,teslamate_list_endpoints
Example invocation:
{ "name": "teslamate_connection_info", "arguments": { "userId": "default" } }teslamate_list_endpoints
Purpose: Lists known TeslaMate routes captured by this MCP server.
Use when:
You need discoverability before invoking
teslamate_api_request.You need to confirm whether a dedicated tool already exists.
Do not use when:
You need live data from TeslaMate.
Risk: Read-only.
Permissions and prerequisites:
No admin key required.
Environment-selection behavior:
Independent of TeslaMate user profile; no
userIdrequired.
Parameters:
None.
Expected response shape:
JSON object/array of endpoint descriptors (method/path and optional notes).
Common failure conditions:
Internal catalog load error (rare).
Recommended prerequisite tools:
None.
Recommended follow-up tools:
teslamate_api_request,teslamate_health_check
Example invocation:
{ "name": "teslamate_list_endpoints", "arguments": {} }teslamate_scope_info
Purpose: Returns the effective scope and profile resolution details for the request.
Use when:
You need to confirm which user profile will be used.
You are debugging default-user fallback behavior.
Do not use when:
You need TeslaMate API payloads.
Risk: Read-only.
Permissions and prerequisites:
No admin key required.
Environment-selection behavior:
Resolves
userIdif provided.Otherwise uses
MCP_CONFIG_DEFAULT_USER_IDfallback behavior.
Parameters:
userId(optional, string): requested user scope.
Expected response shape:
JSON object describing requested scope, resolved scope, and fallback status.
Common failure conditions:
Invalid user scope format.
Missing profile data in multi-user overrides.
Recommended prerequisite tools:
None.
Recommended follow-up tools:
teslamate_connection_info, any operation tool with the sameuserId
Example invocation:
{ "name": "teslamate_scope_info", "arguments": { "userId": "user-123" } }teslamate_health_check
Purpose: Calls
GET /health_checkon the resolved TeslaMate target.Use when:
You need to verify TeslaMate reachability and basic service health.
You want a low-risk connectivity test before mutating calls.
Do not use when:
You need route-specific business data.
Risk: Read-only.
Permissions and prerequisites:
No admin key required.
TeslaMate target must be reachable from the MCP runtime.
Environment-selection behavior:
Uses default scope unless
userIdis provided.
Parameters:
userId(optional, string): route request to a user-specific profile.
Expected response shape:
JSON object with status and response metadata from TeslaMate.
Common failure conditions:
Connection refused/timeouts to TeslaMate base URL.
Invalid auth credentials for selected profile.
Recommended prerequisite tools:
teslamate_scope_info,teslamate_connection_info
Recommended follow-up tools:
teslamate_get_drive_gpx,teslamate_api_request
Example invocation:
{ "name": "teslamate_health_check", "arguments": { "userId": "default" } }teslamate_suspend_logging
Purpose: Calls
PUT /api/car/:id/logging/suspend.Use when:
You intentionally need to pause TeslaMate logging for a specific car.
Do not use when:
You only need read access.
You are uncertain which car is being targeted.
Risk: Mutating, high-impact operational change.
Permissions and prerequisites:
Requires
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.Caller should verify target scope and car id first.
Environment-selection behavior:
Uses default scope unless
userIdis provided.
Parameters:
id(required, integer/string): TeslaMate car id.authorizationKey(conditionally required, string): admin mutation guard.userId(optional, string): user profile scope.
Expected response shape:
JSON object with operation result and upstream response metadata.
Common failure conditions:
Missing/invalid
authorizationKey.Unknown car id.
TeslaMate auth or connectivity failure.
Recommended prerequisite tools:
teslamate_scope_info,teslamate_connection_info,teslamate_health_check
Recommended follow-up tools:
teslamate_resume_logging(rollback),teslamate_api_requestfor verification
Safety warnings:
This changes live data-collection behavior.
Confirm car identity and scope before invoking.
Example invocation:
{
"name": "teslamate_suspend_logging",
"arguments": { "id": 1, "authorizationKey": "<admin-key>", "userId": "default" }
}teslamate_resume_logging
Purpose: Calls
PUT /api/car/:id/logging/resume.Use when:
You need to restore TeslaMate logging for a car.
Do not use when:
Logging is already active and no state change is needed.
Risk: Mutating, high-impact operational change.
Permissions and prerequisites:
Requires
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.
Environment-selection behavior:
Uses default scope unless
userIdis provided.
Parameters:
id(required, integer/string): TeslaMate car id.authorizationKey(conditionally required, string): admin mutation guard.userId(optional, string): user profile scope.
Expected response shape:
JSON object with operation result and upstream response metadata.
Common failure conditions:
Missing/invalid
authorizationKey.Unknown car id.
TeslaMate auth or connectivity failure.
Recommended prerequisite tools:
teslamate_scope_info,teslamate_health_check
Recommended follow-up tools:
teslamate_api_requestfor post-change verification
Safety warnings:
This changes live data-collection behavior.
Verify scope and target car id before invoking.
Example invocation:
{
"name": "teslamate_resume_logging",
"arguments": { "id": 1, "authorizationKey": "<admin-key>", "userId": "default" }
}teslamate_get_drive_gpx
Purpose: Calls
GET /drive/:id/gpxand returns GPX content/metadata.Use when:
You need a drive export for mapping or archival workflows.
Do not use when:
You need generalized JSON endpoint data.
Risk: Read-only (data retrieval can still expose sensitive location history).
Permissions and prerequisites:
No admin key required.
Caller should be authorized to access route/location data.
Environment-selection behavior:
Uses default scope unless
userIdis provided.
Parameters:
id(required, integer/string): drive id.userId(optional, string): user profile scope.
Expected response shape:
JSON wrapper containing GPX payload and response metadata.
Common failure conditions:
Unknown drive id.
TeslaMate auth failure.
Large payload transfer interruptions.
Recommended prerequisite tools:
teslamate_scope_info,teslamate_health_check
Recommended follow-up tools:
External GPX consumers/parsers
Safety warnings:
GPX data may include precise location traces; handle as sensitive output.
Example invocation:
{ "name": "teslamate_get_drive_gpx", "arguments": { "id": 42, "userId": "default" } }teslamate_api_request
Purpose: Generic TeslaMate passthrough with configurable
method,path,query,body, andheaders.Use when:
You need a TeslaMate route not covered by dedicated tools.
You are iterating quickly on endpoint coverage.
Do not use when:
A dedicated tool already exists and provides stricter validation.
You cannot safely validate mutating request intent.
Risk: Mixed.
Read-only for
GET/HEAD.Mutating/high-risk for
POST/PUT/PATCH/DELETE.
Permissions and prerequisites:
Mutating methods require
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.Caller should understand TeslaMate endpoint contract.
Environment-selection behavior:
Uses default scope unless
userIdis provided.Uses selected scope's base URL and auth mode.
Parameters:
method(required, uppercase string): HTTP verb.path(required, string): must be a TeslaMate-relative path beginning with/.query(optional, object): key/value query params.body(optional, object/string): request payload for mutating methods.headers(optional, object): extra request headers.authorizationKey(conditionally required for mutating methods, string).userId(optional, string): user profile scope.
Expected response shape:
JSON object with status, headers subset, and parsed/raw response body.
Common failure conditions:
Invalid method/path.
Missing/invalid
authorizationKeyfor mutating methods.Upstream 4xx/5xx errors.
Request timeout or network failure.
Recommended prerequisite tools:
teslamate_list_endpoints,teslamate_scope_info,teslamate_connection_info
Recommended follow-up tools:
Use dedicated tools after confirming recurring endpoint usage
Safety warnings:
Mutating requests can change vehicle/logging state.
Avoid sending secrets in custom headers unless required.
Prefer dedicated tools for high-value operations to reduce operator error.
Example invocations:
{
"name": "teslamate_api_request",
"arguments": {
"method": "GET",
"path": "/health_check",
"userId": "default"
}
}{
"name": "teslamate_api_request",
"arguments": {
"method": "PUT",
"path": "/api/car/1/logging/suspend",
"authorizationKey": "<admin-key>",
"userId": "default"
}
}Environment
Copy .env.example to .env and set at least:
TESLAMATE_BASE_URL(defaulthttp://127.0.0.1:4000)TESLAMATE_AUTH_MODE(none,bearer, orbasic)TESLAMATE_BEARER_TOKENif using bearer authTESLAMATE_BASIC_USERNAMEandTESLAMATE_BASIC_PASSWORDif using basic auth
Optional security control for mutating MCP operations:
MCP_ADMIN_AUTH_KEY
Multi-user TeslaMate routing:
MCP_CONFIG_DEFAULT_USER_IDsets the default profile (defaultwhen unset).TESLAMATE_USER_OVERRIDES_JSONis a JSON object keyed by user id with per-user TeslaMate overrides.For HTTP mode with Vault token auth, authenticated token metadata
userIdis used as request scope automatically.
Example TESLAMATE_USER_OVERRIDES_JSON:
{
"default": {
"baseUrl": "http://teslamate-default:4000",
"authMode": "none"
},
"user-123": {
"baseUrl": "http://teslamate-user-123:4000",
"authMode": "bearer",
"bearerToken": "token-for-user-123"
}
}HTTP auth modes and sources:
MCP_HTTP_AUTH_MODEsupportstoken,oauth2, orboth.MCP_HTTP_TOKEN_SOURCE=envkeeps static tokens fromMCP_HTTP_AUTH_TOKENS.MCP_HTTP_TOKEN_SOURCE=vaultvalidates bearer tokens from Vault token index and can resolve authenticateduserId.MCP_HTTP_VAULT_TOKEN_INDEX_PATH,MCP_HTTP_VAULT_TOKEN_DEFAULT_USER_ID,MCP_HTTP_VAULT_TOKEN_REQUIRED_SCOPES,MCP_HTTP_VAULT_TOKEN_REQUIRED_AUDIENCE,MCP_HTTP_VAULT_TOKEN_CACHE_TTL_MSconfigure Vault token verification.MCP_HTTP_OAUTH2_INTROSPECTION_URL,MCP_HTTP_OAUTH2_CLIENT_ID,MCP_HTTP_OAUTH2_CLIENT_SECRET,MCP_HTTP_OAUTH2_REQUIRED_SCOPES,MCP_HTTP_OAUTH2_REQUIRED_AUDIENCE,MCP_HTTP_OAUTH2_TIMEOUT_MS,MCP_HTTP_OAUTH2_CACHE_TTL_MSconfigure OAuth2 introspection.
Run
Install dependencies:
npm installStart stdio MCP server:
npm run start:stdioStart HTTP MCP server:
npm run start:httpExternal Services Mode
This project still includes docker-compose.external.yml for app-only runs that point to external services. If you use that mode, configure at least POSTGRES_HOST and VAULT_ADDR in your environment before launching the compose file.
Notes On TeslaMate API Coverage
TeslaMate's native JSON API surface is intentionally small. This MCP includes dedicated tools for all known API-style endpoints and adds teslamate_api_request so new/instance-specific routes can be accessed without waiting for a code change.
Maintenance
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol (MCP) server that provides access to your TeslaMate database, allowing AI assistants to query Tesla vehicle data and analytics.Last updated18133MIT
- AlicenseBqualityDmaintenanceMCP server combining TeslaMate historical analytics with Fleet API live data and commands. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.Last updated292MIT
- Alicense-qualityBmaintenanceComprehensive development tools for Home Assistant, enabling file management, template testing, entity/state management, service calls, log access, and system information retrieval through MCP.Last updatedMIT
- Alicense-qualityAmaintenanceA Model Context Protocol server for the TeslaFi API that lets MCP clients query live vehicle data, drive and charge history, commute patterns, and optionally send commands.Last updatedMIT
Related MCP Connectors
MCP server wrapping the Tesla Fleet API and TeslaMate API
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LesterAJohn/TeslaMate-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server