IT

iceener/tesla-streamable-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 4 forks 质量 59 趋势 12

MCP Server for interacting with Tesla (via Tessie API). Written in TypeScript, Node and Hono.dev

概览

Streamable HTTP MCP server for Tesla vehicle control via the Tessie API. this repository pins @modelcontextprotocol/server and the test-only @modelcontextprotocol/client to 2.0.0-beta.5, with Zod 4 and the candidate 2026-07-28 protocol. The dated protocol and stable v2 SDK are not final at this commit; do not claim final conformance until the release gate is verified. The Bun and Cloudflare Workers entry points share one fetch-native handler per deployment and create a fresh MCP server for every request. Modern HTTP is stateless; compatibility with 2025-era clients uses the SDK's stateless fallback and does not create MCP sessions. You connect this server to your MCP client at your own responsibility. Language models can make mistakes, misinterpret instructions, or perform unintended actions. Always verify commands before execution, especially for actions like unlocking, opening trunks, or sending navigation destinations.

README

以下为原文 README 节选,完整内容请查看原文。

Tesla MCP Server

Streamable HTTP MCP server for Tesla vehicle control via the Tessie API.

Release status (2026-07-27): this repository pins @modelcontextprotocol/server and the test-only @modelcontextprotocol/client to 2.0.0-beta.5, with Zod 4 and the candidate 2026-07-28 protocol. The dated protocol and stable v2 SDK are not final at this commit; do not claim final conformance until the release gate is verified.

The Bun and Cloudflare Workers entry points share one fetch-native handler per deployment and create a fresh MCP server for every request. Modern HTTP is stateless; compatibility with 2025-era clients uses the SDK’s stateless fallback and does not create MCP sessions.

Author: overment

[!WARNING] You connect this server to your MCP client at your own responsibility. Language models can make mistakes, misinterpret instructions, or perform unintended actions. Always verify commands before execution, especially for actions like unlocking, opening trunks, or sending navigation destinations.

The HTTP layer enforces bounded request bodies, exact Host and Origin allowlists, strict CORS, and static bearer authentication when enabled. A production deployment must still set its real HTTPS MCP_PUBLIC_URL and exact allowlists, protect secrets, and provide appropriate rate limiting and audit controls.

Notice

This repo works in two ways:

  • As a fetch-native Bun server for local workflows
  • As a fetch-native Cloudflare Worker for remote interactions

Features

  • ✅ State — Battery, range, location, climate, doors, charging status
  • ✅ Commands — Lock/unlock, climate, trunks, sentry, navigation
  • ✅ Location-aware — GPS coordinates for context-aware interactions
  • ✅ Dual Runtime — Node.js/Bun or Cloudflare Workers

Design Principles

  • LLM-friendly: Two unified tools, not 1:1 API mirrors
  • Watch-ready: Designed for AI agents with location context
  • Secure: Tessie API key stored as secret, clients use separate bearer token
  • Clear feedback: Detailed command results and vehicle state

Installation

Prerequisites: Bun, Tessie Account.

Ways to Run (Pick One)

  1. Local Development — Standard setup with bearer token auth
  2. Cloudflare Worker (wrangler dev) — Local Worker testing
  3. Cloudflare Worker (deploy) — Remote production

1. Local Development — Quick Start

  1. Get Tessie credentials:

    • Visit developer.tessie.com
    • Go to Developer Settings → Generate Access Token
    • Copy your access token
    • Note your vehicle’s VIN
  2. Configure environment:

cd tesla-mcp
bun install
cp .env.example .env

Edit .env:

PORT=3000
AUTH_ENABLED=true
AUTH_STRATEGY=bearer

# Generate with: openssl rand -hex 32
BEARER_TOKEN=your-random-auth-token

# Tessie credentials
在 GitHub 查看完整 README

安装

npx mcp-remote http://localhost:3000/mcp --transport http-only
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "tesla": { "command": "npx", "args": ["mcp-remote", "http://localhost:3000/mcp", "--transport", "http-only"], "env": { "NO_PROXY": "127.0.0.1,localhost" } } } }