PSGC MCP Server

PSGC MCP Server

psgc-mcp-godmodearch•bygodmodearch

A Model Context Protocol server that offers Philippine Standard Geographic Code data to LLMs, hosted on Cloudflare Workers with KV storage.

License: MIT•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Provides tools to look up geographic entities by 10-digit PSGC code, search by name, and retrieve full administrative hierarchies from barangay to region.
  • •Supports listing children of a parent entity, listing all entities at a geographic level, and batch lookups of up to 50 codes.
  • •Enables querying entities by population range with sorting and filtering, excluding entities with null population.
  • •Covers geographic levels including regions, provinces, districts, cities, municipalities, sub-municipalities, special geographic units, and barangays.

BEST FOR

  • •Finding the largest cities or municipalities within a population threshold, such as municipalities under 50,000 people.
  • •Resolving exact place names without ambiguous partial matches by using strict search mode.
  • •Retrieving the full administrative chain of a location for geographic context.

ABOUT PSGC-MCP-GODMODEARCH

PSGC MCP Server is cataloged as an MCP server attributed to godmodearch. A Model Context Protocol server that offers Philippine Standard Geographic Code data to LLMs, hosted on Cloudflare Workers with KV storage. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for PSGC MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does the server require authentication?

No, it is described as public, read-only, and requiring no authentication.

Where does the geographic data come from?

Data is sourced from the Philippine Statistics Authority quarterly PSGC publication and cached in Cloudflare KV.

Upstream README

View this exact version on GitHub

README.md · fce99efe18be · Fetched 2026-11-13 11:56:05 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

PSGC MCP Server

npm version Cloudflare Workers TypeScript License: MIT

A Model Context Protocol server that provides Philippine Standard Geographic Code (PSGC) data to LLMs. Built on Cloudflare Workers with KV storage.

Public, read-only, no authentication required. Data sourced directly from the Philippine Statistics Authority quarterly PSGC publication. Cached in Cloudflare KV for reliability and low-latency global access.

psgc-mcp MCP server

Tools

ToolDescription
lookupFetch a geographic entity by its 10-digit PSGC code
searchSearch entities by name with optional level filter and strict mode
get_hierarchyGet the full administrative chain (barangay to region)
list_childrenList direct children of a parent entity
list_by_typeList all entities at a given geographic level
batch_lookupLook up multiple entities in one call (max 50 codes)
query_by_populationQuery entities by population range with sorting and filtering

Geographic Levels

LevelDescriptionCount
RegRegion18
ProvProvince82
DistDistrict (NCR only)4
CityCity149
MunMunicipality1,493
SubMunSub-Municipality (Manila only)16
SGUSpecial Geographic Unit (BARMM)~8
BgyBarangay~42,000

Response Format

All data responses are wrapped in a standard envelope:

{
  "_meta": {
    "dataset_version": "PSGC Q4 2025",
    "dataset_date": "2025-12-31",
    "last_synced": "2026-03-02",
    "source": "Philippine Statistics Authority (PSA)",
    "source_url": "https://psa.gov.ph/classification/psgc/"
  },
  "data": { ... }
}

Error responses (isError: true) and informational messages (e.g. "No children found") are returned as plain text without wrapping.

Entity Schema

Entity objects returned by lookup, get_hierarchy, list_children, list_by_type, batch_lookup, and query_by_population use snake_case field names:

FieldTypeDescription
psgc_codestring10-digit PSGC code
namestringOfficial place name
levelstringGeographic level (Reg, Prov, Dist, City, Mun, SubMun, SGU, Bgy)
old_namestring | nullPrevious name, if renamed
city_classstring | nullCity classification: HUC, ICC, CC, or null
income_classstring | nullIncome classification (1st through 6th)
urban_ruralstring | nullUrban/Rural classification (barangays only)
populationnumber | null2024 Census population count
parent_codestring | nullPSGC code of parent entity

All fields are always present. Fields without data are null, never omitted.

Search Results

The search tool returns a lighter result object:

FieldTypeDescription
psgc_codestring10-digit PSGC code
namestringOfficial place name
levelstringGeographic level

The search tool accepts an optional strict boolean parameter. When strict: true, only exact name matches are returned (after normalization). Partial and substring matches are excluded. Useful when you know the exact place name and want to avoid ambiguous results.

Batch Lookup

The batch_lookup tool accepts an array of 1-50 PSGC codes and returns results in the same order as input. Codes not found return null at their position.

FieldTypeDescription
results(Entity | null)[]Entities in input order, null for not found
foundnumberCount of codes that resolved
not_foundnumberCount of codes that returned null
totalnumberTotal codes requested

Query by Population

The query_by_population tool finds entities within a population range, sorted by population. Useful for questions like "largest cities in Region III" or "municipalities under 50,000 people."

