AI agents can answer far better urban-planning questions when they can access authoritative city portals instead of relying on stale training data or unverified web searches. A WebMCP—an MCP-style server exposed through web-accessible tools—can provide that controlled access. For Bengaluru, the challenge is not simply scraping pages: it is identifying the right civic source, interpreting maps and documents, preserving provenance, and returning machine-readable results without bypassing access controls.
This guide explains how to develop a WebMCP for agents to extract urban planning data from Bengaluru city portals, with a practical architecture, source strategy, extraction pipeline, security model, and India-specific implementation considerations.
What a WebMCP Should Do
A WebMCP should give an AI agent a small, well-documented set of tools for discovering and retrieving planning information. The agent should not receive unrestricted browser control or direct database credentials. Instead, it should call typed operations such as:
search_planning_sourcesfind_property_or_road_recordget_zoning_informationretrieve_master_plan_documentextract_map_layerget_building_permit_statusfind_public_noticecite_source_evidence
Each tool should define strict inputs and outputs. For example, a zoning query might accept a locality, survey number, latitude/longitude, or ward identifier, then return the matching planning authority, land-use classification, applicable document, extraction confidence, and source URL.
The WebMCP is therefore a policy and evidence layer, not just an HTTP proxy. It should make it difficult for an agent to confuse a BBMP administrative boundary with a BDA planning boundary, treat a scanned notification as structured truth, or present an inferred zoning result as legally conclusive.
Bengaluru Data Sources to Map First
Bengaluru’s urban-planning data is distributed across agencies, portals, GIS viewers, PDFs, notices, and service systems. Before writing extraction code, create a source catalogue with ownership, coverage, update frequency, access method, and legal or operational constraints.
Potential source categories include:
- Bruhat Bengaluru Mahanagara Palike (BBMP): ward information, civic infrastructure, roads, property-related services, building permissions, notices, and public documents.
- Bangalore Development Authority (BDA): master-plan materials, layouts, development schemes, planning notifications, and related land-use information.
- Bengaluru Urban district and Karnataka government portals: government orders, notifications, land and administrative references.
- Bengaluru Metropolitan Region Development Authority (BMRDA): metropolitan-region planning information outside or around the core city area.
- Karnataka State Remote Sensing Applications Centre and state GIS resources: spatial layers and remote-sensing information where publicly available.
- Bengaluru traffic, transport, water, and utility agencies: road projects, mobility corridors, drainage, water infrastructure, and project notices.
- Open government datasets and data catalogues: downloadable tabular or geospatial datasets with explicit reuse terms.
Do not assume that a visually similar portal is an official source. Store a verified source registry containing the domain, organisation, source type, contact or policy page, and last verification date. For every answer, expose the authority that published the underlying material.
Recommended WebMCP Architecture
A production design can use six layers:
1. Source registry: Records portals, endpoints, document collections, GIS services, authority names, and access policies.
2. Acquisition layer: Fetches HTML, JSON, PDFs, images, and permitted map-service responses with rate limits and retry controls.
3. Normalisation layer: Converts inconsistent names, dates, coordinates, document identifiers, ward names, and survey references into canonical fields.
4. Spatial and document extraction layer: Handles GIS queries, PDF text, OCR, tables, map legends, and geometry validation.
5. Evidence and provenance store: Saves source URLs, timestamps, page numbers, hashes, snippets, extracted geometry, and transformation history.
6. MCP/WebMCP tool gateway: Exposes safe, typed tools to agents and applies authentication, quotas, validation, and output policies.
A common deployment stack could include Python or Node.js for connectors, PostgreSQL with PostGIS for spatial data, object storage for source documents, a queue such as Redis or a managed message broker, and a relational metadata database. Keep raw artefacts immutable. Derived records can be reprocessed when parsing logic changes.
Design the Source Registry Before the Scraper
A source registry prevents fragile, hard-coded extraction logic. A minimal schema may include:
{
"source_id": "bda_master_plan_docs",
"authority": "Bangalore Development Authority",
"canonical_domain": "example.gov.in",
"source_kind": "document_repository",
"coverage": ["master plan", "land use", "notifications"],
"access_method": "public_web",
"robots_checked_at": "2026-09-03",
"terms_url": "https://example.gov.in/terms",
"update_frequency": "irregular",
"trust_level": "primary",
"last_successful_fetch": null
}Add selectors or connector configuration separately from source metadata. A portal redesign should require changing a connector, not rewriting the whole application. Track whether a source is primary, secondary, or merely an index. A search-engine result, social-media post, or private property website should never silently substitute for an official notification.
Build Connectors for HTML, PDFs and GIS
HTML and JSON portals
Use a normal HTTP client first, with realistic timeouts, caching, conditional requests, and an identifying user agent. Parse structured JSON endpoints when the portal itself uses them, but do not infer undocumented private APIs are available for unrestricted use. Respect robots.txt, terms, authentication boundaries, and reasonable request rates.
Capture:
- Page title and issuing authority
- Publication and update dates
- Record or application identifiers
- Visible text and table headings
- Linked documents
- Pagination state
- The retrieval timestamp
PDFs and scanned notifications
Planning information often appears in PDF notices, master-plan reports, gazette-style documents, and annexures. Use a staged pipeline:
1. Download and hash the original file.
2. Extract embedded text and metadata.
3. Render pages for OCR only when text extraction is insufficient.
4. Detect tables, headings, schedules, legends, and signatures.
5. Store page-level evidence and OCR confidence.
6. Preserve the original document alongside parsed output.
OCR should never be treated as perfect. For survey numbers, measurements, road widths, and dates, apply field-specific validation. For example, compare OCR output against expected numeric patterns and flag ambiguous characters such as 0/O, 1/I, and punctuation in survey references.
GIS viewers and map services
A map viewer may load layers from an OGC service, a tiled endpoint, a JavaScript API, or a proprietary backend. Prefer documented public services and downloadable layers. Do not defeat authentication, CAPTCHA, token controls, or technical restrictions.
For spatial extraction:
- Convert all coordinates to a documented CRS, commonly WGS 84 for API responses.
- Preserve the original CRS and transformation details.
- Validate geometry bounds against Bengaluru or the relevant planning region.
- Record layer name, service URL, query parameters, and feature identifier.
- Return the geometry type and accuracy caveats.
- Distinguish a point located near a polygon from a legally authoritative parcel intersection.
PostGIS can support point-in-polygon queries, buffer calculations, geometry repair, and spatial joins. Use a projected coordinate system for distance and area calculations rather than calculating metres directly from unprojected latitude/longitude.
Create Agent-Friendly Tool Contracts
Tool contracts should be narrow and explicit. A tool called get_land_use should not accept arbitrary URLs. It should accept approved source identifiers and validated geographic inputs.
Example request:
{
"locality": "Whitefield",
"latitude": 12.9698,
"longitude": 77.7500,
"include_evidence": true
}Example response:
{
"status": "partial",
"land_use": "residential",
"authority": "Bangalore Development Authority",
"source": {
"url": "https://official-source.example/document.pdf",
"retrieved_at": "2026-09-03T10:15:00Z",
"page": 42,
"document_hash": "sha256:..."
},
"confidence": 0.82,
"limitations": [
"Location was matched to a published planning layer; parcel-level legal verification is required."
]
}Use enums for status, source type, confidence band, and geometry type. Return not_found, source_unavailable, ambiguous, and needs_review distinctly. A null value should not mean all four.
Retrieval and Ranking for Planning Questions
An agent may ask, “What is the proposed land use near a road in Whitefield?” Retrieval should combine structured filters with document search:
1. Resolve the place name to candidate administrative and geographic entities.
2. Ask for clarification if multiple localities or roads match.
3. Search the source registry for relevant authorities and datasets.
4. Retrieve current and historical records where temporal context matters.
5. Rank primary official sources above secondary summaries.
6. Extract supporting passages, table rows, map features, and page references.
7. Return the result with an evidence bundle and limitations.
Use hybrid retrieval for documents: keyword search for survey numbers and notification identifiers, plus embeddings for semantic queries. Keep embeddings as a discovery aid; final answers should be grounded in quoted or structured source evidence. Index Kannada and English content where possible, while preserving the original script and translation provenance.
Temporal Data and Versioning Matter
Urban plans change. A current portal page may replace an earlier notification, while a planning decision may depend on the date of an approved plan. Store:
- Publication date
- Effective date, if stated
- Superseded or amended document links
- Retrieval timestamp
- Source revision or file hash
- Dataset version
- Extraction pipeline version
Expose temporal queries such as “as published on,” “currently available,” and “latest official record.” Never describe the most recently downloaded document as legally current unless the source explicitly supports that conclusion.
Security, Privacy and Responsible Access
A WebMCP connected to civic portals is an attractive target for abuse. Apply defence in depth:
- Allowlist domains, paths, and connector types.
- Block arbitrary URL fetching and server-side request forgery.
- Enforce outbound DNS and IP restrictions.
- Apply per-source rate limits, caching, and concurrency caps.
- Store credentials in a secret manager, never in prompts or source code.
- Redact personal information that is not required for the planning task.
- Log tool calls, user identity, source access, and returned record identifiers.
- Validate uploaded documents and scan for malicious files.
- Separate public planning data from restricted application or ownership data.
- Require human review before high-impact conclusions or automated submissions.
Do not use the system to infer sensitive personal attributes, expose private owner information, or evade a portal’s technical controls. Public availability does not automatically mean unrestricted republication is appropriate.
Quality Evaluation and Observability
Measure the system as a data product, not only as an AI demo. Create a Bengaluru evaluation set containing real questions across wards, planning authorities, document formats, and Kannada/English variants.
Track:
- Source retrieval success rate
- Correct authority selection
- Record and document recall
- OCR field accuracy
- Spatial intersection accuracy
- Citation completeness
- Freshness lag
- Ambiguity detection rate
- Unsupported-answer rate
- Latency and source error rates
Use golden records reviewed by planners, GIS specialists, or domain researchers. Test adversarial cases such as similarly named roads, changed ward boundaries, scanned tables, missing legends, and coordinates outside the city. Log each extraction stage so an engineer can explain why a result was returned.
A Practical Development Roadmap
Phase 1: Narrow the use case
Start with one valuable workflow, such as locating official master-plan documents and extracting land-use references for a coordinate. Avoid launching with every BBMP service.
Phase 2: Build the source catalogue
Verify official domains, document collections, GIS layers, terms, refresh patterns, and contact channels. Add health checks and source-change alerts.
Phase 3: Implement two or three connectors
Support one structured endpoint, one PDF collection, and one geospatial layer. Preserve raw evidence and write deterministic tests for each connector.
Phase 4: Add the tool gateway
Expose typed tools with JSON Schema, authentication, quotas, validation, error states, and citation requirements. Make evidence inclusion the default.
Phase 5: Evaluate with domain reviewers
Compare outputs against known documents and spatial records. Review false positives, not just successful answers.
Phase 6: Expand carefully
Add more wards, agencies, languages, historical versions, and planning datasets only after monitoring source reliability and legal or policy requirements.
Common Mistakes to Avoid
- Treating a web search snippet as an authoritative planning record
- Scraping a visual map without saving layer metadata and CRS
- Returning a zoning label without the map, document, date, or page evidence
- Ignoring amendments and superseded plans
- Giving agents unrestricted URL or browser access
- Using OCR output without confidence checks
- Mixing BBMP, BDA, BMRDA, and district boundaries
- Assuming locality names uniquely identify a place
- Storing only final answers instead of raw source artefacts
- Claiming legal certainty from an indicative GIS layer
FAQ: Bengaluru WebMCP Development
What is a WebMCP?
It is a web-accessible implementation of Model Context Protocol-style tools that allows AI agents to call controlled services for data retrieval and actions. The tools should be typed, permissioned, observable, and grounded in evidence.
Can I scrape Bengaluru government portals?
Only use permitted access methods. Check terms, robots directives, authentication requirements, rate limits, and applicable Indian laws and government policies. Prefer official APIs, downloadable datasets, and documented public services.
Which database is suitable for planning data?
PostgreSQL with PostGIS is a strong choice for geometry, spatial joins, versioned records, and structured metadata. Pair it with object storage for immutable PDFs, images, and raw responses.
Can an agent determine whether construction is legally permitted?
It can retrieve relevant public planning documents and report evidence, but legal permission often depends on current approvals, parcel records, building rules, and authority verification. The response should clearly state those limits.
Should Kannada documents be translated automatically?
Automatic translation can improve discovery, but retain the original Kannada text, translation output, document page, and confidence. Important planning conclusions should be reviewable against the original.
Apply for AI Grants India
Building a reliable WebMCP for Bengaluru’s urban-planning ecosystem requires engineering, GIS, data governance, and domain validation. Indian AI founders developing civic-data infrastructure can apply through AI Grants India for support and opportunities.