Token导航 LogoToken导航TokenDH.com
Tesla Streamable MCP Server logo
运维云端未说明官方级别未说明来源级核验

Tesla Streamable MCP Server

MCP Server

一个基于Tessie API的可流式HTTP MCP服务器,用于远程控制和监控特斯拉车辆状态,支持本地和云端部署。

工具数

0

提示词数

0

GitHub Stars

11

资源数

0
TypeScriptClaude云端部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

iceener

提供方

iceener

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

特斯拉MCP服务器

用于特斯拉车辆控制的流式HTTP MCP服务器 德西API.

作者 过度

\[!警告\] 您自行负责将此服务器连接到MCP客户端。语言模型可能会出错、误解指令或执行意外操作。在执行命令之前,请务必验证命令,特别是对于解锁、打开行李箱或发送导航目的地等操作。 HTTP层的设计是为了开发过程中的便利性,而不是生产级的安全性。如果远程部署,请加强它:适当的令牌验证、安全存储、TLS终止、严格的CORS/源代码检查、速率限制和审计日志记录。

通知

此repo以两种方式工作:

  • 作为一个 节点/HONO服务器 用于本地工作流
  • 作为一个 Cloudflare工作人员 用于远程交互

特性

  • 状态 --电池、续航里程、位置、气候、车门、充电状态
  • 命令 --锁定/解锁、气候、行李箱、哨兵、导航
  • 感知 --用于上下文感知交互的GPS坐标
  • 双运行时 --Node.js/Bun或Cloudflare Workers

设计原则

  • LLM友好:两个统一的工具,而不是1:1 API镜像
  • 准备观看:专为具有位置上下文的AI代理而设计
  • 安全:Tessie API密钥存储为机密,客户端使用单独的承载令牌
  • 清晰的反馈:详细的指挥结果和车辆状态

______________________________________________________________________

安装

先决条件: 包子, Tessie帐户.

跑步方式(选一种)

  1. 地方发展 --带有承载令牌身份验证的标准设置
  2. Cloudflare Worker(牧者开发) --本地工人测试
  3. Cloudflare Worker(部署) --远程生产

______________________________________________________________________

1.地方发展——快速起步

  1. 获取Tessie凭据:

- 访问 developer.tessie.com - 首选 开发人员设置生成访问令牌 - 复制您的访问令牌 - 记下车辆的VIN

  1. 配置环境:
cd tesla-mcp
bun install
cp .env.example .env

编辑 .env:

PORT=3000
AUTH_ENABLED=true
AUTH_STRATEGY=bearer

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

# Tessie credentials
TESSIE_ACCESS_TOKEN=your-tessie-access-token
TESSIE_VIN=your-vehicle-vin
  1. 运行:
bun dev
# MCP: http://127.0.0.1:3000/mcp

克劳德桌面/光标:

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

______________________________________________________________________

2.Cloudflare Worker(本地开发人员)

bun x wrangler dev --local | cat

创建 .dev.vars 关于地方秘密:

BEARER_TOKEN=your_random_auth_token
TESSIE_ACCESS_TOKEN=your_tessie_token
TESSIE_VIN=your_vehicle_vin

端点: http://127.0.0.1:8787/mcp

______________________________________________________________________

3.Cloudflare Worker(部署)

  1. 为会话存储创建KV命名空间:
bun x wrangler kv:namespace create TOKENS

输出将显示:

Add the following to your wrangler.toml:
[[kv_namespaces]]
binding = "TOKENS"
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  1. 更新 wrangler.toml 使用您的KV命名空间ID:
[[kv_namespaces]]
binding = "TOKENS"
id = "your-kv-namespace-id-from-step-1"
  1. 设置秘密:
# Generate a random token for client authentication
openssl rand -hex 32
bun x wrangler secret put BEARER_TOKEN
# Paste the generated token when prompted

# Tessie API credentials
bun x wrangler secret put TESSIE_ACCESS_TOKEN
# Paste your Tessie token when prompted

bun x wrangler secret put TESSIE_VIN
# Paste your VIN when prompted
  1. 部署:
