Skip to main content

MCP server for PostalDataPI — postal code lookups for AI agents

Project description

PostalDataPI MCP Server

License: MIT Python 3.10+ PyPI

MCP (Model Context Protocol) server for PostalDataPI — lets AI agents look up, validate, and search postal codes across 240+ countries and territories with rich metadata: timezone, administrative regions, elevation, and coordinates.

Tools

Tool Description
lookup_postal_code Get city, state/region, and abbreviation for a postal code (US ZIP, UK postcode, German PLZ, etc.)
validate_postal_code Check if a postal code exists in a country
search_by_city Find all postal codes for a city
get_postal_code_metadata Full metadata: coordinates, admin hierarchy, timezone, elevation, and more

Setup

1. Get an API Key

Sign up at postaldatapi.com/register — 1,000 free queries, no credit card required.

2. Install

pip install postaldatapi-mcp

3. Configure with Claude Code

claude mcp add --transport stdio postaldatapi -- \
  env POSTALDATAPI_KEY=your_api_key_here postaldatapi-mcp

4. Configure with Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "postaldatapi": {
      "command": "postaldatapi-mcp",
      "env": {
        "POSTALDATAPI_KEY": "your_api_key_here"
      }
    }
  }
}

Usage

Once configured, ask Claude naturally:

  • "What city is ZIP code 90210?"
  • "Look up UK postcode SW1A"
  • "Is 10115 a valid German postal code?"
  • "What are the postal codes for Beverly Hills, CA?"
  • "Get the coordinates for postal code 100-0001 in Japan"

Claude will automatically use the PostalDataPI tools to answer.

Supported Countries

240+ countries and territories including US, UK, Canada, Germany, France, Japan, Australia, Brazil, India, and many more. See the full list at postaldatapi.com/countries.

Rich Metadata

Beyond basic lookups, the get_postal_code_metadata tool returns up to 18 fields per postal code including:

  • Coordinates (latitude, longitude)
  • Timezone (e.g., America/Mexico_City, Europe/Berlin)
  • Administrative hierarchy (state/province, county, municipality)
  • Elevation (meters above sea level)
  • Place name and country information

Example response for Mexico City 06000:

{
  "postalCode": "06000",
  "country": "MX",
  "placeName": "Centro",
  "latitude": 19.4364,
  "longitude": -99.1553,
  "timezone": "America/Mexico_City",
  "adminLevel1": "Ciudad de México",
  "adminLevel2": "Cuauhtémoc",
  "elevation": 2239
}

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postaldatapi_mcp-0.2.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

postaldatapi_mcp-0.2.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file postaldatapi_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: postaldatapi_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for postaldatapi_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 784d413d3426b56e448a17a7c31140bfe5c36a766766399d7ecd4edffe8502c3
MD5 98d728d769db747f6b14f0394c0be639
BLAKE2b-256 30311dda2c265bfed5f75c4f0b6b8aee996edc8c95c4b6de8595f36f70531587

See more details on using hashes here.

File details

Details for the file postaldatapi_mcp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for postaldatapi_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74c5539f60b4ced8707f2a828a83ee7ce884d7694914f8cce67c3e5e539a42b6
MD5 530ec15d93d6125fc6a51acc89bc53c0
BLAKE2b-256 dcfb86b101eb0ee63193fd397ba59ec407cff45b508a93194a732e024aca8d4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page