ST

scald/tesla-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

20 stars 8 forks 品質 65 トレンド 10MIT

A Model Context Protocol Server for AI models to interface with the Tesla Fleet API.

概要

A Model Context Protocol (MCP) server that connects to the Tesla Fleet API, allowing you to control your Tesla vehicle using Claude and other AI assistants that support MCP. - : Wake up your Tesla from sleep mode - : Get detailed information about your Tesla vehicles - : Refresh vehicle data on demand - : Access detailed vehicle information to help with troubleshooting - Node.js 18+ - pnpm (preferred) or npm - Tesla account with at least one vehicle - Tesla API credentials (Client ID and Client Secret) - Ngrok (for development and registration) This project handles sensitive Tesla API credentials. Please follow these security practices: - : The .gitignore file excludes .env and keys/ but always double-check - : Run ./check-secrets.sh before committing to detect potentially leaked credentials - : Keep the contents of the keys/ directory secure - : Make sure no credentials are hardcoded in any source files 1. Make sure the .env file is not included 2.

README

以下は原文 README の抜粋です。原文を見る。

Tesla MCP Server

A Model Context Protocol (MCP) server that connects to the Tesla Fleet API, allowing you to control your Tesla vehicle using Claude and other AI assistants that support MCP.

Features

  • Wake up vehicles: Wake up your Tesla from sleep mode
  • Vehicle information: Get detailed information about your Tesla vehicles
  • Real-time updates: Refresh vehicle data on demand
  • Debugging tools: Access detailed vehicle information to help with troubleshooting

Requirements

  • Node.js 18+
  • pnpm (preferred) or npm
  • Tesla account with at least one vehicle
  • Tesla API credentials (Client ID and Client Secret)
  • Ngrok (for development and registration)

Security Best Practices

This project handles sensitive Tesla API credentials. Please follow these security practices:

  • Never commit credentials: The .gitignore file excludes .env and keys/ but always double-check
  • Use the security checker: Run ./check-secrets.sh before committing to detect potentially leaked credentials
  • Protect your private keys: Keep the contents of the keys/ directory secure
  • Review code before sharing: Make sure no credentials are hardcoded in any source files

When forking or sharing this project:

  1. Make sure the .env file is not included
  2. Check that no private keys are committed
  3. Verify the .gitignore file is properly set up

Quick Start

  1. Clone the repository

    git clone https://github.com/yourusername/tesla-mcp.git
    cd tesla-mcp
    
  2. Install dependencies

    pnpm install
    
  3. Set up environment variables Create a .env file in the root directory:

    TESLA_CLIENT_ID=your_client_id
    TESLA_CLIENT_SECRET=your_client_secret
    TESLA_REFRESH_TOKEN=your_refresh_token
    
  4. Get a refresh token (if you don’t have one)

    pnpm get-token
    
  5. Register your application with Tesla’s API

    pnpm register
    

    Follow the instructions provided by the script

  6. Build the server

    pnpm build
    
  7. Run the server

    pnpm start
    

Authentication & Registration

This project uses the official Tesla Fleet API OAuth 2.0 authentication flow to securely connect to your Tesla account. The full process involves two steps:

  1. Authentication: Obtaining a refresh token through the OAuth 2.0 flow
  2. Registration: Registering your application with Tesla via the Partner Accounts API

Authentication

Authentication requires:

  • Client ID and Client Secret from the Tesla Developer Portal
  • A refresh token obtained through the OAuth 2.0 authorization code flow

The included pnpm get-token utility simplifies this process by:

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "tesla-mcp-server": { "command": "/absolute/path/to/tesla-mcp/run-mcp.js" } } }