bun x wrangler deploy

端点: https://..workers.dev/mcp

______________________________________________________________________

客户端配置

爱丽丝应用程序

添加为MCP服务器:

  • 网址: https://your-worker.workers.dev/mcp
  • 类型: streamable-http
  • 头球 Authorization: Bearer

克劳德桌面/光标(本地服务器)

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

克劳德桌面/光标(Cloudflare Worker)

{
  "mcpServers": {
    "tesla": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-worker.workers.dev/mcp", "--transport", "http-only"]
    }
  }
}

MCP检查员(快速测试)

bunx @modelcontextprotocol/inspector
# Connect to: http://localhost:3000/mcp (local) or https://your-worker.workers.dev/mcp (remote)

______________________________________________________________________

工具

tesla_state

获取您的特斯拉汽车的当前状态。

// Input
{}

// Output
{
  display_name: string;           // Vehicle name
  battery_level: number;          // 0-100%
  battery_range_km: number;       // Estimated range in km
  charging: {
    state: string;                // "Disconnected", "Charging", "Complete", "Stopped"
    minutes_remaining: number | null;
    charge_limit: number;         // Charge limit %
  };
  location: {
    latitude: number;
    longitude: number;
    heading: number;              // 0-359°
    speed: number | null;         // km/h or null if parked
  };
  locked: boolean;
  sentry_mode: boolean;
  climate: {
    is_on: boolean;
    inside_temp: number;          // °C
    outside_temp: number;         // °C
    target_temp: number;          // °C
    is_defrosting: boolean;
  };
  doors: {
    front_left: boolean;          // true = open
    front_right: boolean;
    rear_left: boolean;
    rear_right: boolean;
    frunk: boolean;
    trunk: boolean;
    charge_port: boolean;
  };
  state: "online" | "asleep" | "offline";
  odometer_km: number;
  last_updated: string;           // ISO 8601
}

tesla_command

在您的特斯拉汽车上执行命令。

// Input
{
  command: "lock" | "unlock" | "start_climate" | "stop_climate" |
           "set_temperature" | "start_defrost" | "stop_defrost" |
           "open_frunk" | "open_trunk" | "open_charge_port" |
           "close_charge_port" | "enable_sentry" | "disable_sentry" |
           "flash" | "honk" | "share";
  temperature?: number;           // Required for set_temperature (15-28°C)
  destination?: string;           // Required for share
  locale?: string;                // Optional for share (e.g., "en-US")
}

// Output
{
  success: boolean;
  command: string;
  message: string;
}

命令参考:

命令描述参数
lock锁定车辆--
unlock解锁车辆--
start_climate启动气候控制--
stop_climate停止气候控制--
set_temperature设置机舱温度temperature (15-28摄氏度)
start_defrost打开最大除霜--
stop_defrost关闭除霜功能--
open_frunk打开前行李箱--
open_trunk切换后行李箱--
open_charge_port打开充电口门--
close_charge_port关闭装料口门--
enable_sentry启用哨兵模式--
disable_sentry禁用哨兵模式--
flash闪光--
honk按喇叭--
share将目的地发送到导航destination, locale?

______________________________________________________________________

例子

1.获取车辆状态

{
  "name": "tesla_state",
  "arguments": {}
}

2.锁好车

{
  "name": "tesla_command",
  "arguments": {
    "command": "lock"
  }
}

3.将温度设置为22°C

{
  "name": "tesla_command",
  "arguments": {
    "command": "set_temperature",
    "temperature": 22
  }
}

4.出发前先开始气候

{
  "name": "tesla_command",
  "arguments": {
    "command": "start_climate"
  }
}

5.导航到目的地

{
  "name": "tesla_command",
  "arguments": {
    "command": "share",
    "destination": "Golden Gate Bridge, San Francisco"
  }
}

______________________________________________________________________

身份验证流程

