ph-civic-data-mcp
ph-civic-data-mcp
The multi-source MCP server for Philippine civic data. PSGC codes, infra spending accountability, earthquakes, weather, typhoons, procurement, population, poverty, solar radiation, air quality, satellite vegetation indices, and macro indicators — all in your AI agent, no API keys required.
One-click install:
ph-civic-data-mcp is a zero-cost, stdio-transport MCP server. v0.3.1 is a correctness pass on the v0.3.0 accountability layer: the get_weather_alerts tool no longer fabricates advisories from PAGASA navigation chrome, flag_infra_anomalies no longer fires on stoplist tokens like "city", the PSGC -> coordinate bridge handles "City of Manila" / "Sta. Mesa, Manila", and search_infra_projects(province=...) expands across DPWH agency aliases for all 81 PH provinces. v0.3.0 added the PH Accountability layer: PSGC location resolver, infra spending search, and one cross-source heuristic that flags procurement notices for further review by cross-referencing PHIVOLCS earthquakes and PAGASA typhoon footprints. v0.2.0 added six no-auth scientific + open-data sources (NASA POWER, Open-Meteo Air Quality, NASA MODIS, USGS FDSN, NOAA IBTrACS, World Bank Open Data) on top of the original four Philippine government feeds (PHIVOLCS, PAGASA, PhilGEPS, PSA). 25 tools total. Boots and runs with zero API keys.
All data sourced from public records (PSGC, PHIVOLCS, PAGASA, PhilGEPS, PSA, and open scientific feeds). Heuristic indicators are statistical only; specific allegations, if any, require independent investigation and corroboration.
This is how easy it is to set up
One JSON file. One claude command. Your agent just correlated live Philippine weather with 2020 Census population data in a single turn.

The recording above isn't scripted. It's vhs docs/demo_setup.tape, which spawns Claude Code with --mcp-config pointing at this server, and Claude fans out in parallel to get_weather_forecast (Open-Meteo) and get_population_stats (PSA PXWeb), then correlates them. The temperatures (30.4 / 30.9 / 31.0 °C max over Apr 19-21) and NCR population (13,484,462) in the streamed answer are what the live sources returned at the moment of the recording.
Works the same way in Claude Desktop, Cursor, Zed, VS Code, or any MCP-compatible client. One "command": "uvx", one "args": ["ph-civic-data-mcp"], done.
Related MCP server: mcp-brasil
Demo
Every GIF below is a real VHS recording of docs/live_demo.py. It spawns uvx ph-civic-data-mcp from this PyPI release and calls each tool over the real MCP stdio protocol. The panels you see contain the actual JSON returned by the server. Nothing is staged.
A grand tour hitting 7 tools across all 4 sources in one session:

Per-source walkthroughs below. To reproduce any of them locally: uv run python docs/live_demo_single.py <suite>.
Why this exists
Philippine civic-data portals publish open data, but each in its own schema — scraped HTML tables, PXWeb JSON, undocumented APIs. Nothing ties them together for an AI agent. This server does.
A handful of other Philippine civic-data MCP servers exist (PSGC administrative geography, holidays, DHSUD license-to-sell, DepEd schools), each covering one dataset. None expose hazard feeds, weather, procurement, or statistical data, and none combine sources. This server does both. See the Prior art section below for the full list.
Install
uvx ph-civic-data-mcpOr via pip:
pip install ph-civic-data-mcpSetup
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ph-civic-data": {
"command": "uvx",
"args": ["ph-civic-data-mcp"]
}
}
}Claude Code
Add to .claude/settings.json:
{
"mcpServers": {
"ph-civic-data": {
"command": "uvx",
"args": ["ph-civic-data-mcp"]
}
}
}Or install via the Claude Code CLI:
claude mcp add ph-civic-data -- uvx ph-civic-data-mcpCursor, Zed, other MCP clients
Any client that supports the stdio MCP transport works. Point the command at uvx ph-civic-data-mcp. No API keys required for the default configuration.
What you can ask
After setup, ask your agent:
"How hot is Metro Manila this week and how many people are affected?"
"What earthquakes happened in the Philippines in the last 24 hours?"
"Is Taal volcano active right now?"
"What's the 3-day weather forecast for Quezon City?"
"Are there active typhoons in the Philippines right now?"
"Search PhilGEPS for flood control contracts."
"What is the population of Region VII based on the PSA?"
"What is the poverty incidence in the Bicol Region?"
"Give me a multi-hazard risk profile for Leyte."
"What's the solar irradiance in Ilocos Norte this week? Good site for a PV farm?" (v0.2.0)
"Compare air quality in Makati and Cebu City right now." (v0.2.0)
"What do MODIS NDVI composites say about vegetation health over the Nueva Ecija rice bowl?" (v0.2.0)
"Cross-check the magnitudes that PHIVOLCS and USGS assigned to last week's events." (v0.2.0)
"List all typhoons that passed through the PAR in the 2024 season." (v0.2.0)
"What's the Philippines' GDP growth and poverty ratio over the last decade?" (v0.2.0)
"Resolve 'Sta. Mesa, Manila' to its official PSGC code." (v0.3.0)
"Find DPWH flood-control or construction projects in Pampanga over P50M with low progress." (v0.3.0)
"Show me PH infrastructure spending breakdown by category for the latest PhilGEPS window." (v0.3.0)
"Are there any infra projects whose locations overlap a recent earthquake or typhoon footprint? Flag them for review." (v0.3.0)
"Walk the location hierarchy from PSGC code 072217000 up to its region." (v0.3.0)
"What's the cache TTL and freshness of every data source this server uses?" (v0.3.0)
Per-source demos
PHIVOLCS — earthquakes + volcano alert levels

PAGASA — weather forecast + typhoon tracking

PhilGEPS — procurement search + aggregation

PSA — population (2020 Census) + poverty (2023 Full-Year)

Cross-source — parallel multi-hazard risk profile