ParameterTypeRequiredDescription
levelstringYesGeographic level to query
parent_codestringBgy onlyScope results to a parent entity (prefix matching). Required for barangays.
min_populationnumberNoMinimum population (inclusive)
max_populationnumberNoMaximum population (inclusive)
sortasc | descNoSort order (default: desc)
limitnumberNoMax results, 1-100 (default: 10)

Response includes results (entity array), total_matching (total before limit), and returned (actual count returned). Entities with null population are excluded.

Connect

Add to your MCP client configuration:

{
  "mcpServers": {
    "psgc": {
      "url": "https://psgc.godmode.ph/mcp"
    }
  }
}

Quick test

curl -X POST https://psgc.godmode.ph/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "search",
      "arguments": { "query": "Carmona", "level": "Mun" }
    }
  }'

PSGC Code Format

PSGC codes are 10 digits with no spaces. The segments encode the full geographic hierarchy:

1 4 0 2 1 0 0 0 0 0
│ │ └─┬─┘ └─┬─┘ └─┬─┘
│ │   │     │     └── Barangay (last 3 digits)
│ │   │     └──────── Municipality/City (3 digits)
│ │   └────────────── Province (2 digits)
│ └────────────────── Island Group modifier
└──────────────────── Region (1 digit)

Leading zeros are significant — 014021000000 and 14021000000 are different codes. Always use the full 10-digit string.

Known edge cases:

  • NCR uses Districts instead of Provinces (Dist level)
  • Cotabato City is administratively in BARMM but geographically in Region XII — it appears under Prov code 124700000 (Maguindanao del Norte)
  • BARMM Special Geographic Units (SGU) don't follow the standard hierarchy and have no Province parent

Data Sources

SourceVintageDescription
PSA PSGC PublicationQ4 2025 (January 13, 2026)Geographic codes, names, levels, classifications
2024 Census of PopulationProclamation No. 973Population counts per entity
PSA PSGC Old Names columnQ4 2025Historical/previous place names
PSA PSGC Urban/Rural columnQ4 2025Barangay urban/rural classification

Last synced: March 2, 2026.

Breaking Changes (v1.1.0+)

  • All data responses are now wrapped in { _meta, data }. Consumers must unwrap data from the response.
  • Entity field names changed to snake_case: code is now psgc_code, parent is now parent_code, cityClass is now city_class, etc.
  • Search results use psgc_code instead of code.
  • All entity fields are always present. Previously optional fields now appear as null instead of being omitted.
  • Internal fields regionCode and provinceCode are no longer exposed in API responses.

Part of a suite of Philippine public data MCP servers:

  • PSGC MCP (this repo)
  • LTS MCP - DHSUD License to Sell verification
  • PH Holidays MCP -> Coming soon
  • BSP Bank Directory MCP -> Coming soon

All servers are free, public, and read-only. Data pulled from official Philippine government sources.

Contributing and Issues

Found a data error or an edge case that isn't handled? Open an issue. The quirks section above covers the most common ones, but PSGC data has accumulated inconsistencies over decades of LGU reclassifications and the issues list is the best place to track them.

PSA publishes updates quarterly. If the data looks stale, open an issue and it will be refreshed ahead of the next scheduled sync.

Data Pipeline

The PSGC data is parsed from PSA's Excel publication and stored in Cloudflare KV. To update:

1. Download the PSGC Excel file

Get the latest publication from PSA PSGC and place it in scripts/data/.

2. Diff (optional)

npm run diff-psgc -- "scripts/data/Q3 2025/PSGC-3Q-2025-Publication-Datafile.xlsx" "scripts/data/PSGC-4Q-2025-Publication-Datafile (1).xlsx"

Compares two quarterly Excel files and reports additions, removals, name changes, and field changes. Run this before the full parse to verify PSA's changelog.

3. Parse

npm run parse-psgc

Reads the Excel file, derives parent relationships, and writes chunked JSON files to scripts/data/output/.

4. Upload to KV

npm run upload-kv

Bulk uploads all JSON chunks to Cloudflare KV via wrangler.

5. Deploy

npm run deploy

Development

npm install
npm run dev

Dev server starts at http://localhost:8787. Connect your MCP client to http://localhost:8787/mcp.

Setup

Before first deploy, create the KV namespace:

npx wrangler kv namespace create PSGC_KV

Update wrangler.jsonc with the returned namespace ID.

Built by

Aaron Zara - Fractional CTO at Godmode Digital

Previously built REN.PH, a programmatic real estate platform with 60,000+ structured geographic pages covering every barangay, city, and province in the Philippines. The PSGC MCP came out of needing reliable, queryable PH geography data for AI agents and not finding anything that fit.

For enterprise SLAs, custom integrations, or other PH data sources: → godmode.ph

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for PSGC MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/psgc-mcp-godmodearch)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research