
scald/tesla-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
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
.gitignorefile excludes.envandkeys/but always double-check - Use the security checker: Run
./check-secrets.shbefore 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:
- Make sure the
.envfile is not included - Check that no private keys are committed
- Verify the
.gitignorefile is properly set up
Quick Start
-
Clone the repository
git clone https://github.com/yourusername/tesla-mcp.git cd tesla-mcp -
Install dependencies
pnpm install -
Set up environment variables Create a
.envfile in the root directory:TESLA_CLIENT_ID=your_client_id TESLA_CLIENT_SECRET=your_client_secret TESLA_REFRESH_TOKEN=your_refresh_token -
Get a refresh token (if you don’t have one)
pnpm get-token -
Register your application with Tesla’s API
pnpm registerFollow the instructions provided by the script
-
Build the server
pnpm build -
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:
- Authentication: Obtaining a refresh token through the OAuth 2.0 flow
- 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:
インストール
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"
}
}
}