┌─────────────────────────────────────────────────────────────────┐
│  Client (Alice App, Claude Desktop)                             │
│      │                                                          │
│      │ Authorization: Bearer                      │
│      ▼                                                          │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Cloudflare Worker / Node.js Server                      │   │
│  │                                                          │   │
│  │  1. Validate BEARER_TOKEN (client auth)                  │   │
│  │  2. Use TESSIE_ACCESS_TOKEN (internal API key)           │   │
│  │                                                          │   │
│  │  env.TESSIE_ACCESS_TOKEN ──┐                             │   │
│  │  env.TESSIE_VIN ───────────┼──► TessieClient             │   │
│  │                            │         │                   │   │
│  │                            │         ▼                   │   │
│  │                            │   api.tessie.com            │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘

要点:

  • BEARER_TOKEN:您生成的随机令牌--对MCP服务器的客户端进行身份验证
  • TESSIE_ACCESS_TOKEN:您的Tessie API密钥-服务器内部使用
  • 客户永远看不到你的Tessie凭据

______________________________________________________________________

HTTP端点

端点方法目的
/mcp发布MCP JSON-RPC 2.0
/healthGET健康检查

______________________________________________________________________

发展

bun dev           # Start with hot reload
bun run typecheck # TypeScript check
bun run lint      # Lint code
bun run build     # Production build
bun start         # Run production

______________________________________________________________________

建筑

src/
├── shared/
│   └── tools/
│       ├── tesla-state.ts      # Get vehicle state
│       └── tesla-command.ts    # Execute commands
├── services/
│   └── tessie.service.ts       # Tessie API client
├── schemas/
│   ├── commands.ts             # Command definitions
│   ├── outputs.ts              # Tool output schemas
│   └── tessie.ts               # Tessie API response schemas
├── config/
│   └── metadata.ts             # Server & tool descriptions
├── index.ts                    # Node.js entry
└── worker.ts                   # Workers entry

______________________________________________________________________

环境变量

Node.js(.env)

变量必填描述
TESSIE_ACCESS_TOKENTessie API访问令牌
TESSIE_VIN特斯拉车辆VIN
BEARER_TOKENMCP客户端的认证令牌
PORT服务器端口(默认值:3000)
HOST服务器主机(默认值:127.0.0.1)
AUTH_ENABLED启用身份验证(默认值:true)
AUTH_STRATEGYbearer (默认)

Cloudflare Workers(wrangler.toml+机密)

牧马人。汤姆瓦尔斯:

AUTH_ENABLED = "true"
AUTH_STRATEGY = "bearer"

秘密(通过设置 wrangler secret put):

  • BEARER_TOKEN --客户端的随机身份验证令牌
  • TESSIE_ACCESS_TOKEN -Tessie API访问令牌
  • TESSIE_VIN --您车辆的VIN

KV命名空间:

[[kv_namespaces]]
binding = "TOKENS"
id = "your-kv-namespace-id"

______________________________________________________________________

故障排除

问题解决方案
401未经授权检查 BEARER_TOKEN 已设置,客户端发送 Authorization: Bearer
“TESSIE_ACCESS_TOKEN未配置”设置密码: wrangler secret put TESSIE_ACCESS_TOKEN
“TESSIE_VIN未配置”设置密码: wrangler secret put TESSIE_VIN
“Tessie API错误”验证 TESSIE_ACCESS_TOKEN 在developer.tessie.com上有效
未找到车辆检查 TESSIE_VIN 正确(17个字符)
车辆离线车辆可能处于深度睡眠状态。命令将唤醒它(大约需要30秒)
命令超时Tessie等待车辆唤醒的时间长达90秒。再试一次。
KV命名空间错误运行 wrangler kv:namespace create TOKENS 并更新wrangler.toml
“ReadableStream未定义”Node.js版本太旧(需要18+)。使用新节点的完整路径。
“spawn bunx ENOENT”克劳德桌面找不到 bunx.使用 npx 相反。

调试

MCP检验员测试:

bunx @modelcontextprotocol/inspector
# Connect to your endpoint and test tools

检查Worker日志:

wrangler tail

______________________________________________________________________

许可证

麻省理工学院

目录标签

目录标签

TypeScriptClaude云端部署车辆控制本地部署远程监控特斯拉APIHTTP服务器

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP