bharatlas-mcp

bharatlas-mcp

Description: Query India's open geo data in natural language. 8 tools: list layers, inspect schemas, filter/group any column, point-in-polygon locate, spatial proximity search, downloads in 5 formats. Covers admin boundaries (state to village), city wards, forests, rivers, dams, hospitals, highways, airports, and more.

Category
访问服务器

README

bharatlas

ci license: MIT v1.0 uptime Lighthouse: 98+

A visual catalog, REST API, MCP server, drag-drop verifier, and anonymous contribution flow for India's geo data. Admin boundaries from state to village, plus community-submitted layers under open licences.

Live: https://bharatlas.com

catalog               → India national boundary (LGD-dissolved)
                        + state · district · subdistrict · block · village (LGD)
                        + cross-source alternates (SOI · Bhuvan · geoBoundaries
                        · PMGSY per level — click "also: ..." on any card)
                        + city wards across Indian cities
                        + electoral constituencies, wildlife, eco-zones
                        + 63k pincode polygons (bharatviz)
download              → whole layer as Parquet · PMTiles · GeoJSON · KML ·
                        Shapefile, direct from the card
filter & slice        → dynamic facets / range / typeahead search per
                        layer schema; export the slice in any format above
preview               → drop GeoJSON · KML · KMZ · GPX · TCX · Parquet →
                        render + validate → optional Publish
view (/view/<id>)     → curated layer with per-layer OG card
view (/c/<id>)        → community submission, edge-rendered HTML, 👍 useful
                        vote, per-submission OG card
embed                 → /embed/<id> iframe + PNG export from any map
API (/api/v1)         → REST API: list, query, filter, group_by any layer;
                        locate (point-in-polygon across all layers);
                        nearby (tile-based spatial proximity)
MCP (npx bharatlas-mcp) → 8 tools for LLMs: list, schema, query, locate,
                        nearby, categories, submissions, downloads

What's in this repo

Path Contents
web/ Vanilla TypeScript + Vite viewer + Cloudflare Pages Functions (web/functions/).
web/migrations/ D1 SQL migrations: submissions, tokens, ratings, votes, originals.
web/tests/ vitest unit tests for pure functions (validators, tokens, view rendering, votes).
scripts/fetch.sh Pulls parquets + PMTiles from yashveeeeeeer/india-geodata releases.
scripts/extract_per_state.py Slices pan-India parquets into per-state GeoJSON via DuckDB-spatial.
scripts/bake_whole_layer.py Bakes whole-layer GeoJSON / KML / Shapefile per curated layer (parquet ≤ 100 MB).
scripts/upload_r2.sh Mirrors sources/ + data/ to Cloudflare R2 via wrangler.
scripts/upload_baked.py Pushes data/baked/* to R2 via boto3 (S3-compat fallback when wrangler is unavailable).
scripts/admin/cleanup_submission.sh Delete community submissions by name pattern (R2 + D1).
mcp/ MCP server for LLMs (npm). 8 tools: list, schema, query, locate, nearby, categories, submissions, downloads.
catalog.json Curated-layer index used by the viewer. Single source of truth.
/about#caveats Data caveats (cross-source drift, coverage gaps, precision).

Large data files (sources/, data/) are not in git — they live in R2. See scripts/fetch.sh to rebuild locally.

Stack

Layer Tech
Frontend Vanilla TypeScript, Vite, MapLibre GL JS, PMTiles, DuckDB-WASM (lazy)
Static hosting Cloudflare Pages
Edge functions Cloudflare Pages Functions (web/functions/) — REST API v1, submit, vote, sitemap, edge-rendered /c/<id>
Parquet query hyparquet (pure JS, runtime reads from R2)
Spatial query PMTiles tile reads + MVT decode + ray-casting PIP / Haversine proximity
MCP server bharatlas-mcp — 8 tools for Claude, GPT, Gemini, Cursor, etc.
Storage Cloudflare R2 (open data, no egress)
Submissions DB Cloudflare D1 (SQLite at the edge)
Anti-abuse Cloudflare Turnstile + per-IP rate limits
CI/CD GitHub Actions — tests + build + auto-deploy on push to main

Develop

# clone + viewer-only dev (no submissions, no D1)
git clone git@github.com:urbanmorph/geodata.git
cd geodata/web
npm install
npm run dev    # http://localhost:5173
npm test

For the full submission flow (D1 + R2 + Turnstile + Pages Functions), see docs/full-dev.md (TODO) or read wrangler.toml + .dev.vars.example.

Contributing

  1. Branch off main: git checkout -b feat/short-name
  2. Write a test first if you're adding logic to web/functions/lib/*. Pure functions are tested via vitest in web/tests/.
  3. Make sure npm test and npm run build both pass.
  4. Open a PR against main. CI runs tests + build automatically.
  5. The maintainer reviews and merges. Merge to main = auto-deploy.

Commit messages: short subject, body explains why not what. Examples in git log.

Changelog

See releases and merged PRs.

Security

Report vulnerabilities to sathya@urbanmorph.com instead of opening a public issue. Acknowledgement within 72 hours.

Licence

Code: MIT. Data: each layer carries its own open licence — see the per-card line on the catalog. Curated data is sourced under CC0-1.0 / CC-BY-4.0 / GODL-India depending on provider.

Use of data

Provided as-is, no warranty. For legal/administrative use, go to the upstream source. Full disclaimers: /about → Use of data.

Credits

Data sources, in approximate order of catalog footprint:

  • LGD — Local Government Directory; the authoritative admin code chain (state → village).
  • SOI — Survey of India; admin alternatives.
  • Bhuvan — NRSC/ISRO Bhuvan; admin alternatives, eco-sensitive zones.
  • OpenCity / Oorvani Foundation — city-scale layers (ward / corporation / jurisdiction polygons for 20+ cities).
  • DataMeet — community-curated municipal spatial data (ward boundaries for multiple cities).
  • datta07/INDIAN-SHAPEFILES — metropolitan city ward shapefiles.
  • PMGSY — Pradhan Mantri Gram Sadak Yojana; rural blocks + roads.
  • PM GatiShakti — wildlife sanctuaries + national parks.
  • Bharatmaps (NIC) — eco-sensitive zones.
  • bharatviz (Saket Choudhary, MIT) — India Post pincode boundary polygons (simplified).
  • geoBoundaries — independent cross-check.
  • data.gov.in — additional government open data.

Pipelines + patterns:

Built by Urban Morph · Sathya Sankaran. Drop a ⭐ if you find it useful.

Status: v1.0. Curated layers, community submissions, REST API, MCP server ( npm), dynamic filters with typeahead, whole-layer downloads in 5 formats. API docs at /docs, MCP setup at /mcp. Community submissions are permanent under the open licence the contributor selected.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选