Token导航 LogoToken导航TokenDH.com
Nhtsa MCP logo
安全风控stdio官方级别未说明来源级核验

Nhtsa MCP

MCP Server

NHTSA MCP服务器提供对NHTSA API的结构化访问,涵盖车辆识别、安全评级、召回、消费者投诉、制造商和车型数据、零件以及汽车座椅检查站。

工具数

20

提示词数

0

GitHub Stars

4

资源数

0
PythonClaude安全Claude DesktopClaude

安装说明

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

作者 / 组织

Christophertdoc

提供方

Christophertdoc

最后核验

2026/5/17 20:19

运行时

Python

快速接入

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

命令预览

uv run uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

详细介绍

NHTSA MCP服务器

MCP(模型上下文协议)服务器,提供对NHTSA(国家公路交通安全管理局)API的结构化访问,涵盖车辆识别(VIN/WMI解码)、安全评级、召回、消费者投诉、制造商和型号数据、零件和汽车座椅检查站。

Demo

特性

  • 20个MCP工具,覆盖5个NHTSA API表面+全vPIC端点覆盖
  • 严格的Pydantic v2输入验证
  • 每个域的内存TTL缓存
  • 每IP滑动窗口速率限制
  • HTTP/SSE和stdio MCP传输
  • Typer CLI测试线束
  • LLM工具调用代理(Anthropic/OpenAI)

MCP工具

工具说明
decode_vin_tool通过vPIC解码17个字符的VIN
ratings_search_tool按年份/品牌/型号搜索NCAP安全评级
ratings_by_vehicle_id_tool获取NHTSA车辆ID的详细评级
recalls_by_vehicle_tool按年份/品牌/型号搜索召回
recalls_by_campaign_number_tool按活动编号查找召回
complaints_by_vehicle_tool按年份/品牌/型号搜索投诉
complaints_by_odi_number_tool通过ODI号码查找投诉
carseat_stations_by_zip_tool按邮政编码查找汽车座椅检查站
carseat_stations_by_state_tool按州代码查找车站
carseat_stations_by_geo_tool按纬度/长度/半径查找车站
decode_wmi_tool解码世界制造商标识符(WMI)
decode_vin_batch_tool在一个请求中批量解码多达50个VIN
get_all_makes_tool列出在NHTSA注册的所有车辆品牌
get_makes_tool按制造商、车辆类型和/或年份获取品牌
get_manufacturers_tool查找制造商、详细信息或WMI
get_models_tool获取某个品牌的型号,可选择按年份/类型筛选
get_vehicle_types_tool获取某品牌的车型
get_vehicle_variables_tool列出VIN解码变量或获取变量值
get_parts_tool按日期范围搜索NHTSA零件(轮胎/轮辋)
get_equipment_plant_codes_tool按年份和类型获取设备工厂代码

快速开始

# Install uv (if needed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync --extra dev
cp .env.example .env  # edit to add API keys if using LLM agent

# Start the server
uv run uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

# Begin chat session.
uv run nhtsa-cli agent chat   # interactive REPL session

# Health check
curl http://127.0.0.1:8000/health

# MCP stdio transport (for Claude Desktop)
uv run nhtsa-mcp --transport stdio

聊天会话

与NHTSA数据交互的主要方式是通过交互式聊天会话。它将您连接到LLM代理,该代理可以访问所有MCP工具,并可以用自然语言回答有关车辆识别、安全、召回、投诉、制造商、型号等问题。

uv run nhtsa-cli agent chat

这打开了一个 >>> 提示您可以在哪里提问。代理将自动调用正确的NHTSA工具,组合来自多个来源的数据,并以摘要进行响应。您的对话历史记录会保存在同一会话中的问题中,因此您可以提出后续问题。

示例问题:

>>> Decode VIN 4S4BL86C764213492 and tell me if there are any recalls for the vehicle
>>> Are there any recalls on a 2021 Ford Mustang?
>>> What are the crash test ratings for a 2023 Toyota Camry?
>>> What models does Honda make?
>>> Show me complaints for a 2012 Toyota Corolla
>>> Find car seat inspection stations near ZIP 63640
>>> Find rim manufacturers that registered parts between 3/1/2023 and 12/31/2023. Show me just the first result.

退出聊天: 类型 exitquit 在提示下,或按 Ctrl+C.

您还可以在不进入互动环节的情况下提出一个一次性问题:

uv run nhtsa-cli agent ask "What are the safety ratings for a 2020 Toyota Camry?"

其他CLI命令

# Run a preset demo of the agent
uv run nhtsa-cli agent demo

# Direct tool commands (requires running server)
uv run nhtsa-cli tool decode-vin 1FA6P8AM0G5227539
uv run nhtsa-cli tool ratings-search 2020 Toyota Camry
uv run nhtsa-cli tool recalls 2020 Toyota Camry
uv run nhtsa-cli tool complaints 2020 Toyota Camry
uv run nhtsa-cli tool carseat --zip 20001

# Server commands
uv run nhtsa-cli server health
uv run nhtsa-cli server list-tools
uv run nhtsa-cli server start --port 8000 --reload

发展

# Run unit tests
uv run pytest tests/unit/ tests/cli/ -v

# Run with coverage
uv run pytest tests/unit/ tests/cli/ --cov=app --cov=cli --cov-report=term-missing

# Integration tests (live NHTSA network)
uv run pytest tests/integration/ -m integration -v

# Lint and format
uv run ruff check app/ cli/ tests/
uv run ruff format app/ cli/ tests/

# Type check
uv run mypy app/ cli/

建筑

  • app/main.py --FastMCP实例、FastAPI健康端点、生命周期管理
  • app/config.py --复制设置配置
  • app/models/ --Pydantic v2输入验证器和输出类型
  • app/nhtsa_clients/ --带有重试、信号量和路径分配列表的键入HTTP客户端
  • app/mcp_tools/ --20个MCP工具实施
  • app/security/ --速率限制器、输出清理器、异步TTL缓存
  • cli/ --Typer CLI、MCP客户端包装器、LLM代理

目录标签

目录标签

PythonClaude安全车辆数据解析本地部署安全评级查询召回信息检索汽车制造商数据汽车座椅检查站

支持客户端

Claude DesktopClaude

接入字段

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

stdio

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

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

20

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiosession部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP