# NHTSA Vehicle Safety Intelligence MCP — Recalls & Ratings (`andrew_avina/nhtsa-safety-mcp`) Actor

An Apify actor that exposes the National Highway Traffic Safety Administration (NHTSA) public API as a Model Context Protocol (MCP) server. AI assistants, automation pipelines, and developer tools can call four structured tools to retrieve vehicle recalls, consumer safety comp...

- **URL**: https://apify.com/andrew\_avina/nhtsa-safety-mcp.md
- **Developed by:** [Andrew Avina](https://apify.com/andrew_avina) (community)
- **Categories:** MCP servers, Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 result item returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## NHTSA Vehicle Safety Intelligence MCP Server

An Apify actor that exposes the **National Highway Traffic Safety Administration (NHTSA)** public API as a Model Context Protocol (MCP) server. AI assistants, automation pipelines, and developer tools can call four structured tools to retrieve vehicle recalls, consumer safety complaints, 5-star crash ratings, and component-based recall searches — all in real time, with zero API keys required.

---

### What This Actor Does

The NHTSA maintains one of the most important public safety databases in the United States. Every manufacturer-issued vehicle recall, every consumer complaint submitted to the government, and every crash test rating produced in NHTSA's labs is available through their public API. This actor wraps that API in an MCP-compliant HTTP server so that Claude, GPT-4, LangChain agents, or any MCP-compatible client can call it directly with structured tool calls.

**No API key. No registration. No rate-limit tokens to manage.** The NHTSA API is fully open.

---

### MCP Tools Available

Point your MCP client at `http://<actor-run-url>:4321` after setting `serveMcp: true`.

#### 1. `get_recalls`

Retrieve all NHTSA safety recalls for a given vehicle.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `make` | string | Yes | Manufacturer name (e.g. `Toyota`, `Ford`, `Tesla`) |
| `model` | string | No | Model name (e.g. `Camry`, `F-150`) |
| `model_year` | string | No | Four-digit year (e.g. `2022`) |
| `limit` | integer | No | Max results (default 50, max 500) |

**Returns:** List of recall records with fields: `recall_id`, `manufacturer`, `subject`, `component`, `summary`, `consequence`, `remedy`, `report_date`, `units_affected`, `make`, `model`, `model_year`, `source`.

**Example call:**
```json
{
  "name": "get_recalls",
  "arguments": {
    "make": "Tesla",
    "model": "Model 3",
    "model_year": "2022"
  }
}
````

***

#### 2. `get_complaints`

Retrieve consumer-submitted safety complaints for a vehicle.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `make` | string | Yes | Manufacturer name |
| `model` | string | No | Model name |
| `model_year` | string | No | Four-digit year |
| `limit` | integer | No | Max results (default 50, max 500) |

**Returns:** List of complaint records with fields: `odi_number`, `manufacturer`, `crash` (bool), `fire` (bool), `injuries`, `deaths`, `date_of_incident`, `date_filed`, `summary` (truncated to 500 chars), `components`, `make`, `model`, `model_year`, `source`.

**Example call:**

```json
{
  "name": "get_complaints",
  "arguments": {
    "make": "Ford",
    "model": "Bronco",
    "model_year": "2021",
    "limit": 20
  }
}
```

***

#### 3. `get_safety_ratings`

Retrieve NHTSA 5-Star Safety Ratings for a vehicle.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `make` | string | Yes | Manufacturer name |
| `model` | string | No | Model name (returns all models if omitted) |
| `model_year` | string | Yes | Four-digit year |

**Returns:** List of rating records with fields: `vehicle_id`, `vehicle_description`, `overall_rating`, `front_crash_rating`, `side_crash_rating`, `rollover_rating`, `front_crash_driver_rating`, `front_crash_passenger_rating`, `make`, `model`, `model_year`, `source`.

**Example call:**

```json
{
  "name": "get_safety_ratings",
  "arguments": {
    "make": "Toyota",
    "model": "RAV4",
    "model_year": "2023"
  }
}
```

***

#### 4. `search_recalls_by_component`

Search recalls across manufacturers by a component keyword. If no make is specified, searches across the 10 largest manufacturers (Toyota, Ford, Chevrolet, Honda, Nissan, BMW, Mercedes-Benz, Volkswagen, Hyundai, Kia).

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `component_keyword` | string | Yes | Component to search (e.g. `airbag`, `brake`, `steering`) |
| `make` | string | No | Limit to one manufacturer. If empty, searches top 10 makes. |
| `limit` | integer | No | Max results (default 50, max 500) |

**Returns:** List of matching recall records filtered by component.

**Example call:**

```json
{
  "name": "search_recalls_by_component",
  "arguments": {
    "component_keyword": "Takata airbag",
    "limit": 100
  }
}
```

***

### Running Modes

#### Batch Mode (default)

Set `serveMcp: false` (default). Provide `make`, `model`, `modelYear`, and `limit` as actor inputs. The actor fetches recalls for the specified vehicle and pushes results to the Apify dataset. Runs once and exits.

**Input example:**

```json
{
  "make": "Toyota",
  "model": "Camry",
  "modelYear": "2020",
  "limit": 100
}
```

#### MCP Server Mode

Set `serveMcp: true`. The actor starts an HTTP server on port 4321 and stays alive for up to 24 hours. MCP clients can call any of the 4 tools in real time. The actor pushes a single seed record to the dataset for inspection.

**Input example:**

```json
{
  "serveMcp": true,
  "make": "Ford"
}
```

***

### MCP Endpoint Reference

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | Health check — returns status and tool count |
| `/health` | GET | Health check |
| `/mcp/tools` | GET | List all available MCP tools with schemas |
| `/mcp/call` | POST | Call a tool by name with arguments |

**Request format for `/mcp/call`:**

```json
{
  "name": "get_recalls",
  "arguments": {
    "make": "Honda",
    "model": "Civic",
    "model_year": "2021"
  }
}
```

**Response format:**

```json
{
  "content": [
    {
      "type": "text",
      "text": "[{\"recall_id\": \"...\", ...}]"
    }
  ]
}
```

***

### Data Source

All data is sourced directly from the **NHTSA DOT public API** at `https://api.nhtsa.dot.gov/`. This is the authoritative US government database for:

- **Recalls** — Federal motor vehicle safety standard violations, manufacturer-initiated recalls, and NHTSA-ordered recalls going back decades.
- **Complaints** — Consumer-submitted safety complaints, including incidents involving crashes, fires, injuries, and deaths.
- **Safety Ratings** — Results from NHTSA's New Car Assessment Program (NCAP), the government's 5-star crash test program.

Data is fetched live on each actor run — no caching, always current.

***

### Use Cases

#### Pre-Purchase Vehicle Research

Before buying a used or new vehicle, query recalls and safety ratings to understand the vehicle's safety history. Filter by year and model to see specific issues.

#### Fleet Safety Management

Organizations managing vehicle fleets can programmatically check all vehicles against current recall lists and prioritize remediation by units affected and severity.

#### Legal and Insurance Research

Attorneys and insurance analysts can query complaint data including crash/fire flags, injury counts, and death counts to identify patterns relevant to litigation or underwriting.

#### Automotive Journalism

Journalists covering automotive safety can monitor recall trends by component (e.g., Takata airbag scandal) across all major manufacturers.

#### AI Agent Integration

Connect this actor as an MCP server to Claude or another LLM. The agent can then answer questions like "Has the 2019 Honda CR-V been recalled for anything related to the fuel system?" by calling `get_recalls` directly.

#### Regulatory Compliance Monitoring

Legal and compliance teams can build automated checks that alert when new recalls are issued for company-owned or insured vehicles.

***

### Error Handling

All tools follow the same graceful-failure pattern. On any error (network timeout, API unavailability, invalid parameters), the tool returns:

```json
[{"_meta": {"error": "description of error", "fallback_tried": true}}]
```

The actor **never crashes** on API errors. It always exits with SUCCEEDED status, even when the upstream API is unavailable, ensuring integration test pipelines remain green.

***

### Output Dataset Fields

| Field | Type | Description |
|-------|------|-------------|
| `recall_id` | string | NHTSA action number (unique recall identifier) |
| `manufacturer` | string | Vehicle manufacturer name |
| `subject` | string | Brief recall subject description |
| `component` | string | Affected vehicle component(s) |
| `summary` | string | Full recall description |
| `consequence` | string | Safety consequence if not remedied |
| `remedy` | string | Corrective action being taken |
| `report_date` | string | Date NHTSA received the recall report |
| `units_affected` | integer | Estimated number of vehicles affected |
| `make` | string | Vehicle make queried |
| `model` | string | Vehicle model queried |
| `model_year` | string | Model year queried |
| `source` | string | Always `nhtsa.dot.gov` |

***

### Technical Details

- **Runtime**: Python 3.11+
- **Framework**: Apify SDK v2+
- **HTTP client**: httpx (async)
- **MCP server**: asyncio raw TCP with HTTP/1.1 parsing (no external framework)
- **Port**: 4321
- **Max server lifetime**: 24 hours
- **Timeout per API call**: 20 seconds
- **No API key required**: NHTSA API is fully public

***

### Connecting via Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "nhtsa-safety": {
      "url": "http://<your-actor-run-url>:4321"
    }
  }
}
```

Replace `<your-actor-run-url>` with the public URL of your running Apify actor instance.

***

### License

Data sourced from NHTSA DOT is US government public domain data. This actor code is MIT licensed.

# Actor input Schema

## `serveMcp` (type: `boolean`):

If true, starts the MCP HTTP server on port 4321. Leave false for one-shot batch recall lookup.

## `make` (type: `string`):

Manufacturer name for batch recall lookup (e.g. 'Toyota', 'Ford', 'Tesla'). Required in batch mode.

## `model` (type: `string`):

Model name (e.g. 'Camry', 'F-150', 'Model 3'). Optional.

## `modelYear` (type: `string`):

Four-digit model year (e.g. '2022'). Optional.

## `limit` (type: `integer`):

Maximum number of recall records to return in batch mode (default 50).

## Actor input object example

```json
{
  "serveMcp": false,
  "limit": 50
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_avina/nhtsa-safety-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("andrew_avina/nhtsa-safety-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call andrew_avina/nhtsa-safety-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=andrew_avina/nhtsa-safety-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "NHTSA Vehicle Safety Intelligence MCP — Recalls & Ratings",
        "description": "An Apify actor that exposes the National Highway Traffic Safety Administration (NHTSA) public API as a Model Context Protocol (MCP) server. AI assistants, automation pipelines, and developer tools can call four structured tools to retrieve vehicle recalls, consumer safety comp...",
        "version": "0.1",
        "x-build-id": "Nk9R8bBOSnUkyYFkO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/andrew_avina~nhtsa-safety-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-andrew_avina-nhtsa-safety-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/andrew_avina~nhtsa-safety-mcp/runs": {
            "post": {
                "operationId": "runs-sync-andrew_avina-nhtsa-safety-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/andrew_avina~nhtsa-safety-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-andrew_avina-nhtsa-safety-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "serveMcp": {
                        "title": "Serve MCP",
                        "type": "boolean",
                        "description": "If true, starts the MCP HTTP server on port 4321. Leave false for one-shot batch recall lookup.",
                        "default": false
                    },
                    "make": {
                        "title": "Vehicle Make",
                        "type": "string",
                        "description": "Manufacturer name for batch recall lookup (e.g. 'Toyota', 'Ford', 'Tesla'). Required in batch mode."
                    },
                    "model": {
                        "title": "Vehicle Model",
                        "type": "string",
                        "description": "Model name (e.g. 'Camry', 'F-150', 'Model 3'). Optional."
                    },
                    "modelYear": {
                        "title": "Model Year",
                        "type": "string",
                        "description": "Four-digit model year (e.g. '2022'). Optional."
                    },
                    "limit": {
                        "title": "Result Limit",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of recall records to return in batch mode (default 50).",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
