TeslaMate MCP Server
Exposes TeslaMate HTTP APIs (health, logging, drive GPX) and a generic API request tool for interacting with a TeslaMate instance via MCP.
README
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_api_request(generic passthrough to support all currently available TeslaMate routes)
Tool Catalog
-
teslamate_connection_info- Returns MCP and TeslaMate connection/auth configuration status (without leaking secrets).
-
teslamate_list_endpoints- Returns the currently known TeslaMate routes from TeslaMate docs/source.
-
teslamate_scope_info- Returns the effective user scope used to resolve TeslaMate connection settings.
-
teslamate_health_check- Calls
GET /health_check. - Optional
userIdroutes the call to a specific TeslaMate user profile.
- Calls
-
teslamate_suspend_logging- Calls
PUT /api/car/:id/logging/suspend. - Optional
userIdroutes the call to a specific TeslaMate user profile. - Requires
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.
- Calls
-
teslamate_resume_logging- Calls
PUT /api/car/:id/logging/resume. - Optional
userIdroutes the call to a specific TeslaMate user profile. - Requires
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.
- Calls
-
teslamate_get_drive_gpx- Calls
GET /drive/:id/gpx. - Optional
userIdroutes the call to a specific TeslaMate user profile.
- Calls
-
teslamate_api_request- Generic TeslaMate request tool with method/path/query/body/headers support.
- Optional
userIdroutes the call to a specific TeslaMate user profile. - Uses the configured TeslaMate base URL and auth mode.
- Mutating methods (
POST,PUT,PATCH,DELETE) requireauthorizationKeywhenMCP_ADMIN_AUTH_KEYis configured.
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 install
Start stdio MCP server:
npm run start:stdio
Start HTTP MCP server:
npm run start:http
External 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.