Nhtsa Vehicle Safety Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.11.0更新于 Nov 4, 2026

Decode VINs, search recalls, complaints, crash ratings, and investigations.

已验证Streamable HTTP可网页运行位置与生活数据与分析

概览

AI 生成的概览

提供美国 NHTSA 车辆安全数据,让助手能解析 VIN,并查询召回、投诉、碰撞评级和缺陷调查。

可以做什么
  • 解析 VIN,获取品牌、车型、年份、发动机、安全装备与驾驶辅助功能
  • 按召回编号、车辆或品牌/车型/年款及接收日期检索召回活动
  • 检索消费者投诉,含部件分类统计以及碰撞、起火、受伤和死亡数量
  • 获取 NCAP 碰撞测试星级与 ADAS 功能配备情况
  • 检索 NHTSA 缺陷调查,或按编号获取单条调查
  • 查询品牌、车型、车辆类型和制造商,以及各数据集使用的车型名称
适用场景
适合回答某款车是否安全、召回历史、常见车主投诉、碰撞测试星级或未结缺陷调查等问题,也适合解析 VIN 或跨车型比较安全配置。
运行要求
可使用公开托管的 Streamable HTTP 端点(无需安装),或通过 npx、bunx、Docker 在本地运行。本地运行需要 Bun 1.4.0 以上或 Node.js 24 以上。无需 API 密钥或账号,NHTSA 数据均为公开。可选环境变量用于配置传输方式、HTTP 主机/端口/路径、认证模式、会话模式、日志级别和数量上限处理。
安装前请注意
仅对公开 NHTSA 数据做只读查询,不索取凭据,也不写回任何数据。结果可能不完整或有歧义:NHTSA 会把同一车辆登记在不同车型名称下,2011 年之前的 NCAP 覆盖较少,部分数据源故障会通过分区状态和警告体现,而非显示为无问题记录。可选的失败载荷日志会记录工具参数和结果,自由文本中的密钥不会被脱敏。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Nhtsa Vehicle Safety Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Fnhtsa-vehicle-safety-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "nhtsa-vehicle-safety": {
      "type": "http",
      "url": "https://nhtsa.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/nhtsa-vehicle-safety-mcp-server

Decode VINs, search recalls, complaints, crash ratings, and investigations via MCP. STDIO or Streamable HTTP.

7 Tools

Public Hosted Server: https://nhtsa.caseyjhand.com/mcp


Overview

Vehicle safety data from NHTSA: recalls, consumer complaints, NCAP crash ratings, defect investigations, and VIN decoding. Get a full safety picture for any make, model, and year in one call, or decode a VIN.

Tools

ToolDescription
nhtsa_get_vehicle_safetyComprehensive safety profile combining crash test ratings, recalls, and complaint summary with per-section availability status.
nhtsa_search_recallsSearch recall campaigns by campaign number, by vehicle, or across all campaigns by make, model, model year, and received date.
nhtsa_search_complaintsConsumer safety complaints with component breakdown and severity stats.
nhtsa_get_safety_ratingsNCAP crash test ratings and ADAS feature availability.
nhtsa_decode_vinDecode VINs for make, model, year, engine, safety equipment, and driver-assistance features (50 decoded per call).
nhtsa_search_investigationsSearch NHTSA defect investigations (PE, EA, DP, RQ, AQ, and more), newest opened first.
nhtsa_lookup_vehiclesLook up makes, models, vehicle types, and manufacturer details from VPIC, and the model names NHTSA's datasets file a vehicle under.

Capability reference

nhtsa_get_vehicle_safety tool

  • Combines NCAP crash test ratings, recall history, and complaint summary in a single response
  • Frontal crash, side crash, and rollover ratings per vehicle variant
  • Recall consequence text plus the do-not-drive, park-outside, and over-the-air-update advisories; summary, consequence, and remedy are omitted for older campaigns whose record leaves them blank
  • Complaint breakdown by component with crash, fire, injury, and death counts
  • Returns sectionStatus (available/partial/unavailable per section) plus warnings so a partial NHTSA outage is not mistaken for a clean record
  • When recalls or complaints come back empty, a notice points at nhtsa_lookup_vehicles with operation="dataset_models", because NHTSA can file one vehicle under different model names in each dataset

nhtsa_search_recalls tool

  • Three modes: campaignNumber; make + model + modelYear together; or a broad search with any other combination of make, model, modelYear, and dateRange. campaignNumber is mutually exclusive with the vehicle fields
  • Campaign lookups return every make/model the campaign covers, plus the ODI investigation that preceded it; a 6-character number (e.g., 00V419) returns every campaign it covers
  • Broad search returns campaigns newest received date first with an exact totalCount, up to 50 per page (default 20) with limit and offset, and a larger limit is lowered to 50 with a notice; both are rejected with the other two modes. A campaign matches when one of its vehicle records carries every vehicle filter, compared against whole make and model names, ignoring case
  • NHTSA may file a vehicle's recalls under a series name or a base name; search both. A broad search's received date can fall one day before the date the other modes report for the same campaign
  • Optional inclusive dateRange bounds (after/before, calendar-valid YYYY-MM-DD) apply in every mode; blank bounds are unset
  • Includes do-not-drive advisories, park-outside warnings, and OTA update availability (never set by a broad search)

nhtsa_search_complaints tool

  • Component breakdown covers every matching complaint regardless of pagination; up to 50 complaint narratives per page (default 20), offset pagination, sorted by filing date descending. A larger limit is lowered to 50 with a notice naming the next offset (see NHTSA_CLAMP_LIMITS)
  • Optional component filter matches case-insensitively within each component name a complaint lists (e.g., "ENGINE", "AIR BAGS"); component names can themselves contain ", " (e.g., "SERVICE BRAKES, HYDRAULIC")
  • Every component line includes crash, fire, injury, and death totals, including zeros; individual complaints preserve fields NHTSA actually reported
  • An incident date NHTSA reported that the complaint's own filing date or model year rules out is disclosed as unreliableIncidentDate rather than served as the incident date

nhtsa_get_safety_ratings tool

  • Accepts either make + model + modelYear, or a follow-up vehicleId from an earlier result; combining the modes is rejected
  • Frontal crash, side crash (barrier + pole), and rollover ratings, plus ESC/forward-collision/lane-departure ADAS availability
  • Per-record complaint, recall, and investigation counts are variant-scoped — not vehicle-level totals
  • NCAP coverage starts at 1990, most complete for 2011+ model years

nhtsa_decode_vin tool

  • One VIN, or several in an array or in one string separated by spaces, semicolons, or commas; partial VINs accepted using * for unknown positions, each as its own entry
  • A call decodes up to 50 VINs and accepts up to 500; the rest come back in deferredVins to pass back as vin. VIN,YYYY gives one VIN its own model year; optional modelYear covers the others
  • A blank entry, a character other than a letter, digit, or *, or a VIN over 17 characters is rejected before decoding (empty_vin_list, invalid_vin)
  • Safety equipment includes VPIC's driver-assistance features (automatic emergency braking, lane keeping, blind spot warning, backup camera, adaptive cruise control, and others); Optional means the configuration offers the feature, not that this vehicle has it
  • Preserves sparse VPIC fields instead of filling missing data with placeholders; every result carries VPIC's own errorCode/errorText decode-quality signal, including the clean "0" case

nhtsa_search_investigations tool

  • Investigation types: Preliminary Evaluations (PE), Engineering Analyses (EA), Defect Petitions (DP), Recall Queries (RQ), Audit Queries (AQ), and additional ODI codes (SQ, EQ, RP, and others)
  • Free-text search across investigation IDs, subjects, and summaries, plus structured make, model, modelYear, and component filters — all ANDed. make, model, and modelYear must all match the same vehicle association; an investigation with no model year never matches a modelYear
  • Results are ordered newest-opened first. Rows list every linked manufacturers and recallCampaigns entry
  • Search rows omit summary; set includeSummary: true to include it, or fetch one record with nhtsaId, which always returns it
  • Inclusive openDateRange and closeDateRange bounds (after/before, calendar-valid YYYY-MM-DD) filter before counting and pagination; active bounds exclude records without the corresponding usable date
  • nhtsaId fetches one investigation by its exact ID, mutually exclusive with the other filters — the reverse of the recall link, closing the campaign-to-investigation round trip
  • Sourced from NHTSA's ODI bulk file (FLAT_INV.zip), loaded on first use and cached for 24 hours
  • Up to 50 investigations per page (default 20), offset pagination; a larger limit is lowered to 50 with a notice

nhtsa_lookup_vehicles tool

  • Five operations: makes, models, vehicle_types, manufacturer, dataset_models — models, vehicle_types, and manufacturer match partial names
  • dataset_models (requires make and modelYear) lists the model names NHTSA's complaint, NCAP, and VPIC lists carry, each tagged listedBy products, ncap, or vpic. It takes the full make name (e.g., "Chevrolet"). Use it when a recall, complaint, or rating search comes back empty, then search under each name
  • models can be filtered by year; models and vehicle_types both require make
  • Each operation rejects inactive filters: makes accepts none, models and dataset_models accept make/modelYear, vehicle_types accepts make, and manufacturer accepts manufacturer. Optional blank strings are unset; operation-required make/manufacturer names must be nonblank
  • Up to 200 results per page (default 100), offset pagination; a larger limit is lowered to 200 with a notice
  • manufacturer lookups stop at a 500-record ceiling and disclose truncated when more may exist — VPIC publishes no match total

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

NHTSA-specific:

  • Type-safe client wrapping four NHTSA JSON APIs with retry logic and sparse-field normalization, plus a streaming parser for NHTSA's investigation and recall bulk files
  • Investigation and recall indexes cached for 24 hours; the bulk files load one at a time, and each load (waiting its turn, downloading, and parsing; both recall files count as one load) must finish within 120 s
  • Published nhtsa-vehicle-safety-guide skill (skill://nhtsa-vehicle-safety-guide/SKILL.md) with the identifier chains and gates for merging results across model names, make versus manufacturer, model year versus received date, and what an empty or Not Rated result proves
  • No API key required — all NHTSA APIs are public

Agent-friendly output:

  • Provenance: every tool echoes effectiveQuery in its enrichment block, so callers can verify exactly what was searched
  • Graceful partial failure: nhtsa_get_vehicle_safety returns sectionStatus per section plus warnings, so a partial NHTSA outage isn't mistaken for a clean safety record
  • Discriminated outputs: unreliableIncidentDate (complaints), VIN decode errorCode/errorText, and manufacturer-lookup truncated disclose data-quality limits rather than silently omitting or fabricating values

Getting started

Public Hosted Instance

A public instance is available at https://nhtsa.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{  "mcpServers": {    "nhtsa-vehicle-safety-mcp-server": {      "type": "streamable-http",      "url": "https://nhtsa.caseyjhand.com/mcp"    }  }}

Self-Hosted / Local

Add the following to your MCP client configuration file:

json
{  "mcpServers": {    "nhtsa-vehicle-safety-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/nhtsa-vehicle-safety-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "nhtsa-vehicle-safety-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/nhtsa-vehicle-safety-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "nhtsa-vehicle-safety-mcp-server": {      "type": "stdio",      "command": "docker",      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/nhtsa-vehicle-safety-mcp-server:latest"]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/nhtsa-vehicle-safety-mcp-server.git
  1. Navigate into the directory:
sh
cd nhtsa-vehicle-safety-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment (optional):
sh
cp .env.example .env# edit .env to override transport, auth, or storage defaults — no API key required

Configuration

No API keys required — all NHTSA APIs are public.

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_HOSTHTTP server host.127.0.0.1
MCP_HTTP_PORTHTTP server port.3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path./mcp
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_SESSION_MODEHTTP session posture: auto, stateful, or stateless. The server declares stateless in code — it keeps no per-session state — and this variable overrides that.stateless
NHTSA_CLAMP_LIMITSLower an over-maximum limit to its maximum, and decode the first 50 VINs of a larger nhtsa_decode_vin batch with the rest returned in deferredVins, disclosing either in a notice. false rejects the request instead (limit_too_large, batch_too_large). An invalid value fails startup.true
MCP_LOG_LEVELLog level (RFC 5424).info
LOG_TOOL_FAILURE_PAYLOADSLog each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted.false
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker build -t nhtsa-vehicle-safety-mcp-server .docker run --rm -p 3010:3010 nhtsa-vehicle-safety-mcp-server

The Dockerfile defaults to HTTP transport and logs to /var/log/nhtsa-vehicle-safety-mcp-server; it restates the stateless session mode the server already declares. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools and inits the NHTSA service.
src/config/Server configuration parsed from the environment (NHTSA_CLAMP_LIMITS).
src/mcp-server/tools/definitions/Tool definitions (*.tool.ts).
src/mcp-server/tools/request-cap.tsPage-size and VIN-batch caps shared by the tools.
src/services/nhtsa/NHTSA API client, bulk-file loader, investigation and recall indexes, and field normalization.
skills/Published nhtsa-vehicle-safety-guide skill, served over MCP and shipped in the npm package and Docker image.
tests/Unit and integration tests mirroring src/.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging
  • One tool per file, nhtsa_ prefix for every tool name, registered in createApp()
  • Validate raw NHTSA responses → normalize to domain types → return the output schema; never fabricate a field NHTSA didn't provide

Data sources

All data comes from NHTSA's public APIs and bulk files:

  • Recalls API — api.nhtsa.gov/recalls
  • Complaints API — api.nhtsa.gov/complaints; dataset_models also reads its model-name list at api.nhtsa.gov/products/vehicle/models
  • Safety Ratings API — api.nhtsa.gov/SafetyRatings
  • Investigations bulk file — static.nhtsa.gov/odi/ffdd/inv/FLAT_INV.zip
  • Recall bulk files — static.nhtsa.gov/odi/ffdd/rcl/FLAT_RCL_POST_2010.zip and FLAT_RCL_PRE_2010.zip, used by broad nhtsa_search_recalls searches
  • VPIC API — vpic.nhtsa.dot.gov/api/vehicles

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 03b7683

工具

7

nhtsa_get_vehicle_safety

Nhtsa Get Vehicle Safety

Get a comprehensive safety profile for a vehicle. Combines NCAP crash test ratings, recalls, and complaint summary into a single response. Use as the default when asked about vehicle safety, reliability, or purchase decisions.

输入参数make必填model必填modelYear必填

nhtsa_search_recalls

Nhtsa Search Recalls

Search recall campaigns by campaign number, by vehicle, or across every campaign by make, model, model year, and received date. campaignNumber returns that campaign with every vehicle it covers; make, model, and modelYear together return that vehicle's recalls; any other combination of make, model, modelYear, and dateRange is a broad search of NHTSA's recall files, newest first, paged with limit and offset. A broad search matches a campaign when one of its vehicle records carries every vehicle filter given, and the received date it reports can fall one day before the date the other modes report for the same campaign.

输入参数makelimitmodeloffsetdateRangemodelYearcampaignNumber

nhtsa_search_complaints

Nhtsa Search Complaints

Search consumer safety complaints filed with NHTSA for a specific vehicle. Returns a component breakdown over all matching complaints plus a paginated slice of the most recent complaints. Use for common problems, failure patterns, or owner-reported issues.

输入参数make必填limitmodel必填offsetcomponentmodelYear必填

nhtsa_get_safety_ratings

Nhtsa Get Safety Ratings

Get NCAP crash test ratings and ADAS feature availability for a vehicle. Use when the user specifically wants crash test stars, rollover risk, or wants to compare safety features across vehicles. NCAP data available from 1990+, best coverage for 2011+.

输入参数makemodelmodelYearvehicleId

nhtsa_decode_vin

Nhtsa Decode Vin

Decode Vehicle Identification Numbers to extract make, model, year, body type, engine, manufacturing details, and safety equipment: airbags, stability and braking systems, tire pressure monitoring, and the driver-assistance features VPIC records for the configuration, such as automatic emergency braking, lane keeping, blind spot warning, backup camera, and adaptive cruise control. Pass one VIN, or several as an array or in one string separated by spaces, semicolons, or commas. Partial VINs are accepted, with * for unknown positions; send each partial VIN as its own string or array entry. A call decodes up to 50 VINs; VINs past the first 50 come back in deferredVins to pass back as vin.

输入参数vin必填modelYear

nhtsa_search_investigations

Nhtsa Search Investigations

Search NHTSA defect investigations — Preliminary Evaluations (PE), Engineering Analyses (EA), Defect Petitions (DP), Recall Queries (RQ), Audit Queries (AQ), and additional ODI types — newest-opened first. make, model, and modelYear match the investigation's vehicle associations, all on the same association; component matches its affected components. All filters are ANDed. Search rows leave out the full summary unless includeSummary is true. Use nhtsaId to fetch one investigation by its exact ID with its full summary — including the investigationId nhtsa_search_recalls returns for a campaign. recallCampaigns lists the recall campaigns NHTSA links to an investigation; pass any to nhtsa_search_recalls as campaignNumber.

输入参数makelimitmodelqueryoffsetstatusnhtsaIdcomponentmodelYearopenDateRangecloseDateRangeincludeSummary另有 1 个

nhtsa_lookup_vehicles

Nhtsa Lookup Vehicles

Look up makes, models, vehicle types, and manufacturer details in NHTSA's VPIC catalog, or list the model names NHTSA's datasets file a make and model year under. VPIC names often differ from the names complaints and NCAP ratings use (Silverado vs SILVERADO 1500), and a vehicle's recalls can be split between a series name and a base name. When a recall, complaint, or rating search comes back empty or partial, call operation="dataset_models" with make and modelYear, then search under each name it lists. No list enumerates recall names, so search recalls under both the series name and the base name.

输入参数makelimitoffsetmodelYearoperation必填manufacturer

版本历史

5
  1. v0.11.0最新Nov 4, 2026
  2. v0.10.0Oct 18, 2026
  3. v0.9.7Oct 9, 2026
  4. v0.9.6Sep 20, 2026
  5. v0.9.5Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分