---
title: "EV Charging Cost API and MCP Server"
description: "Free JSON API and Model Context Protocol (MCP) server for EV charging costs by state and vehicle. No key needed."
url: https://evchargecosts.com/developers/
updated: 2026-10-26
---

# API and MCP server

Free, no key required. Use the JSON endpoints for data, `/api/cost` for calculations, or connect an AI assistant to the MCP server at `https://evchargecosts.com/mcp`.

## Calculation endpoint

```
GET https://evchargecosts.com/api/cost?state=TX&vehicle=48771&miles=13500
```

Parameters: `state` (two-letter code, required), `vehicle` (EPA id from `/api/vehicles.json`) or `kwh` (kWh per 100 miles), `miles` (per year), optional `price` (¢/kWh), `public` (% public charging), `publicprice` ($/kWh), `mpg` and `gasprice` for an EV vs gas comparison, `addmiles` and `kw` for charging time.

## MCP server

Endpoint: `https://evchargecosts.com/mcp` (Streamable HTTP, JSON responses). Tools: `calculate_ev_charging_cost`, `compare_ev_vs_gas_cost`, `estimate_ev_charging_time`, `get_state_electricity_price`, `search_vehicles`.

```
{ "mcpServers": { "ev-charge-cost": { "type": "http", "url": "https://evchargecosts.com/mcp" } } }
```

## Static data endpoints

- `/api/states.json`All states with price, rank and costs

- `/api/states/{state-slug}.json`One state, for example `/api/states/texas.json`

- `/api/vehicles.json`Every EV trim with EPA efficiency and range

- `/api/rankings.json`Latest monthly ranking

- `/openapi.json`OpenAPI 3.1 description

## In-browser agents (WebMCP)

Every calculator form is annotated with WebMCP attributes, so browser agents can call it as a tool and receive a structured result.

## Terms

Free to use with attribution under CC BY 4.0. Please cache responses; data changes at most weekly.

---
Source page: https://evchargecosts.com/developers/
Data: EIA (electricity August 2026, gasoline 2026-10-19), EPA fueleconomy.gov. License: CC BY 4.0.
