Skip to main content
Glama
thachdoSC

Smartcar MCP Server

by thachdoSC

Smartcar MCP 服务器

一个 MCP (Model Context Protocol) 服务器,将 Smartcar 的车辆 API 作为工具公开给 AI 代理。使 Claude、ChatGPT 和其他兼容 MCP 的客户端能够使用自然语言查询车辆遥测数据并发送指令。

概览

此服务器使用 OAuth2 客户端凭据封装了 Smartcar 的 M2M(机器对机器)API。它会自动处理令牌获取和缓存,因此 AI 代理无需管理身份验证即可与车辆交互。

涵盖 4 个类别的 16 个工具:

类别

工具

连接

list_connections, get_connection, delete_connection, delete_user

信号(遥测)

get_signals, get_signal

车辆指令

lock_vehicle, unlock_vehicle, start_charge, stop_charge, set_charge_limit, set_navigation_destination

管理

list_applications, get_application, list_application_secrets

Related MCP server: agentforge

使用方法

无需安装。将其添加到您的 claude_desktop_config.json(或等效的 MCP 客户端配置)中:

{
  "mcpServers": {
    "smartcar": {
      "command": "npx",
      "args": ["-y", "smartcar-mcp"],
      "env": {
        "SMARTCAR_CLIENT_ID": "your-client-id",
        "SMARTCAR_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

环境变量

变量

必需

默认值

描述

SMARTCAR_CLIENT_ID

您的 Smartcar M2M 客户端 ID

SMARTCAR_CLIENT_SECRET

您的 Smartcar M2M 客户端密钥

SMARTCAR_API_URL

https://vehicle.api.smartcar.com/v3

车辆 API 基础 URL

SMARTCAR_AUTH_URL

https://iam.smartcar.com

身份验证令牌端点

SMARTCAR_MANAGEMENT_API_URL

https://management.api.smartcar.com/v3

管理 API 基础 URL

开发

git clone https://github.com/thachdoSC/smartcar-mcp-test
cd smartcar-mcp
npm install
npm run dev   # run from source
npm run build # compile to dist/

工具参考

连接

list_connections — 列出车辆连接,支持可选过滤器。

参数

类型

描述

userId

string?

按用户 ID 过滤

vehicleId

string?

按车辆 ID 过滤

vehicleMode

live

simulated?

按车辆模式过滤

pageNumber

number?

页码

pageSize

number?

每页结果数

get_connection — 通过 ID 获取单个连接。

delete_connection — 通过 ID 删除连接。

delete_user — 删除用户及所有关联数据。


信号(遥测)

get_signals — 列出车辆的所有可用信号。

参数

类型

描述

vehicle_id

string

车辆 ID

user_id

string

用户 ID

pageNumber

number?

页码

pageSize

number?

每页结果数

get_signal — 获取特定信号的当前值。

参数

类型

描述

vehicle_id

string

车辆 ID

user_id

string

用户 ID

signal_code

string

信号代码(见下文)

充电: charge.ischarging, charge.voltage, charge.wattage, charge.amperage, charge.limit, charge.estimation.durationtocompletion, charge.estimation.distance_added, charge.estimation.kwh_added, charge.estimation.percent_added, charge.session.id, charge.session.starttime, charge.session.endtime, charge.session.kwhadded, charge.session.milesadded, charge.session.porttype, charge.session.cost, charge.schedule.type, charge.schedule.starttime, charge.schedule.day, charge.schedule.enabled, charge.porttype, charge.portstatus

空调: climate.externaltemperature, climate.internaltemperature

闭合件: closure.door, closure.lock, closure.window, closure.sunroof, closure.fronttrunk, closure.reartrunk, closure.chargeport

连接性: connectivity.firmware, connectivity.isonline, connectivity.sleepstate, connectivity.lastseenat

诊断: diagnostics.faultcodes, diagnostics.oil, diagnostics.emissions, diagnostics.abs, diagnostics.airbag, diagnostics.battery.maintenancestatus, diagnostics.battery.range, diagnostics.battery.soc, diagnostics.brakebooster, diagnostics.brakefluid, diagnostics.collision, diagnostics.coolant, diagnostics.cruisecontrol, diagnostics.enginelight, diagnostics.hazardlights, diagnostics.headlights, diagnostics.park, diagnostics.stabilitycontrol, diagnostics.steeringlock, diagnostics.transmission, diagnostics.washerfluid

暖通空调 (HVAC): hvac.cabintemperature, hvac.defroster, hvac.heater, hvac.temperatureset, hvac.ventilation

内燃机 (ICE): ice.fuel.level, ice.fuel.range, ice.fuel.percentremaining, ice.oillife

位置: location.precise, location.ishome

低压电池: lowvoltagebattery.stateofcharge, lowvoltagebattery.status

运动: motion.speed

里程表: odometer.distance

服务: service.isinservice, service.records

监控: surveillance.brand, surveillance.isenabled

动力电池: tractionbattery.stateofcharge, tractionbattery.range, tractionbattery.heating, tractionbattery.capacity.kwh, tractionbattery.capacity.usableKwh, tractionbattery.limit, tractionbattery.temperature, tractionbattery.chargecompletiontime, tractionbattery.fullchargetime

变速箱: transmission.drivemode, transmission.gear

车辆 ID: vehicleid.vin, vehicleid.color, vehicleid.trim, vehicleid.packages, vehicleid.nickname

车辆用户账户: vehicleuseraccount.grantedpermissions, vehicleuseraccount.role

车轮: wheel.style, wheel.tires


车辆指令

所有指令工具都需要 vehicle_iduser_id

lock_vehicle — 锁定车门。

unlock_vehicle — 解锁车门。

start_charge — 开始电动汽车充电。

stop_charge — 停止电动汽车充电。

set_charge_limit — 设置最大充电电量。

参数

类型

描述

percent

number

目标充电百分比 (50–100)

set_navigation_destination — 将 GPS 目的地发送到车辆导航系统。

参数

类型

描述

latitude

number

纬度 (-90 到 90)

longitude

number

经度 (-180 到 180)


管理

list_applications — 列出组织中的所有 Smartcar 应用程序。

get_application — 获取特定应用程序的详细信息(按 ID)。

list_application_secrets — 列出应用程序的凭据(不返回密钥值)。

项目结构

src/
├── index.ts          # Server entry point — wires up tools and transport
├── auth.ts           # OAuth2 token manager with in-memory caching
├── client.ts         # HTTP client for Smartcar REST APIs
└── tools/
    ├── connections.ts # Connection and user management tools
    ├── signals.ts     # Vehicle telemetry tools
    ├── commands.ts    # Vehicle control command tools
    └── management.ts  # Application management tools

身份验证

服务器使用 OAuth2 客户端凭据(M2M 流程)。令牌缓存在内存中,并在过期前 60 秒自动刷新。无需手动管理令牌。

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    F
    maintenance
    MCP server that exposes 300+ AI agents as tools via a single API key. Supports listing agents, invoking any agent with chat-completion style messages, checking agent health, and retrieving platform statistics.
    5
    3
  • A
    license
    B
    quality
    C
    maintenance
    An MCP server that enables AI assistants to interact with the VoIPbin CPaaS platform, exposing tools for managing calls, flows, messaging, conferencing, and more.
    52
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    An MCP (Model Context Protocol) server that exposes Polestar 2 vehicle data to AI assistants like Claude. Query your car's battery status, vehicle info, and health data through natural conversation.
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thachdoSC/smartcar-mcp-test'

If you have feedback or need assistance with the MCP directory API, please join our Discord server