- Home
- MCP servers
- VAHAN Data
VAHAN Data
- python
0
GitHub Stars
python
Language
3 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run the VAHAN Data MCP Server to scrape India's VAHAN vehicle registration data and expose it as a queryable MCP interface for Claude Desktop or any MCP-compatible client. This setup ingests data from CSV exports, builds a local SQLite database on first start, and makes a rich set of vehicle statistics accessible through MCP endpoints. This guide shows practical steps to install, run, connect your MCP client, and understand the data model and caveats.
How to use
You will run the MCP server to load the scraped VAHAN data from CSV exports into a SQLite database, then connect an MCP client to query the data. Use the provided tools to fetch year-wise All India metrics, breakdowns by vehicle class and fuel type, emission norms, maker registrations, RTO lookups, and year-on-year trends. You can operate locally with stdio or expose the server over HTTP for web access, then connect Claude Desktop or other MCP clients to run queries and retrieve results.
How to install
Prerequisites you need to prepare before installation:
- Python 3.11 or newer
- Node.js for mcp-remote usage with Claude Desktop (optional)
- Homebrew for macOS users (for cloudflared)
- Access to a shell or terminal with Git and network access to install dependencies
# Clone / enter the project directory
cd vahandata
# Create a Python virtual environment
python3 -m venv .venv
# Install Python dependencies
.venv/bin/pip install playwright>=1.44.0 pandas>=2.2.0 openpyxl mcp uvicorn starlette
# Install Playwright browsers (needed for scraping only)
.venv/bin/playwright install chromium
Additional setup and usage notes
You will perform scraping first to generate CSV data, then start the MCP server to read those CSVs and build the SQLite database at db/vahan.db on first run.
The standard workflow is: run the scrapers to produce data in data/ and then start the MCP server. The server will ingest the CSVs on first start and expose the data via MCP endpoints.
Configuration and hosting notes
Cloudflare tunnels can expose the local HTTP MCP server to the internet without opening firewall ports. You can run a quick tunnel or set up a named tunnel for a stable URL. Cloudflared is the suggested tool on macOS and can be installed via Homebrew.
Troubleshooting and caveats
-
Year-wise data is All India only; the VAHAN dashboard does not vary year-wise data by state in its tables. Use state_code "-1" to get the canonical All India totals.
-
The fuel and norms data tables include 10× row duplication due to vehicle_group handling. When querying with SQL, deduplicate using MAX(count) GROUP BY vehicle_class, fuel_type or vehicle_class, norm.
-
Year values include a trailing colon (e.g., "2025:"). Use the exact formatting when querying. The all-time total uses the special value "Till Today".
-
Some missing norms data exist for Ladakh’s TRAILER category due to a server-side limitation. This affects a small percentage of norms rows and cannot be resolved by re-scraping.
MCP Tools and Endpoints overview
You can query registries, vehicle classifications by fuel or norms, yearly trends, EV breakdowns, maker rankings, and more through the MCP endpoints exposed by the server. A complete set of tool endpoints is available via the MCP interface once connected.
Data model and endpoints overview
The VAHAN data is stored in a SQLite database with a schema that includes yearly metrics, vehicle class breakdowns by fuel and by norms, regional transport offices, states, and maker registrations. The server loads data from the scraped CSVs into db/vahan.db on first start, and the OTA tools provide read-only access to the data.
Notes on data sources and coverage
Data coverage includes 35 states/UTs, 1,551 RTOs, year-wise registrations, transactions, revenue, permits, and detailed breakdowns by vehicle class with fuel types and emission norms, spanning historical data from 1970 to present.
Security and access control
For local setups, use stdio transport to run the MCP server directly with Claude Desktop. For remote access over the web, enable HTTP transport and consider securing access behind authentication or a reverse proxy as needed. Cloudflared can tunnel the local HTTP server without opening ports.
Available tools
get_registrations
Fetch year-wise All India vehicle counts for a metric, returning the requested metric across years and states with the canonical All India row when state_code is -1.
get_vehicle_class_by_fuel
Return vehicle class counts broken down by fuel type for a state, with optional filtering by fuel type and a limit on rows.
get_vehicle_class_by_norms
Return vehicle class counts broken down by emission norms for a state, with optional norm filtering and a limit on rows.
get_yearly_trend
Provide All India year-wise trend data for a metric, including growth percentages, for the most recent years.
get_ev_breakdown
Provide electric vehicle registrations breakdown by state, vehicle class, or fuel type, with grouping options.
search_rtos
Look up Regional Transport Offices by state or by name substring.
get_top_makers
Get top vehicle manufacturers by registration counts for All India or a specific state and year.
search_makers
Search vehicle makers by name substring with optional state and year filters.
run_sql
Run a read-only SELECT query against the SQLite database with optional row limit, returning raw results.