How the demos are produced
docs/live_demo.py and docs/live_demo_single.py open an MCP StdioTransport pointing at uvx ph-civic-data-mcp (which resolves to this PyPI release), call the tools, and render the responses with Rich (panels, tables, syntax-highlighted JSON, live spinners). vhs drives a real terminal and records the session. Tapes are committed under docs/*.tape.
Data sources
Source | Data | Update frequency | Auth |
PHIVOLCS | Earthquakes, bulletins, volcano alerts | 5 min (earthquakes), 30 min (volcanoes) | None |
PAGASA | 10-day weather, active typhoons, alerts | Hourly | Optional |
Open-Meteo | Weather fallback when PAGASA token absent | Hourly | None |
PhilGEPS | Government procurement notices (latest ~100) | 6 h (cached) | None |
PSA OpenSTAT | Population (2020 Census), poverty (2023) | Periodic | None |
NASA POWER (v0.2.0) | Daily solar irradiance + temp/precip/wind, any lat/lng | Daily | None |
Open-Meteo Air Quality (v0.2.0) | PM2.5/PM10/NO2/SO2/O3/CO + AQI | Hourly | None |
NASA MODIS via ORNL DAAC (v0.2.0) | NDVI/EVI vegetation indices (250m, 16-day composites) | Weekly | None |
USGS FDSN (v0.2.0) | Philippine-region earthquakes from global seismic network | Minutes | None |
NOAA IBTrACS (v0.2.0) | Historical tropical cyclone tracks through the PAR | Per storm | None |
World Bank Open Data (v0.2.0) | Philippine macro indicators (GDP, poverty ratio, inflation, etc.) | Annual | None |
PSGC (v0.3.0) | Philippine Standard Geographic Code via psgc.gitlab.io (PSA dataset mirror) | When PSA publishes a new version | None |
PH Infra (PhilGEPS-backed) (v0.3.0) | Filtered infra notices for construction / road / bridge / flood control | 6 h cache window | None |
All tools
Tool | Description | Key params |
| Recent PH earthquakes |
|
| Full PHIVOLCS bulletin for one event |
|
| Alert level per monitored PH volcano |
|
| 1–10 day forecast (PAGASA or Open-Meteo) |
|
| Active tropical cyclones in/near PAR | — |
| Active PAGASA warnings |
|
| Keyword search on PhilGEPS notices |
|
| Aggregate procurement stats |
|
| 2020 Census population |
|
| 2023 Full-Year poverty incidence |
|
| Multi-hazard profile (parallel PHIVOLCS + PAGASA) |
|
| NASA POWER daily solar irradiance + climate variables at any coordinate |
|
| Real-time air quality for ~80 major PH cities via Open-Meteo |
|
| MODIS NDVI + EVI vegetation index timeseries at any coordinate |
|
| PH-bbox earthquakes from USGS global network (cross-ref to PHIVOLCS) |
|
| Historical typhoons that passed through the Philippine AOR (IBTrACS) |
|
| Philippine macro indicator from World Bank Open Data (code or friendly alias) |
|
| Fuzzy-resolve a free-text PH place name to its canonical PSGC record |
|
| Browse children of a PSGC node, or top-level regions when |
|
| Full chain region -> province -> city/municipality for one PSGC code |
|
| Filter PhilGEPS notices for infra-related work (construction, road, bridge, flood control) |
|
| Full record for one infra project by |
|
| Aggregate infra notice stats by category, region, agency |
|
| Heuristic indicators for further review (high_cost_no_progress, hazard_overlap, duplicate_titles_same_agency) |
|
| Catalog of every upstream source with TTL, freshness, license | (none) |
Environment variables
Variable | Required | Notes |
| Optional | Requires formal PAGASA request. Without it, weather auto-falls-back to Open-Meteo. |
No mandatory API keys. The server boots and all 25 tools work without any token.
Data freshness warnings
Population: 2020 Census. No later national data exists yet.
Poverty: 2023 Full-Year poverty statistics (latest PSA release).
Procurement: PhilGEPS open data does not expose filterable search externally. This server scrapes the latest ~100 bid notices and filters client-side. Cached 6h.
Emergencies: for real-time disaster response, always check ndrrmc.gov.ph and official PHIVOLCS/PAGASA channels. This server is for research, not life-safety decisions.
Architecture
Python 3.11+,
fastmcp>=3.0.0,<4.0.0Two HTTP clients: standard +
PHIVOLCS_CLIENTwithverify=False(PHIVOLCS has a broken SSL cert chain). SSL verification is never disabled globally.In-memory TTL caches per source; no disk writes.
stdio transport only (zero hosting cost).
PSA table paths are discovered via the PXWeb browse API, never hardcoded.
Development
git clone https://github.com/xmpuspus/ph-civic-data-mcp
cd ph-civic-data-mcp
uv sync --extra dev
# MCP Inspector
fastmcp dev src/ph_civic_data_mcp/server.py
# Tests (run against live APIs)
uv run pytest tests/ -v
# Build
uv run python -m build
uv run twine check dist/*Limitations
PAGASA token is gated. Non-government users may be denied. Open-Meteo fallback removes this as a hard dependency.
PhilGEPS is not real-time. Public portal exposes no filterable API; this server operates on the latest ~100 notices with client-side filtering.
Emergencies: direct users to official channels; this is a research tool.
What's new in v0.3.0 — PH Accountability layer
Accountability demo: "Audit current PH government infra spending."

One unscripted claude -p --mcp-config call exercising four new tools in a single turn against uvx ph-civic-data-mcp@0.3.0 (live PyPI). Claude resolved Pampanga to canonical PSGC 035400000 (Luzon, Region III), pulled 10 open PhilGEPS construction notices published in the last 24 hours, summarised the cached infra window into 15 projects (7 road/highway, 6 civil works, 1 bridge, 1 school building), and ran flag_infra_anomalies against 29 recent PHIVOLCS earthquakes plus PAGASA typhoons — surfacing 4 hazard_overlap flags. The agent also caveats those flags honestly ("triggered by weak keyword matches like 'city' rather than substantive hazard correlation") and finishes with the mandatory disclaimer. Tape: docs/demo_accountability.tape.
This release adds three tightly-scoped capabilities for civic accountability work, plus one polish tool.
PSGC backbone (
resolve_ph_location/list_admin_units/get_location_hierarchy) — fuzzy free-text place name resolution to the canonical Philippine Standard Geographic Code, full hierarchy walks, and admin-unit browsing. Sourced from the community-mirrored PSA dataset at psgc.gitlab.io.Infra spending (
search_infra_projects/get_infra_project/summarize_infra_spending) — PhilGEPS notices filtered for construction / road / bridge / flood control / drainage / school building / civil works. The DPWH Transparency portal attransparency.dpwh.gov.phis currently behind Cloudflare's bot challenge and not reachable to non-browser clients, so v0.3.0 sources from the open PhilGEPS listing instead.Cross-source anomaly indicator (
flag_infra_anomalies) — emits heuristic flags for further review by cross-referencing the infra notice window against PHIVOLCS earthquakes (>=M4.0 in last 30d) and active PAGASA typhoon footprints. Three rules:high_cost_no_progress,hazard_overlap,duplicate_titles_same_agency. Every flagged item ships with a "Statistical indicators derived from public data. Patterns may have legitimate explanations." disclaimer.Polish —
get_data_freshnessreturns the catalog of every upstream source with cache TTL, freshness expectation, and license. Every new tool response includessource,source_url,data_retrieved_at, andlicense.
Per-tool live outputs
Every JSON block below is the actual response from each new tool, captured by running uv run python docs/live_probe_v030.py against live public APIs on the release date. Lists are clipped to fit; full output saved to /tmp/live_probe_v030_output.json.
resolve_ph_location — PSGC fuzzy resolver
Handles common patterns: comma-separated qualifiers ("Sta. Mesa, Manila"), Filipino abbreviations (Sta., Sto., Brgy.), partial names ("Pampanga"), full names.
$ resolve_ph_location(query="Sta. Mesa, Manila"){
"psgc_code": "133900000",
"name": "City of Manila",
"level": "city",
"parent_code": "130000000",
"region_code": "130000000",
"island_group": "luzon",
"matched": true,
"match_score": 0.893,
"source": "PSGC",
"source_url": "https://psgc.gitlab.io/api/cities-municipalities/133900000/",
"license": "Public domain (PSA Philippine Standard Geographic Code)"
}get_location_hierarchy — full chain region -> province -> city/municipality
$ get_location_hierarchy(psgc_code="072200000"){
"psgc_code": "072200000",
"chain": [
{
"psgc_code": "070000000",
"name": "Central Visayas",
"level": "region",
"source_url": "https://psgc.gitlab.io/api/regions/070000000/"
},
{
"psgc_code": "072200000",
"name": "Cebu",
"level": "province",
"source_url": "https://psgc.gitlab.io/api/provinces/072200000/"
}
],
"source": "PSGC",
"license": "Public domain (PSA Philippine Standard Geographic Code)"
}search_infra_projects — PhilGEPS notices, infra-only
$ search_infra_projects(keyword="construction", limit=3)[
{
"project_id": "23164",
"title": "Construction of Sewage Treatment Plant (STP) in Pasig Bliss Village III ...",
"agency": "CITY OF PASIG",
"category": "civil works (other)",
"cost_php": null,
"currency": "PHP",
"status": "Open",
"date_published": "2026-04-27",
"source": "PhilGEPS",
"source_url": "https://www.philgeps.gov.ph/",
"license": "Public — PhilGEPS open notice listing"
},
{
"project_id": "23319",
"title": "26C00029 Asset Preservation Program ... Reconstruction Upgrading ...",
"agency": "DEPARTMENT OF PUBLIC WORKS AND HIGHWAYS - REGION I",
"category": "road / highway",
"cost_php": null,
"status": "Open",
"source_url": "https://www.philgeps.gov.ph/"
}
]summarize_infra_spending — aggregated breakdown
$ summarize_infra_spending(){
"total_count": 15,
"total_value_php": null,
"by_category": {
"road / highway": 7,
"civil works (other)": 6,
"bridge": 1,
"school building": 1
},
"by_funding_source": {"unknown": 15},
"reference_period": {"from": "2026-04-27", "to": "2026-04-27"},
"note": "Computed over the latest infra-keyword-matched PhilGEPS notice window (cached 6h). Approved budget totals are not published in the open notice listing, so total_value_php is typically null.",
"source": "PhilGEPS",
"source_url": "https://www.philgeps.gov.ph/",
"license": "Public — PhilGEPS open notice listing",
"disclaimer": "Statistical indicators derived from public data. Patterns may have legitimate explanations."
}flag_infra_anomalies — heuristic indicators across PhilGEPS + PHIVOLCS + PAGASA
$ flag_infra_anomalies(min_cost_php=50_000_000){
"filters": {"region": null, "province": null, "min_cost_php": 50000000},
"projects_examined": 15,
"flagged_count": 4,
"rules_summary": {"hazard_overlap": 4},
"flagged": [
{
"project_id": "23164",
"title": "Construction of Sewage Treatment Plant (STP) ... Pasig City",
"agency": "CITY OF PASIG",
"rule_fired": "hazard_overlap",
"evidence": "project title overlaps with recent hazard footprint keywords: ['city']",
"source_url": "https://www.philgeps.gov.ph/"
}
],
"hazard_inputs": {"recent_earthquake_count_30d": 0, "active_typhoon_count": 0},
"source": "PhilGEPS + PHIVOLCS + PAGASA",
"source_url": "https://www.philgeps.gov.ph/, https://earthquake.phivolcs.dost.gov.ph/, https://bagong.pagasa.dost.gov.ph/",
"license": "Public — PhilGEPS, PHIVOLCS, PAGASA notice and bulletin pages",
"disclaimer": "Statistical indicators derived from public data. Patterns may have legitimate explanations."
}Each flag is a heuristic indicator, not an accusation. The hazard_overlap rule simply says the project title shares keywords with a recent hazard footprint; the project may be entirely legitimate post-disaster reconstruction. Treat output as a starting point for further investigation, not as evidence of wrongdoing.
get_data_freshness — TTL and license catalog
$ get_data_freshness(){
"server_version": "0.3.0",
"asof": "2026-04-27T00:09:21+00:00",
"sources": [
{"source": "PSGC", "source_url": "https://psgc.gitlab.io/api/", "freshness": "Updated when PSA publishes new PSGC version (annual or quarterly)", "cache_ttl_seconds": 86400, "license": "Public domain (PSA Philippine Standard Geographic Code)"},
{"source": "PHIVOLCS earthquakes", "source_url": "https://earthquake.phivolcs.dost.gov.ph/", "freshness": "5-minute table refresh; bulletins published per event", "cache_ttl_seconds": 300, "license": "Public — PHIVOLCS public bulletin pages"}
]
}What's new in v0.2.0 — six new no-auth sources
Correlation demo: "Why is Metro Manila so hot right now?"

One unscripted claude -p --mcp-config call, real MCP stdio transport, live upstream APIs. Claude picks three sources out of the 17 tools — PAGASA/Open-Meteo 7-day forecast (v0.1.x), NASA POWER solar irradiance (v0.2.0, new), and Open-Meteo Air Quality (v0.2.0, new) — then correlates them into a three-sentence answer. The numbers in the response (6.8–7.3 kWh/m²/day irradiance, 30.3–31.8°C daytime temps, PM2.5 24.8 µg/m³, US AQI 91) are exactly what the live endpoints returned at the moment of recording. Tape: docs/demo_correlation.tape.
Per-tool live outputs
Every JSON block below is the actual response from each tool, captured by running uv run python docs/live_probe_v020.py against live public APIs on the release date. No placeholders, no truncation tricks — lists were clipped to fit.
get_solar_and_climate — NASA POWER
Daily solar irradiance + climate at any coordinate. Useful for PV siting and agricultural modeling.
$ get_solar_and_climate(latitude=14.5995, longitude=120.9842,
start_date="2026-04-01", end_date="2026-04-07"){
"latitude": 14.5995,
"longitude": 120.9842,
"start_date": "2026-04-01",
"end_date": "2026-04-07",
"days": [
{"date": "2026-04-01", "solar_irradiance_kwh_m2": 6.79, "temp_c": 25.4, "precipitation_mm": 0.11, "windspeed_ms": 2.11},
{"date": "2026-04-02", "solar_irradiance_kwh_m2": 7.18, "temp_c": 24.9, "precipitation_mm": 0.01, "windspeed_ms": 2.45},
{"date": "2026-04-03", "solar_irradiance_kwh_m2": 7.13, "temp_c": 25.3, "precipitation_mm": 0.17, "windspeed_ms": 2.23}
],
"source": "NASA POWER",
"data_retrieved_at": "2026-04-20T00:12:13Z"
}get_air_quality — Open-Meteo Air Quality
Fills the gap that AQICN left when it was removed in v0.1.8. No auth, reliable PH coverage.
$ get_air_quality(location="Manila"){
"location": "Manila",
"latitude": 14.5995,
"longitude": 120.9842,
"measured_at": "2026-04-20T08:00:00Z",
"pm2_5": 24.8,
"pm10": 34.3,
"carbon_monoxide": 521.0,
"nitrogen_dioxide": 11.6,
"sulphur_dioxide": 15.5,
"ozone": 81.0,
"european_aqi": 65,
"us_aqi": 91,
"aqi_category": "Moderate",
"source": "Open-Meteo Air Quality",
"data_retrieved_at": "2026-04-20T00:12:13Z"
}get_vegetation_index — NASA MODIS via ORNL DAAC
NDVI + EVI at 250m, 16-day composites. MOD13Q1 product. Useful for monitoring crops, droughts, and deforestation. Here — a rice-bowl pixel in Nueva Ecija going through the growing cycle:
$ get_vegetation_index(latitude=15.58, longitude=121.0,
start_date="2026-01-01", end_date="2026-04-18"){
"latitude": 15.58,
"longitude": 121.0,
"product": "MOD13Q1",
"band": "NDVI+EVI (250m, 16-day composite)",
"samples": [
{"composite_date": "2026-01-01", "ndvi": 0.708, "evi": 0.343},
{"composite_date": "2026-01-17", "ndvi": 0.856, "evi": 0.582},
{"composite_date": "2026-02-02", "ndvi": 0.898, "evi": 0.703}
],
"source": "NASA MODIS via ORNL DAAC",
"data_retrieved_at": "2026-04-20T00:12:17Z"
}get_usgs_earthquakes_ph — USGS FDSN
Global-network seismic catalogue, filtered to the PH bounding box. Useful for cross-validating PHIVOLCS local magnitudes against USGS Mww/Mwc solutions.
$ get_usgs_earthquakes_ph(min_magnitude=5.0, limit=10)[
{
"datetime_utc": "2026-04-06T07:22:42Z",
"magnitude": 5.2,
"magnitude_type": "mww",
"depth_km": 10.0,
"latitude": 10.8435,
"longitude": 123.8752,
"place": "0 km S of Tabonok, Philippines",
"usgs_event_id": "us6000sn00",
"felt_reports": 37,
"tsunami": false,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000sn00",
"source": "USGS FDSN"
},
{
"datetime_utc": "2026-04-04T10:34:28Z",
"magnitude": 6.0,
"magnitude_type": "mww",
"depth_km": 67.0,
"latitude": 4.8733,
"longitude": 126.1392,
"place": "95 km SE of Sarangani, Philippines",
"usgs_event_id": "us6000smj4",
"tsunami": false,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000smj4",
"source": "USGS FDSN"
}
]get_historical_typhoons_ph — NOAA IBTrACS
Every typhoon that has passed through the Philippine Area of Responsibility, from the authoritative IBTrACS track archive. Aggregates track points per storm, falls back across agency wind/pressure solutions (WMO → JTWC → JMA) to populate peak intensity.
$ get_historical_typhoons_ph(limit=3)[
{
"sid": "2025329N10124",
"name": "KOTO",
"season": 2025,
"basin": "WP",
"max_wind_kt": 80.0,
"min_pressure_mb": 975.0,
"start_time_utc": "2025-11-24T18:00:00Z",
"end_time_utc": "2025-12-03T00:00:00Z",
"track_points": 67,
"passed_within_par": true,
"source": "NOAA IBTrACS"
},
{
"sid": "2025308N10143",
"name": "FUNG-WONG",
"season": 2025,
"basin": "WP",
"max_wind_kt": 115.0,
"min_pressure_mb": 943.0,
"track_points": 75,
"passed_within_par": true,
"source": "NOAA IBTrACS"
},
{
"sid": "2025305N10138",
"name": "KALMAEGI",
"season": 2025,
"basin": "WP",
"max_wind_kt": 115.0,
"min_pressure_mb": 948.0,
"track_points": 43,
"passed_within_par": true,
"source": "NOAA IBTrACS"
}
]get_world_bank_indicator — World Bank Open Data
Any World Bank indicator for the Philippines. Accepts the canonical WB code (e.g. NY.GDP.MKTP.CD) or a friendly alias from a curated list (gdp, gdp_per_capita, poverty_ratio, inflation, urban_population_pct, internet_users_pct, gini, tax_revenue_pct_gdp, etc. — 25 aliases in total).
$ get_world_bank_indicator(indicator="gdp", per_page=10){
"indicator_id": "NY.GDP.MKTP.CD",
"indicator_name": "GDP (current US$)",
"country": "Philippines",
"country_iso3": "PHL",
"observations": [
{"year": 2024, "value": 461617509782.36, "unit": ""},
{"year": 2023, "value": 437055627244.42, "unit": ""},
{"year": 2022, "value": 404353369604.63, "unit": ""}
],
"source": "World Bank Open Data"
}Roadmap
Requires deeper reverse-engineering than this release — shipped separately when ready:
get_active_disasters/get_situational_reportvia NDRRMC monitoring dashboard (intermittent availability)assess_hazard(lat, lng)via HazardHunterPH — the top-level GeoRisk ArcGIS catalog is public, but the individual PHIVOLCS/MGB hazard layers (flood, landslide, liquefaction) return"code": 499, "message": "Token Required". Needs a different integration strategyget_flood_layers(lat, lng)via Project NOAH — current site is an Angular SPA whose XHR surface needs browser-level capture. DeferredDPWH Transparency portal direct integration —
transparency.dpwh.gov.phandapi.transparency.dpwh.gov.phcurrently sit behind a Cloudflare bot challenge that returns 403 to every non-browser client regardless of User-Agent. v0.3.0 sidesteps this by sourcing infra notices from the open PhilGEPS listing instead; if/when DPWH lifts the block,sources/infra.pyis the single integration point to swap in.
Prior art
Other Philippine civic-data MCP servers, each single-dataset:
GodModeArch/psgc-mcp — PSA Philippine Standard Geographic Code (administrative hierarchy)
GodModeArch/ph-holidays-mcp — Philippine national holidays from the Official Gazette
GodModeArch/lts-mcp — DHSUD License to Sell registry
xiaobenyang-com/Philippine-Geocoding — PSGC geocoding
darwinphi/ph-schools-mcp-server — DepEd schools masterlist
Non-MCP libraries that inspired this project:
panukatan/lindol — R package for PHIVOLCS earthquakes
pagasa-parser — JS org for PAGASA data parsing
ph-civic-data-mcp is the first MCP that unifies multiple Philippine civic-data sources (PHIVOLCS, PAGASA, PhilGEPS, PSA) behind one interface, and the first to expose hazards, weather, procurement, statistical data, solar/climate, air quality, satellite vegetation indices, and macro indicators (v0.2.0) as MCP tools. Credit to all of the above.
License
MIT. Xavier Puspus. Not affiliated with PHIVOLCS, PAGASA, PhilGEPS, or PSA.
Contributing
Issues and PRs welcome at github.com/xmpuspus/ph-civic-data-mcp.
Available Tools
41 toolsassess_area_riskMulti-hazard risk snapshot for a placeARead-onlyIdempotent
Multi-hazard risk assessment combining PHIVOLCS + PAGASA.
Makes parallel upstream calls to PHIVOLCS (earthquakes, volcano alert levels) and PAGASA (active typhoons, weather alerts). Expect 3-6 second response time. earthquake_risk_level is a heuristic reading of recent seismic activity, never an official PHIVOLCS hazard assessment. Examples:
assess_area_risk("Manila") assess_area_risk("Batangas")
On failure: this tool never raises. A failed PHIVOLCS or PAGASA sub-call shows up as a caveats entry naming the source, and the other sources still report. data_status is "success" when every sub-call succeeded, "indeterminate" when some failed, and "unavailable" when all failed; upstream_error is true for the last two.
Inputs: location (required). Returns: object
browse_election_resultsBrowse the COMELEC 2025 election results treeARead-onlyIdempotent
Walk the COMELEC 2025 election results tree: region down to precinct.
Starts at the 20 regions when code is "0", the default. Pass a
child's code from the response to go one level deeper. A barangay's
children are its precincts, since the geography tree stops at the
barangay level and precincts sit in a separate family. Examples:
browse_election_results() the 20 regions browse_election_results(code="R001000") provinces of Region I browse_election_results(code="2801000") barangays of Adams, Ilocos Norte browse_election_results(code="2801001") precincts of one barangay
On failure: a code that is not "0", a region code, or 7 digits gives validation_error true and data_status "invalid_request", with no request sent. A well-formed code the archive does not recognize gives the same shape after the lookup. A tree response whose rows all fail to parse gives data_status "indeterminate", never cached. A response with some bad rows returns the good rows, with a caveat naming the skipped count. A real outage gives upstream_error true and data_status "unavailable", with the real error in caveats.
Inputs: code. Returns: object
browse_psa_catalogBrowse the PSA OpenSTAT catalogARead-onlyIdempotent
List one level of the PSA OpenSTAT statistical catalog.
OpenSTAT publishes roughly 2,900 tables across 27 subjects. This walks
that tree one level at a time, so an agent can find a dataset without
guessing a table id. A dataset entry is a .px table. Pass its path
to describe_psa_dataset before calling query_psa_dataset. Folder depth
varies by subject, so keep browsing until entries come back as datasets. Examples:
browse_psa_catalog() the 27 top-level subjects browse_psa_catalog("1F") one level into the Poverty subject browse_psa_catalog("1F/FY") the Full Year Poverty Statistics tables
On failure: data_status is "invalid_request" for a rejected argument and "unavailable" for an OpenSTAT outage. A bad path sets validation_error true before any request goes out. An unreachable catalog sets upstream_error true, with the real error in caveats. Both return an empty entries list, which never means an empty folder.
Inputs: path. Returns: One level of the PSA OpenSTAT catalog, or a failure envelope.
compare_areasCompare civic indicators across placesARead-onlyIdempotent
Compare civic indicators for two to five Philippine places, side by side.
Calls get_area_profile for each place and builds one row per place, so an
agent does not have to call the profile tool once per place and merge the
results itself. locations needs 2 to 5 entries. metrics, when given, must
come from a fixed allowlist of eight names, and it defaults to all eight.
format is "json" or "csv". "csv" adds a CSV string under export.
Examples:
compare_areas(["Cebu City", "Davao City"]) compare_areas(["Cebu City", "Davao City"], metrics=["population"])
On failure: a rejected request, such as a wrong location count, too many or duplicate metrics, an unknown metric, or a bad format, never calls get_area_profile. It returns validation_error: true and data_status "invalid_request". A place that fails to resolve still gets a row, with resolved_name None, the overall data_status becomes "indeterminate" or "unavailable", and comparable turns false with a caveat naming the unresolved place.
Inputs: locations (required), format, metrics. Returns: object
describe_psa_datasetDescribe a PSA OpenSTAT datasetARead-onlyIdempotent
Read the dimensions and valid value codes of one PSA OpenSTAT dataset.
Call this before query_psa_dataset. The query tool needs an explicit value code for every dimension, and those codes live here. total_cells is the size of the full cube. A query must select down to max_cells_per_query or fewer, so pick explicit codes per dimension. Examples:
describe_psa_dataset("1F/FY/0241F3DF013.px") dimensions and value codes for one table
On failure: data_status is "invalid_request" for a rejected argument
and "unavailable" for an OpenSTAT outage. A path
that is not a .px dataset sets validation_error true before any
request goes out. An unreadable dataset sets upstream_error true, with
the real error in caveats. Both return an empty dimensions list.
Inputs: dataset_path (required). Returns: Dimensions and valid value codes of one dataset, or a failure envelope.
flag_infra_anomaliesFlag infrastructure spending anomaliesARead-onlyIdempotent
Flag PhilGEPS infrastructure projects that warrant further review by cross-referencing PHIVOLCS earthquakes and PAGASA typhoon footprints.
This tool emits heuristic anomaly indicators, not accusations. Every flagged item ships with the rule that fired and a disclaimer noting that patterns may have legitimate explanations.
Heuristic rules:
duplicate_titles_same_agency: same agency files multiple notices with effectively identical titles (case-insensitive) within the window
high_cost_no_published_progress: cost_php exceeds min_cost_php. The PhilGEPS open listing publishes no progress data for ANY notice, so this is a cost-threshold transparency flag, not a project-specific "progress is missing" finding.
hazard_overlap: project location keywords overlap with a recent PHIVOLCS earthquake (>=M4.0 in last 30d) or an active PAGASA typhoon footprint, suggesting urgency or post-disaster reconstruction context. Examples:
flag_infra_anomalies() flag_infra_anomalies(min_cost_php=100_000_000)
On failure: this tool never raises. data_status is "success" when PhilGEPS, PHIVOLCS, and PAGASA all load, "indeterminate" when one or two fail, and "unavailable" when all three fail; upstream_error is true for the last two. A failed sub-call shows up as a caveats entry naming the source, and the flagged list still returns data from every source that did respond.
Inputs: region, province, min_cost_php. Returns: object
get_active_typhoonsActive tropical cyclones in the PARARead-onlyIdempotent
Get active tropical cyclones in/near the Philippine Area of Responsibility (PAR).
Returns an empty list when no cyclone is active. This tool parses the live PAGASA bulletin page with regular expressions. A bulletin wording change can miss a cyclone, but the "no active" state itself is reliably detected.
Examples: get_active_typhoons() # only call form, no arguments
On failure: When the PAGASA bulletin page is unreachable, this tool returns data_status "unavailable", upstream_error: true, results: [], and the real error in caveats. That shape never matches a genuine "no active typhoons" answer, which is a bare empty list. When the page loads but neither the "no active cyclone" marker nor a cyclone name matches, this tool returns data_status "indeterminate" instead of guessing at "no active typhoons".
Returns: list of typhoons, each with local_name, international_name, category, max_winds_kph, within_par, signal_numbers, bulletin_number, source, bulletin_url, data_retrieved_at. Or the failure dict above.
Inputs: no named parameters. Returns: result
get_air_qualityAir quality at a Philippine locationARead-onlyIdempotent
Real-time air quality for a Philippine city via Open-Meteo (no API key).
Returns PM2.5, PM10, CO, NO2, SO2, and O3, plus European AQI and US AQI with category interpretation. Covers about 80 major PH cities through a local coordinate table. measured_at is always UTC, never Asia/Manila time. Examples:
get_air_quality("Manila") # current readings for Metro Manila get_air_quality("Cebu City") # current readings for Cebu City get_air_quality("Davao") # current readings for Davao City
On failure: a location not in the coordinate table returns data_status "invalid_request", with validation_error true and a caveat naming the location. An Open-Meteo fetch failure returns data_status "unavailable", with upstream_error true and the real error text in caveats. A response with no time, an unparseable time, or no pollutant field returns data_status "indeterminate", with upstream_error true and a caveat naming the problem.
Inputs: location (required). Returns: object
get_area_profileOne-call civic profile for a placeARead-onlyIdempotent
One-call correlated civic profile for a Philippine location.
Resolves the place once to its PSA Standard Geographic Code, then composes demographics (population, poverty), economy (regional inflation, national labor), procurement activity, multi-hazard risk, and the short-range weather outlook — in a single agent turn instead of eight. Adds derived cross-source context (e.g. infrastructure notices per 100k residents) so the caller does not have to normalize raw counts itself. Examples:
get_area_profile("Cebu City") city-level demographics, hazard, weather get_area_profile("NCR") region-level, no province in the chain get_area_profile("Tacloban") city under a resolved province
On failure: each block (population, poverty, inflation, labor, hazard, weather, infra, resolve) gets its own status in blocks. A failed sibling appears there and in caveats, never as a silent null. The top-level upstream_error is true only when a block is genuinely unreachable, not when a sibling rejected an argument or returned a real empty answer.
Inputs: location (required). Returns: object
get_data_freshnessServer health and data-source catalogARead-onlyIdempotent
Server health and data-source catalog probe.
Doubles as the version and health endpoint: returns server_version so an agent can confirm which release it is talking to. Also returns the full upstream-source catalog: cache TTLs, freshness expectations, and licenses. Use it to judge whether a stale cached response is fine or a re-fetch is needed.
Examples: get_data_freshness() # the only call, it takes no arguments
On failure: this tool calls no upstream itself, so it always returns a dict. source_health is a process-local, in-memory registry, not a database. It starts empty on a cold process and fills as fetch_with_retry runs calls, so a fresh restart always reports an empty dict here.
Returns: server_version, server_name, transport, tool_count, asof, sources (list of {source, source_url, freshness, cache_ttl_seconds, license}), source_health (per-host {last_success_at, last_failure_at, last_error, last_latency_ms, success_count, failure_count}), cache_age (per-cache {size, ttl_seconds}), note.
Inputs: no named parameters. Returns: object
get_earthquake_bulletinPHIVOLCS earthquake bulletinARead-onlyIdempotent
Get the full bulletin for a PHIVOLCS earthquake event.
Parses the bulletin page PHIVOLCS publishes for one event: magnitude, depth, location, date and time, and per-municipality intensity reports. Give the bulletin_url a prior get_latest_earthquakes call returned. A hand-built or off-host URL is refused before any fetch is attempted. Examples:
get_earthquake_bulletin("https://phivolcs.dost.gov.ph/index.php") # real bulletin URL shape
On failure: an empty, malformed, or non-PHIVOLCS bulletin_url, or a 404 on the page itself, returns a dict with url, source, caveats, and data_retrieved_at only, with no data_status, upstream_error, magnitude, or location fields. A fetch that raises an exception sets data_status "unavailable" and upstream_error true.
Inputs: bulletin_url (required). Returns: object
get_election_returnCOMELEC 2025 precinct election returnARead-onlyIdempotent
One precinct's official vote tally from the COMELEC 2025 archive.
Give the 8-digit precinct code from browse_election_results. Returns every national and local contest counted at that precinct, with each candidate's vote count and share. Examples:
get_election_return("28010001") Adams, Ilocos Norte, precinct 0001
On failure: a code that is not 8 digits gives validation_error true and data_status "invalid_request", with no request sent. A code the archive does not recognize (a 403 body carrying its AccessDenied marker) gives the same shape. A body missing 'information', where 'national' or 'local' is not a list, or where a contest carries a non-list nested 'candidates' value, gives data_status "indeterminate" with upstream_error true. Any other outage, including a 403 with no AccessDenied marker, gives data_status "unavailable" with upstream_error true and the real error in caveats.
Inputs: precinct_code (required). Returns: object
get_flood_forecastRiver flood forecast for a Philippine locationARead-onlyIdempotent
Daily river discharge forecast for a Philippine place, from Open-Meteo's GloFAS model.
Returns a daily river_discharge_m3s series for the nearest river cell to the resolved location, plus its max and min bounds, in cubic meters per second. This is a model estimate, not a gauge reading, so treat it as one signal among many for flood risk. Examples:
get_flood_forecast("Cagayan de Oro") # 7-day default forecast get_flood_forecast("Marikina", forecast_days=14, past_days=3) # 14 days ahead, 3 days back
On failure: an unresolved location, or a forecast_days or past_days value that is not a whole number or is out of range, returns data_status "invalid_request", with validation_error true and days []. A PSGC outage during location resolution, or an Open-Meteo fetch failure, returns data_status "unavailable", with upstream_error true and days []. A response with no readable daily.time entries, or a river_discharge list shorter than daily.time (including an empty list), returns data_status "indeterminate", with upstream_error true, days [], and is never cached.
Inputs: location (required), past_days, forecast_days. Returns: object
get_health_indicatorsPhilippine health indicatorsARead-onlyIdempotent
National health indicators from PSA OpenSTAT (subject 1D).
With no argument, returns the curated national headline set: maternal
mortality ratio and total fertility rate. Pass a free-text indicator to
fuzzy-match any table published under the Health subject. The available
list is browse-discovered, never hardcoded. Examples:
get_health_indicators() maternal mortality ratio and fertility rate get_health_indicators(indicator="fertility") one matching table
On failure: a catalog browse failure sets data_status "unavailable" and upstream_error true, with an empty indicators list. A keyword that matches no table sets data_status "success" with an empty indicators list and a caveat, not an error flag. A partial fetch failure across matched tables sets data_status "indeterminate" and upstream_error true. validation_error stays false in every case.
Inputs: indicator. Returns: object
get_historical_typhoons_phHistorical typhoon tracks through the PARARead-onlyIdempotent
Historical tropical cyclone tracks that passed through the Philippine AOR.
Sourced from NOAA IBTrACS (International Best Track Archive), the authoritative global archive for tropical cyclone tracks. Filtered to the Western Pacific basin and coordinates inside the Philippine Area of Responsibility, aggregated per storm. The result streams the source CSV row by row and returns the most recent storms that crossed the PAR, sorted by start time. Returns peak intensity, minimum pressure, and track period. Examples:
get_historical_typhoons_ph() # last 3 years, up to 30 storms get_historical_typhoons_ph(year=2024) # season 2024, up to 30 storms get_historical_typhoons_ph(year=2024, limit=10) # season 2024, up to 10 storms
On failure: a stream error, a response with no data rows, or a CSV header missing a required column returns a dict. data_status is "unavailable", upstream_error is true, and results is empty, with the real error text in caveats.
Inputs: year, limit. Returns: result
get_inflation_statsPhilippine consumer-price inflationARead-onlyIdempotent
Headline consumer-price inflation (year-on-year, all items) from PSA.
Source: PSA OpenSTAT Consumer Price Index, 2018-based. The tool discovers the current CPI series by text, never a hardcoded table id, and returns the most recently published month's year-on-year change. PSA publishes with a lag, so the reported period is the latest one PSA has, not always the current month. Examples:
get_inflation_stats() national headline inflation, latest month get_inflation_stats(area="NCR") one region
On failure: every failure, including an area name PSA does not list, sets data_status "unavailable" and upstream_error true, with the real error or a not-found message in caveats. validation_error stays false in every case, because a bad area name is treated as an outage here, not a caller mistake.
Inputs: area. Returns: object
get_infra_projectInfrastructure notice detailARead-onlyIdempotent
Return the full record for one infrastructure project by project_id.
This tool looks up project_id inside the same latest ~100-notice PhilGEPS window search_infra_projects reads. An id from an older window returns matched: false, not an error, because the window has already moved on. Examples:
get_infra_project("PHILGEPS-INF-003") get_infra_project("DOES-NOT-EXIST")
On failure: an empty project_id or a project missing from the current window both return matched: false with a caveat, no upstream_error, and no data_status. A PhilGEPS fetch failure returns matched: false, data_status "unavailable", upstream_error true, and the real error text in caveats.
Inputs: project_id (required). Returns: object
get_labor_statsPhilippine labor-force indicatorsARead-onlyIdempotent
Key labor-force indicators from the PSA Labor Force Survey.
Returns labor-force participation, employment, unemployment, and
underemployment rates for the latest published reference period. The PSA
key-indicator series is national only. Passing region does not filter
the figure. It only adds an explanatory caveat, because this table has
no regional breakdown. Examples:
get_labor_stats() national rates, latest reference period get_labor_stats(region="Cebu") same national rates, plus a caveat
On failure: an OpenSTAT discovery or query failure sets data_status "unavailable" and upstream_error true, with the real error in caveats. validation_error stays false in every case.
Inputs: region. Returns: object
get_latest_earthquakesLatest PHIVOLCS earthquakesARead-onlyIdempotent
Get the latest earthquake events from PHIVOLCS.
Reads the live PHIVOLCS earthquake list, the same table shown at earthquake.phivolcs.dost.gov.ph. Give center_lat, center_lon, and radius_km together to filter events near one place, and each matched event then carries a distance_km field. Give all three together, or leave out all three. Examples:
get_latest_earthquakes() latest events, default filters get_latest_earthquakes(min_magnitude=4.0, limit=10) strong events only get_latest_earthquakes(center_lat=14.5995, center_lon=120.9842, radius_km=50) near Manila
On failure: an invalid trio, an out-of-range radius_km, center_lat, or center_lon gives validation_error true and data_status "invalid_request". An unreachable or unparsable PHIVOLCS list gives upstream_error true and data_status "unavailable". Both return results: [] with the real error in caveats.
Inputs: limit, region, radius_km, center_lat, +2 more. Returns: result
get_location_hierarchyFull PSGC hierarchy for a placeARead-onlyIdempotent
Return the full chain region -> province -> city/municipality -> barangay for one PSGC code.
This tool checks that psgc_code is well-formed before it sends any request. A malformed code never reaches the network. An unknown but well-formed code, or a PSGC mirror outage, both produce an empty chain instead of a match. Check the fields named below to tell the two apart. Examples:
get_location_hierarchy("072217000") Cebu City, chain walks up through province and region get_location_hierarchy("999999999") well-formed but unknown code get_location_hierarchy("not-a-code") malformed, rejected before any network call
On failure, a malformed code returns validation_error: true, data_status "invalid_request", and chain: [], with no network call made. A genuine mirror outage during lookup or the hierarchy walk returns chain: [], upstream_error: true, and the real error in caveats. A clean unknown-code answer returns chain: [] and caveats, with neither key set.
Inputs: psgc_code (required). Returns: object
get_official_gazette_feedOfficial Gazette RSS feedARead-onlyIdempotent
Latest issuances from the Official Gazette of the Republic of the Philippines.
Reads the government's own RSS feed of proclamations, memorandum circulars, and other issuances, ten items per page, newest first. Examples:
get_official_gazette_feed() # page 1, the newest 10 issuances get_official_gazette_feed(page=2) # the next 10 issuances
On failure: a page outside 1 to 50 returns data_status "invalid_request" with validation_error true and no fetch attempted. A Cloudflare block page, the only other response this host sends on a bad call, returns data_status "unavailable" with upstream_error true and the real status and content type in caveats. An item with neither a title nor a link is dropped and counted in caveats. A page 1 response that parses as valid RSS but keeps zero issuances, whether the feed sent none or every item was dropped, is drift and returns data_status "indeterminate". A page above 1 with zero issuances is a genuine empty page and returns data_status "empty".
Inputs: page. Returns: object
get_population_statsPhilippine population statisticsARead-onlyIdempotent
Population from the PSA Census of Population, discovered live on OpenSTAT.
Defaults to the latest census PSA publishes: the 2024 Census of Population,
reference date 2024-07-01, as of 2026-09. Pass year for an older census
(2010, 2015, 2020). Every result names its census, reference date and
geography level, and for the 2024 tables the PSGC code PSA keyed the row
on. Examples:
get_population_stats() national total, latest census get_population_stats(region="NCR") one region, province or HUC by PSA label get_population_stats(region="Cebu", year=2020) get_population_stats(psgc_code="0831600000") City of Tacloban, 2024 Census get_population_stats(psgc_code="083747000") same place, 9-digit code get_population_stats(psgc_code="1380100001") one barangay, 2024 Census
On failure: data_status is "unavailable" when PSA is down, with upstream_error true. data_status is "invalid_request" for an unknown region, year, or PSGC code, with validation_error true. data_status is "empty" when a valid PSGC code has no row in the chosen census table. caveats always carries the real error text. population is None in every failure. Failures are never cached.
Inputs: year, region, psgc_code. Returns: object
get_poverty_statsPhilippine poverty incidenceARead-onlyIdempotent
Poverty incidence from the PSA Full Year Poverty Statistics table.
PSA publishes this once a year, with a lag. As of 2026-09 the latest published year is 2023. The tool discovers the current table live, so a later release shows up without a code change. It also returns the subsistence incidence when PSA publishes both tables for the same year. Examples:
get_poverty_stats() national poverty incidence, latest year get_poverty_stats(region="Bicol") one region, PSA label get_poverty_stats(region="NCR") National Capital Region
On failure: a discovery failure, a missing Incidence dimension, an unparseable year label, or a query failure sets data_status "unavailable" and upstream_error true. A region PSA does not list sets data_status "invalid_request" and validation_error true. A table with no matching incidence measure, or a cell whose values field is not a list, sets data_status "indeterminate" and upstream_error true. A published ".." cell for the region and year sets no error flag and no data_status. Check caveats instead. A subsistence-table failure sets upstream_error true on an otherwise valid poverty figure, but leaves data_status at "success".
Inputs: region. Returns: object
get_procurement_summarySummarize PhilGEPS procurementARead-onlyIdempotent
Aggregate procurement statistics over the latest notices cached from PhilGEPS.
This tool aggregates the same latest ~100-notice window search_procurement reads (6h cache). rules_evaluated names which breakdowns ran, by_mode and by_region. rules_not_computable explains why total_value_php stays null: PhilGEPS open notices do not publish approved budget amounts. Examples:
get_procurement_summary() get_procurement_summary(agency="DPWH", year=2025)
On failure: data_status "unavailable", upstream_error true, totals zero and by_mode/by_region/top_agencies empty, with the real PhilGEPS error in caveats. A year that is not a plain integer returns validation_error: true and data_status "invalid_request" before any fetch, naming the bad value.
Inputs: year, agency, region. Returns: object
get_solar_and_climateSolar irradiance and climate at a pointARead-onlyIdempotent
Daily solar irradiance and climate variables from NASA POWER for any coordinate.
Returns daily solar irradiance, 2m temperature, corrected precipitation, and 2m wind speed, in kWh per m2, Celsius, mm, and m per second. Useful for solar-site screening, farm planning, and historical climate checks. Examples:
get_solar_and_climate(14.5995, 120.9842) # Manila, last 14 days get_solar_and_climate(14.5995, 120.9842, "2026-04-01", "2026-04-02") # a fixed 2-day window
On failure: an upstream fetch failure or a non-object response body returns data_status "unavailable", with upstream_error true, days [], and the real error text in caveats. A properties or parameter field that is missing, null, or not an object returns data_status "indeterminate", with upstream_error true and days []. A start_date or end_date that does not parse as YYYY-MM-DD, an end_date before start_date, a span over 366 days, or a latitude or longitude out of range, returns data_status "invalid_request", with validation_error true and days [].
Inputs: latitude (required), longitude (required), end_date, start_date. Returns: object
get_usgs_earthquakes_phUSGS earthquakes near the PhilippinesARead-onlyIdempotent
Philippine-region earthquakes from USGS, cross-reference to PHIVOLCS.
Returns events inside the PH bounding box (lat 4..22, lng 115..130) that USGS catalogs, including international-standard Mww/Mwc magnitudes and depth solutions. Complements PHIVOLCS with global-network analysis. Give center_lat, center_lon, and radius_km together to filter to one place, and each matched event then carries a distance_km field. Give all three together, or leave out all three. Examples:
get_usgs_earthquakes_ph() last 30 days, magnitude 4.0+ get_usgs_earthquakes_ph(start_date="2026-08-01", end_date="2026-08-31") get_usgs_earthquakes_ph(center_lat=14.5995, center_lon=120.9842, radius_km=50) near Manila
On failure: an invalid trio, an out-of-range radius_km, center_lat, or center_lon gives validation_error true and data_status "invalid_request". The same happens for a start_date or end_date that is not YYYY-MM-DD. An unreachable USGS API, or a payload that is not a GeoJSON FeatureCollection, gives upstream_error true and data_status "unavailable". A nonempty features list where every feature fails to parse gives upstream_error true and data_status "indeterminate", and is never cached. All three return results: [] with the real error in caveats.
Inputs: limit, end_date, radius_km, center_lat, +3 more. Returns: result
get_vegetation_indexMODIS vegetation index at a pointARead-onlyIdempotent
NASA MODIS MOD13Q1 NDVI and EVI vegetation index at any coordinate.
NDVI (Normalized Difference Vegetation Index) ranges -1 to 1. Higher values indicate denser healthy vegetation. EVI is more sensitive in high-biomass areas. The composite period is 16 days at 250m resolution. Useful for farm monitoring, deforestation tracking, and drought checks. Examples:
get_vegetation_index(15.58, 121.0) # last ~90 days at a point in Isabela get_vegetation_index(15.58, 121.0, "2026-08-01", "2026-08-15") # a fixed 15-day window
On failure: both MODIS bands failing returns data_status "unavailable", upstream_error true, samples [], and both band errors in caveats. One band failing still returns the other band's samples, but data_status stays "unavailable" with upstream_error true. A band whose rows carry no numeric value counts as that band failing. A pixel with no composite in range, such as one over water, is a real success with samples []. A latitude or longitude out of range returns data_status "invalid_request", with validation_error true and samples []. A start_date or end_date that does not parse as YYYY-MM-DD, or a span over 366 days, also returns data_status "invalid_request", checked before any fetch.
Inputs: latitude (required), longitude (required), end_date, start_date. Returns: object
get_volcano_statusPhilippine volcano alert levelsARead-onlyIdempotent
Get current alert level for Philippine volcanoes.
Reads the WOVODAT bulletin list PHIVOLCS publishes for its monitored volcanoes: Mayon, Taal, Kanlaon, Bulusan, Pinatubo, Hibok-Hibok, and Parker. When one volcano's bulletin fetch fails, that entry carries upstream_error true and a caveat with the real error, not a null alert_level. Examples:
get_volcano_status() all monitored volcanoes, one call get_volcano_status("Mayon") one volcano by name get_volcano_status("Taal")
On failure: WOVODAT list unreachable or empty gives data_status "unavailable", upstream_error true, results: [], and the real error in caveats. An unmatched volcano_name gives a one-item list with alert_level null and a caveat, not a failure envelope.
Inputs: volcano_name. Returns: result
get_weather_alertsPAGASA weather alertsARead-onlyIdempotent
Get active PAGASA weather alerts and advisories.
The PAGASA homepage embeds alert names such as "Heavy Rainfall Warning" in its navigation menu and breadcrumbs, as well as in real active-warning sections. This tool reliably detects the "No Active Warnings" state, but it cannot yet isolate a real active warning from that navigation text. To avoid a fabricated advisory, this tool returns a bare empty list only for the confirmed "no active warnings" marker. For real-time advisories, call bagong.pagasa.dost.gov.ph directly. Examples:
get_weather_alerts() no region argument get_weather_alerts(region="NCR") region only changes the cache key
On failure, when the PAGASA homepage is unreachable, this tool returns data_status "unavailable", upstream_error: true, results: [], and the real error in caveats. When the page is reachable but the "no active warnings" marker does not match, this tool returns data_status "indeterminate" instead of guessing, and never caches that response.
Inputs: region. Returns: result
get_weather_forecastPhilippine weather forecastARead-onlyIdempotent
Get the weather forecast for a Philippine location.
Uses the PAGASA TenDay API when PAGASA_API_TOKEN is set, and falls
back to Open-Meteo when the token is absent or the PAGASA call fails.
This tool sets no data_status field on a success or an
unknown-location result. Check data_source and caveats instead.
Examples:
get_weather_forecast("Manila") 3-day default forecast get_weather_forecast("Cebu City", days=2) 2-day forecast get_weather_forecast("Wakanda") unknown location, no coordinates found
On failure, a location with no known coordinates returns days: [] and a caveat, with no data_status or upstream_error key. An Open-Meteo fetch failure, or a PSGC outage during location resolution, returns data_status "unavailable", upstream_error: true, days: [], and the real error in caveats. An Open-Meteo response with no daily forecast entries returns data_status "indeterminate" instead, and is never cached.
Inputs: location (required), days. Returns: object
get_world_bank_indicatorWorld Bank indicator for the PhilippinesARead-onlyIdempotent
World Bank macroeconomic and social indicator for the Philippines.
Accepts a World Bank indicator code, such as "NY.GDP.MKTP.CD", or a friendly alias, such as "gdp", "poverty_ratio", "inflation", or "urban_population_pct". The tool checks the indicator code shape before it reaches the URL, so a bad value cannot redirect the request to another country's data. Examples:
get_world_bank_indicator("gdp") # GDP, latest 20 years get_world_bank_indicator("NY.GDP.MKTP.CD", per_page=5) # same indicator, 5 years get_world_bank_indicator("poverty_ratio") # poverty headcount ratio
On failure: an indicator code or alias that fails the shape check returns data_status "invalid_request", with validation_error true and observations []. An upstream fetch failure returns data_status "unavailable", with upstream_error true, observations [], and the real error text in caveats. A row with a non-numeric or non-finite value (NaN, inf) is skipped and counted in caveats. A response where every row is non-numeric or non-finite returns data_status "unavailable" instead of a false empty answer.
Inputs: indicator (required), per_page. Returns: object
list_admin_unitsList Philippine administrative unitsARead-onlyIdempotent
Browse children of a PSGC node, or top-level regions when parent_code is None.
An unrecognized parent_code or level filter matches no children and returns an empty list. This tool never returns validation_error. A malformed argument degrades to an empty result instead of a failure. Examples:
list_admin_units() top-level regions list_admin_units(parent_code="072200000") children of Cebu province list_admin_units(level="city-municipality", limit=10) first 10 cities and municipalities
On failure, only a PSGC API outage returns a failure envelope: data_status "unavailable", upstream_error: true, results: [], and the real error in caveats. A malformed parent_code or level returns an empty list instead of this failure shape.
Inputs: level, limit, offset, parent_code. Returns: result
list_pagasa_advisory_filesPAGASA public advisory, bulletin, and storm surge filesARead-onlyIdempotent
List PAGASA public PDF files from a pubfiles directory listing, newest first.
Reads the nginx directory index PAGASA publishes at pubfiles.pagasa.dost.gov.ph/tamss/weather// and returns each PDF's name, URL, last-modified time, and size. This tool returns file URLs only, never PDF bytes, so fetch a PDF yourself if you need its contents. Examples:
list_pagasa_advisory_files() latest weather advisories list_pagasa_advisory_files(kind="bulletin", limit=5) 5 newest cyclone bulletins list_pagasa_advisory_files(kind="stormsurge") storm surge folder, flagged stale
On failure: an unknown kind, or a limit outside 1 to 100, gives validation_error true and data_status "invalid_request". A 404, a body with no directory listing, zero parsed files, or a parser error on a 200 body gives data_status "indeterminate". A transport failure or a non-2xx status gives data_status "unavailable". All three carry files: [] and the real error in caveats.
Inputs: kind, limit. Returns: object
query_psa_datasetQuery a PSA OpenSTAT datasetARead-onlyIdempotent
Run one bounded query against a PSA OpenSTAT dataset.
Every dimension needs an explicit list of value codes from describe_psa_dataset. That is a hard requirement, not a convention. PXWeb expands an unselected dimension to all of its values, and PSA answers the resulting full-cube request with an HTTP 403. PSA writes a missing cell as "..", and those come back as null, never zero. Examples:
one dataset, every dimension given an explicit code list
query_psa_dataset( "1F/FY/0241F3DF013.px", {"Year": ["2"], "Major Island Group": ["0", "2"], "Among Families/Population": ["0"]}, )
On failure: a bad path, a bad max_rows, or a rejected selection (a missing dimension, an unknown code, or "all"/"*") sets validation_error true and data_status "invalid_request", before any request goes out. An OpenSTAT outage sets upstream_error true and data_status "unavailable". A zero-row reply for a nonzero selection, or a row whose key does not map to the declared columns, sets data_status "indeterminate" and upstream_error true on a real HTTP 200. All four cases return an empty rows list.
Inputs: selections (required), dataset_path (required), max_rows. Returns: Normalized rows from one bounded query, or a failure envelope.
resolve_ph_locationResolve a Philippine place name to PSGCARead-onlyIdempotent
Fuzzy-resolve a Philippine place name to its canonical PSGC record.
Handles common nicknames directly, such as "QC", "Gensan", "CDO", and
"Metro Manila". An ambiguous name such as "San Juan" still returns one
best match, plus an alternatives list of the other candidates. This
tool sets no data_status field on any path. Check matched and
upstream_error instead. Examples:
resolve_ph_location("Cebu City") exact city match resolve_ph_location("QC") nickname resolves to Quezon City resolve_ph_location("San Juan") ambiguous name, returns alternatives
On failure, a clean no-match returns matched: false and caveats, with no upstream_error key at all. When the PSGC API itself is unreachable, it returns matched: false, upstream_error: true, and the real error in caveats.
Inputs: query (required). Returns: object
search_hdx_datasetsSearch HDX for Philippine humanitarian datasetsARead-onlyIdempotent
Search HDX for Philippine humanitarian datasets by keyword.
Calls the CKAN package_search action filtered to the Philippines
country group and returns matching datasets, most recently modified
first, each with its own license and up to 20 resources. Examples:
search_hdx_datasets("flood") datasets matching "flood" search_hdx_datasets("food prices", rows=5) 5 most recently modified matches
On failure: an empty query, a query over 200 characters, a query with a control character, or a rows value outside 1 to 50 gives validation_error true and data_status "invalid_request". An unreachable HDX API gives upstream_error true and data_status "unavailable". A response whose success field is not true, or whose result.results field is not a list, gives upstream_error true and data_status "indeterminate". Datasets sent beside a missing or non-integer count also give data_status "indeterminate", with the parsed datasets kept and never cached: CKAN always sends a real count, so a bad one is drift even when the datasets read fine. Zero datasets on a clean query with a real integer count gives data_status "empty", never a failure, and still caches. Every dataset carries its own license_id: read it before you reuse a resource.
Inputs: query (required), rows. Returns: object
search_infra_projectsSearch infrastructure noticesARead-onlyIdempotent
Search Philippine government infrastructure projects.
Backed by PhilGEPS open notice listing filtered for infra-related work (construction / road / bridge / flood control / drainage / school building / civil works). Source: https://www.philgeps.gov.ph/. Approved budget amounts are not published in the open notice listing, so cost_php is null in most records. min_cost_php almost never matches, because the open listing omits approved budget for nearly every record. The DPWH transparency portal API is currently blocked by Cloudflare and not used. Examples:
search_infra_projects(keyword="flood control") search_infra_projects(region="ncr") search_infra_projects(min_cost_php=100_000_000)
On failure: returns {results: [], upstream_error: true, data_status: "unavailable", caveats: [...]} instead of a bare list, with the real upstream error in caveats. This tool never checks an argument before the PhilGEPS fetch runs, so validation_error is always false.
Inputs: year, limit, region, status, +3 more. Returns: result
search_procurementSearch PhilGEPS procurement noticesARead-onlyIdempotent
Search PH government procurement from PhilGEPS open data.
Note: the PhilGEPS public portal does not expose server-side search for external clients, so this tool fetches the latest ~100 bid notices and filters them in-memory. Data is cached 6 hours. Keyword/agency/region filters are applied client-side (case-insensitive substring match). Examples:
search_procurement(keyword="flood") search_procurement(keyword="", agency="DPWH", limit=10)
On failure: returns {results: [], upstream_error: true, data_status: "unavailable", caveats: [...]} instead of a bare list, so an outage is never read as "no matching notices". A date_from or date_to that does not parse returns {results: [], validation_error: true, data_status: "invalid_request"} before any fetch, naming the bad value.
Inputs: keyword (required), limit, agency, region, +2 more. Returns: result
search_psa_catalogSearch the PSA OpenSTAT catalogARead-onlyIdempotent
Find a PSA OpenSTAT dataset by keyword, without browsing level by level.
Matches a case-insensitive substring against every dataset title and path in the catalog. The first call after a cold start walks the whole ~2,900-table tree and can take a few minutes. The flattened index then caches for 24 hours, so a later search answers from memory. Examples:
search_psa_catalog("fertility") datasets with "fertility" in the title or path search_psa_catalog("poverty incidence", limit=5) at most 5 matches
On failure: data_status is "invalid_request" for an empty keyword or a bad limit, and "unavailable" for an OpenSTAT outage during the catalog walk. validation_error or upstream_error is set to match. The real error sits in caveats. Neither failure is cached.
Inputs: keyword (required), limit. Returns: Dataset titles and paths matching a keyword, or a failure envelope.
search_psic_codesPSIC industrial classification searchARead-onlyIdempotent
Find a PSIC code by description keyword or by code prefix.
Matches a query of only digits against the PSIC code prefix. Matches any other query by whole-word text against the class description, case-insensitive. PSA publishes the full table (roughly 1,360 rows) on one page, so the first call fetches and caches it for 24 hours. Examples:
search_psic_codes("rice") every description with "rice" as a whole word search_psic_codes("0111") every code that starts with "0111" search_psic_codes("mining", limit=5) at most 5 matches
On failure: data_status is "invalid_request" for an empty, over-long, or non-printable query, or for a limit outside 1-100. A Cloudflare challenge in place of the table gives "unavailable". A missing, empty, or partial PSIC table gives "indeterminate". Neither failure is cached, and the real error sits in caveats.
Inputs: query (required), limit. Returns: object
summarize_infra_spendingSummarize infrastructure spendingARead-onlyIdempotent
Aggregate infrastructure procurement statistics over the latest PhilGEPS window.
This tool aggregates the same infra-keyword-matched notice window search_infra_projects reads (cached 6h). rules_evaluated names which breakdowns ran, today by_category and by_region. rules_not_computable names by_funding_source, retired to an always-empty dict because PhilGEPS notices carry no funding source field. sample_size and sufficient_for_per_capita flag whether the window, today under the 500-notice threshold, is large enough for a per-100k rate. Examples:
summarize_infra_spending() summarize_infra_spending(region="ncr", year=2025)
On failure: data_status "unavailable", upstream_error true, totals zero and by_category/by_region/top_agencies empty, with the real PhilGEPS error in caveats. No validation_error path exists.
Inputs: year, region, funding_source. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
Each tool targets a distinct data source and action—earthquake events, bulletin details, active vs historical typhoons, forecast vs alerts, and separate catalog search/query/browse functions—so there is no real ambiguity.
Names overwhelmingly follow get_/search_/list_/browse_/query_ + noun with underscores; minor inconsistency from _ph suffixes on some earthquake/typhoon tools but not on others.
The 29 described tools (41 claimed) exceed the typical 15-tool sweet spot, but the broad multi-agency Philippine civic-data scope gives most tools a distinct niche; still heavy enough to feel sprawling.
Coverage is impressively broad—health, disasters, weather, procurement, PSA/OpenSTAT, HDX, gazette, elections, location hierarchy—but compare_areas references a get_area_profile helper that is not exposed, leaving a small functional gap.
Maintenance
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
Agent-native MCP server over 49M+ US public and government records, privacy-first, always current.
Bangladesh's first national public data MCP server and REST API (mcp-bangladesh). Combines 8 live Bangladesh government datasets into a single free, zero-auth endpoint: DGHS dengue and measles stats, FFWC river flood levels (44 stations), BPDB power generation (40 plants), district weather, city air quality (AQI), 6 ministry notice boards, Bangladesh Bank forex/inflation, and geography.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for the Philippine Standard Geographic Code (PSGC) API. Gives AI agents structured access to the full PH geographic hierarchy - regions, provinces, cities, municipalities, and barangays.13 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server that connects AI agents to over 200 tools across 27 Brazilian public APIs, covering economic, legislative, transparency, and judicial data. It enables users to query and cross-reference extensive government datasets from sources like IBGE, the Central Bank, and the Brazilian Congress.71,885MIT
- AlicenseAqualityBmaintenanceMCP server giving AI agents structured access to Canadian federal, provincial, and municipal government data.5106 PyPI63MIT
- AlicenseAqualityDmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.61MIT