# geonames-mcp-server [Health: Active]

**Category:** 🗺️ Location Services  
**Repository:** https://github.com/cyanheads/geonames-mcp-server  
**GitHub Stars:** 2  
**npm Downloads (last month):** 990  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/geonames-mcp-server

## Description
Search GeoNames places, walk admin hierarchies, reverse geocode, get postal codes and country info.

## Tools
Capabilities this server exposes over MCP:

- **geonames_search_places** — Search places by name, country, admin division code, feature class or code, population tier, and bounding box
- **geonames_get_place** — Full record for one `geonameId`: admin chain, timezone, elevation, alternate names, postal codes, external identifiers
- **geonames_get_hierarchy** — Parent chain from Earth and the continent down to the feature
- **geonames_get_children** — Direct children of a feature in the administrative, tourism, or dependency tree
- **geonames_reverse_geocode** — Country and admin subdivisions (or the ocean) for a coordinate, plus the nearest places or features and an optional timezone
- **geonames_find_postal_codes** — Postal codes by code, by place name, or near a coordinate
- **geonames_get_countries** — Country facts: ISO and FIPS codes, `geonameId`, capital, population, area, languages, currency, postal-code format
- **geonames_list_reference** — Feature classes, feature codes, and the countries with postal-code data

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "geonames-mcp-server": {
    "command": "npx",
    "args": ["-y","@cyanheads/geonames-mcp-server"],
    "env": {
      "GEONAMES_USERNAME": ""
    }
  }
}
```

**Requires environment variables:** `GEONAMES_USERNAME` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What geonames-mcp-server does

geonames-mcp-server exposes GeoNames geographic data through MCP. GeoNames contains more than 13 million places worldwide, organized into relationships that can run from Earth and continents through countries, administrative divisions, and local features.

The server covers several related lookup patterns. Agents can search by name or geographic filters, retrieve a complete record for a known `geonameId`, inspect parent and child relationships, resolve coordinates to countries and subdivisions, find postal codes, retrieve country facts, and inspect GeoNames reference classifications.

## How it works

The server can run locally over STDIO or be reached through Streamable HTTP. A public hosted endpoint is available at `https://geonames.caseyjhand.com/mcp`. Local operation uses the GeoNames service and a username supplied through configuration.

Search requests support name matching, country and administrative filters, feature classes and codes, population tiers, and bounding boxes. Results include pagination information such as `totalCount`, `effectiveQuery`, and `nextOffset`. Validation catches conditions such as missing search criteria, invalid country or feature codes, unscoped administrative codes, incompatible feature filters, and invalid bounding boxes before a request is sent.

Reverse geocoding identifies the country and administrative levels for a coordinate, or returns an ocean for offshore locations. It can also find nearby places or typed features, apply a coastal country buffer, and include timezone information. Hierarchy and child lookups return structured GeoNames relationships, including notices for unknown IDs, leaf features, or incomplete trees.

## Setup and configuration

Install the npm package with the `@cyanheads/geonames-mcp-server` package name and configure the `GEONAMES_USERNAME` environment variable with a GeoNames username. The repository also provides a Docker image and an install flow for supported MCP clients.

Claude Desktop, Cursor, and VS Code are named installation targets. Cursor and VS Code configurations use `npx` to launch the package, while the server can also be connected through the hosted Streamable HTTP endpoint.

## Tools and capabilities

- `geonames_search_places` searches by query, country, administrative code, feature class or code, city population tier, and bounding box.
- `geonames_get_place` returns administrative links, timezone, elevation, population, alternate names, postal codes, external identifiers, and related links for one place.
- `geonames_get_hierarchy` walks from Earth and the continent through the country and administrative levels to a feature.
- `geonames_get_children` lists direct administrative, tourism, or dependency children, with filtering and pagination.
- `geonames_reverse_geocode` resolves coordinates to countries, subdivisions, nearby places or features, and optional timezone data.
- `geonames_find_postal_codes` looks up postal codes by code, place name, or proximity to coordinates.
- `geonames_get_countries` returns country codes, capital, population, area, languages, currency, and postal-code format.
- `geonames_list_reference` exposes feature classes, feature codes, and countries with postal-code data.

## Limitations and notes

GeoNames may return fewer postal codes directly linked to a place than a postal-code search returns for that same location. Administrative codes are GeoNames codes rather than ISO 3166-2 or postal codes, and levels two through four require a first-level administrative scope.

Several results are capped per call. Place searches are limited to 100 returned records per request, child lookups to 500, and nearby results to 50, with notices and pagination guidance when more data is available. Child results are cached after fetching up to 1,000 children for a parent.

Tourism and dependency trees can fall back to administrative children when GeoNames has no separate tree. Reverse geocoding can identify offshore points as ocean locations, while a coastal buffer can match a nearby country without changing the exact coordinate used for nearby and timezone lookups.

The project is licensed under Apache-2.0.

_Full upstream README: https://allmcps.com/mcp/geonames-mcp-server/readme_

