MCP Server v1
Ask questions about India's geo data in natural language. The bharatlas MCP server connects LLMs (Claude, GPT, Gemini, Cursor, etc.) to curated geo layers plus community submissions.
Install
Works with any LLM client that supports MCP: Claude, GPT, Gemini, Llama, Mistral, or local models via Cursor, Continue, Cline, Windsurf, etc.
Quick start (any MCP client)
Add this to your MCP client's config:
{
"mcpServers": {
"bharatlas": {
"command": "npx",
"args": ["-y", "bharatlas-mcp"]
}
}
}
Config file locations by client
# Claude Code
.mcp.json (project root) or ~/.claude.json
# Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
# Cursor
~/.cursor/mcp.json
# Windsurf
~/.codeium/windsurf/mcp_config.json
# VS Code (Copilot / Continue / Cline)
.vscode/mcp.json (project) or settings.json
Developers: test tools without an LLM via npx @modelcontextprotocol/inspector npx bharatlas-mcp
What you can ask
Counting and filtering
How many national parks vs wildlife sanctuaries in India?
101 national parks, 560 sanctuaries (from the gs_wildlife layer, grouped by category)
How many villages are in Bengaluru Urban district?
949 villages (lgd_villages filtered by dtname=BENGALURU URBAN)
How many health facilities are in Bihar?
8,363 facilities: 3,232 sub-centres, 591 PHCs, 74 CHCs (nic_health filtered by state)
How many wards does Chennai have vs Pune?
Chennai: 200, Pune: 58 (from wards_chennai and wards_pune layer metadata)
Location queries
What state, district, and seismic zone is Bengaluru in?
Karnataka, Bengaluru Urban, Seismic Zone II (locate endpoint checks 12 layers in one call)
Which blocks are in district 571?
10 blocks: Kunigal, Tumakuru, Gubbi, Turuvekere, Tiptur... (lgd_blocks filtered by dtcode11)
Cross-layer queries
How many airports in Bengaluru district? What are their types?
3 airports: HAL (Domestic), Yelahanka AFB (Civil Enclave), Kempegowda International. The MCP locates the district, then filters the airports layer by state and district.
Which airports in Karnataka are near water bodies?
Hubballi Airport (~3 km from Unkal Lake), Mangalore Airport (between Netravathi and Gurupura rivers), Jindal Vijaynagar (~7 km from JSW Reservoir). Cross-references airports + reservoirs layers.
Spatial queries (multi-step)
Which villages in Madhya Pradesh are in eco-sensitive zones?
MP has 4 eco-sensitive zones (Kharmor, Chambal, Orchha, Kheoni). The MCP narrows 47,571 MP villages by district, then tests each against the eco-zone boundaries.
Which districts does NH-44 pass through?
Delhi, UP, MP, Telangana, Karnataka. The MCP samples points along the route and locates the state at each point.
How many hospitals are in flood-prone areas of Assam?
3,909 health facilities in Assam (narrowed by state). For precise flood-zone overlap, the MCP tests hospital points against the India Flood Inventory layer.
8 tools
- list_layers -- discover layers by category, level, source, or text search
- get_layer_schema -- column names, types, distinct values (call before querying)
- query_layer -- filter, select, group by any column; results include
_lat/_lngfor spatial layers - locate -- point-in-polygon across all admin layers + zones at once
- nearby -- find features within a radius (works for points, polygons, and lines)
- get_layer_detail -- download URLs in 5 formats (parquet, pmtiles, geojson, kml, shapefile)
- list_categories -- browse by category with layer counts
- list_submissions -- community-contributed layers under open licenses
Author your own maps (collect)
The same bharatlas-mcp (no second package) also drives collect, the crowd map-capture tool. Read stays the default; authoring is opt-in per map. You create maps online at collect.bharatlas.com (no account, no key), then paste a share link into the MCP with register_map. The link's token scope sets what you can do:
- view link → read / query / export that map's published points (
get_map,get_records) - collect link → the above; field capture itself is a tap in the browser on a phone
- admin link →
edit_map,moderate_record,import_points, andpublish
publish submits your approved points to the bharatlas catalog for review; a maintainer approves the submission before it goes live, after which it is queryable via list_submissions / query_layer above: gather → moderate → publish → review → query, all in one server. The link is the credential, so the server can only touch maps you hold a link to. No config change is needed for authoring; creating a map programmatically (instead of online) is optional and needs a request-only COLLECT_API_KEY:
// same "bharatlas" server as Install above; add an env key only to create headlessly
"bharatlas": {
"command": "npx",
"args": ["-y", "bharatlas-mcp"],
"env": { "COLLECT_API_KEY": "cak_…" }
}
Authoring tools: register_map, list_my_maps, get_map, get_records, edit_map, moderate_record, import_points, publish (plus optional create_map). It is deliberately not a bulk-contribution surface: human field contributors are the source, and published maps show up here via list_submissions once a maintainer approves them.
How it works
The MCP server is a thin wrapper over the bharatlas REST API. It translates LLM tool calls into API requests and returns structured JSON. No API key needed. All data is read-only and openly licensed.
The server sends instructions to the LLM at connection time that teach it:
- Schema-first pattern (check column names before querying)
- Source preference (LGD for admin boundaries, multiple sources for wards)
- Spatial join workflow (locate for context, query for data, combine)
- Concept-to-layer mapping ("water bodies" = rivers + reservoirs + wetlands + ramsar)
Data
Curated layers across multiple categories: admin boundaries (state to village), city wards, forests, wildlife, eco-zones, rivers, reservoirs, dams, seismic zones, floods, highways, airports, health facilities, pincodes, electoral constituencies. Plus community submissions.
Sources: LGD, SOI, Bhuvan, OpenCity, DataMeet, PMGSY, GatiShakti, Bharatmaps, bharatviz, CWC, data.gov.in. All open-licensed.