viguza/nhtsa-mcp-server
If you are the rightful owner of nhtsa-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The NHTSA MCP Server provides access to the National Highway Traffic Safety Administration's vehicle database APIs through a Model Context Protocol server, enabling interaction with vehicle data for MCP-compatible clients and LLMs.
NHTSA MCP Server
An MCP (Model Context Protocol) server providing access to the NHTSA (National Highway Traffic Safety Administration) vehicle database APIs. This server allows LLMs (Large Language Models) to interact with vehicle data through a standardized protocol.
Overview
This project implements an MCP server that wraps the NHTSA vPIC API, making vehicle data accessible to any MCP-compatible client or LLM. The server provides both resources and tools for querying vehicle information, including:
- Vehicle Identification Number (VIN) decoding
- Vehicle makes and models
- Manufacturer details
- World Manufacturer Identifiers (WMI)
- Vehicle variables and specifications
- Canadian vehicle specifications
- And more
Prerequisites
- Node.js 18.x or higher
- npm or yarn
Installation
Option 1: Using Docker (Recommended)
-
Clone the repository:
git clone https://github.com/viguza/nhtsa-mcp-server.git cd nhtsa-mcp-server
-
Build and start the Docker container:
docker compose up -d
-
For development with hot reloading:
docker compose -f docker-compose.dev.yml up -d
Option 2: Standard Installation
-
Clone the repository:
git clone https://github.com/viguza/nhtsa-mcp-server.git cd nhtsa-mcp-server
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory (or use the defaults):PORT=3000 NHTSA_API_BASE_URL=https://vpic.nhtsa.dot.gov/api NODE_ENV=development
-
Build the project:
npm run build
-
Start the server:
npm start
The server will be available at http://localhost:3000 (or the configured PORT).
Usage
Connect to the MCP Server
The server supports two types of connections:
1. Standard MCP Connection
To use the server with an MCP client, connect to the MCP endpoint:
http://localhost:3000/mcp
2. Server-Sent Events (SSE) Connection
The server also supports SSE for streaming communication:
http://localhost:3000/sse
SSE provides a persistent connection for real-time updates from the server to the client. Message posting for SSE clients is done via:
http://localhost:3000/messages?sessionId=YOUR_SESSION_ID
Available Tools
The server exposes the following tools for LLMs to interact with the NHTSA API:
VIN Decoding
decodeVin
: Decode a Vehicle Identification NumberdecodeVinValues
: Decode a VIN in flat formatdecodeVinExtended
: Decode a VIN with extended informationdecodeVinValuesExtended
: Decode a VIN with extended information in flat formatdecodeVinBatch
: Decode multiple VINs in a batch (max 50)
World Manufacturer Identifier (WMI)
decodeWMI
: Decode a World Manufacturer IdentifiergetWMIsForManufacturer
: Get WMIs for a manufacturer
Makes
getAllMakes
: Get all vehicle makesgetMakesForManufacturer
: Get makes for a manufacturergetMakesForManufacturerAndYear
: Get makes for a manufacturer in a specific yeargetMakesForVehicleType
: Get makes for a vehicle type
Models
getModelsForMake
: Get models for a makegetModelsForMakeId
: Get models for a make by IDgetModelsForMakeYear
: Get models for a make and yeargetModelsForMakeIdYear
: Get models for a make ID and yeargetModelsForMakeYearType
: Get models for a make, year, and vehicle type
Manufacturers
getAllManufacturers
: Get all manufacturersgetManufacturerDetails
: Get details for a specific manufacturer
Parts
getParts
: Get parts by type and date range
Vehicle Variables
getVehicleVariableList
: Get all vehicle variablesgetVehicleVariableValuesList
: Get values for a specific vehicle variable
Canadian Vehicle Specifications
getCanadianVehicleSpecifications
: Get Canadian vehicle specifications
Available Resources
The server exposes the following resources:
nhtsa://api-info
: API documentationnhtsa://makes
: List of all vehicle makesnhtsa://makes/{make}
: Information about a specific makenhtsa://manufacturers
: List of all manufacturersnhtsa://manufacturers/{manufacturer}
: Information about a specific manufacturernhtsa://variables
: List of all vehicle variables
Example Queries
Here are some example tool calls an LLM might make:
1. Decode a VIN
{
"name": "decodeVin",
"arguments": {
"vin": "1FTFW1ET5DFA4527",
"modelYear": 2013
}
}
2. Get all vehicle makes
{
"name": "getAllMakes",
"arguments": {}
}
3. Get models for a specific make and year
{
"name": "getModelsForMakeYear",
"arguments": {
"make": "Honda",
"year": 2020
}
}
4. Get manufacturer details
{
"name": "getManufacturerDetails",
"arguments": {
"manufacturer": "Honda"
}
}
Development
Scripts
npm run build
- Build the projectnpm start
- Start the servernpm run dev
- Start the server in development mode with hot reloading
Docker Commands
docker compose up -d
- Start the container in detached modedocker compose down
- Stop the containerdocker compose logs -f
- View logsdocker compose -f docker-compose.dev.yml up -d
- Start development container with hot reloading
Model Context Protocol (MCP)
The Model Context Protocol is an open standard for providing context to LLMs. It allows services to expose data and functionality in a standardized way that any MCP-compatible client can consume.
Key MCP concepts used in this project:
- Tools: Similar to functions, tools allow LLMs to take actions (e.g., make API calls)
- Resources: Similar to documents or files, resources provide data to LLMs
- Transport: Communication layer between client and server (this project uses Streamable HTTP and SSE)
Learn more about MCP at modelcontextprotocol.io.
Data Source
All data is sourced from the official NHTSA vPIC API at vpic.nhtsa.dot.gov/api/.
License
This project is licensed under the MIT License - see the file for details.
Acknowledgments
- NHTSA for providing the vehicle data API
- Model Context Protocol for the MCP specification and SDK