Geonames MCP Server logo

Geonames MCP Server

GeoNames MCP tools for place search, reverse geocoding, hierarchies, postal codes, and country reference data.

Install Geonames MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "geonames-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/geonames-mcp-server"
      ],
      "env": {
        "GEONAMES_USERNAME": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

geonames-mcp-server connects MCP clients to the GeoNames gazetteer, covering place search, detailed records, administrative trees, reverse geocoding, postal codes, and country facts. It exposes eight tools through either STDIO or Streamable HTTP and requires a GeoNames username for local use. Reach for it when an agent needs structured geographic context, such as resolving coordinates, exploring parent or child regions, or identifying places by feature type.

Use cases

  • Search for places by name, country, feature type, or bounding box
  • Resolve coordinates to countries and administrative subdivisions
  • Walk parent or child relationships in the GeoNames hierarchy
  • Find postal codes near a coordinate or place
  • Retrieve country metadata and geographic reference codes

Key features

  • Eight GeoNames lookup tools over MCP
  • STDIO and Streamable HTTP transports
  • Place search with pagination and geographic filters
  • Reverse geocoding with nearby-place queries
  • Administrative, tourism, and dependency hierarchies
  • Postal-code and country reference data

Tools8

What Geonames MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~228 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 42d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · @cyanheads/geonames-mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads990Package downloads in the last 30 days.
Last commit14d agoMost recent push to the default branch.
Tools exposed8Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Geonames MCP Server works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Geonames MCP Server

geonames-mcp-server is an MCP server that connects AI clients to the GeoNames gazetteer. Its main tools search places, retrieve detailed records, traverse administrative hierarchies, reverse geocode coordinates, find postal codes, return country facts, and list GeoNames feature reference data through STDIO or Streamable HTTP.

Install the `@cyanheads/geonames-mcp-server` npm package and set `GEONAMES_USERNAME` to a GeoNames username. Claude Desktop, Cursor, and VS Code have installation links, and local client configurations can launch the package with `npx`.

Yes, geonames-mcp-server provides a Cursor installation link. The configuration launches the npm package with `npx` and supplies the `GEONAMES_USERNAME` environment variable.

Yes, reverse geocoding returns an ocean for offshore coordinates and can list nearby places or features. A coastal buffer from 0 to 50 km can also match the nearest country for shoreline, harbor, or pier coordinates.

A place record can include administrative levels, timezone offsets, bounding box, recorded and DEM elevation, population, Wikipedia URL, alternate names, postal codes, links, and identifiers such as IATA, ICAO, FAA, UN/LOCODE, and Wikidata.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGeonames MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/geonames-mcp-server?style=directory)](https://allmcps.com/mcp/geonames-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/geonames-mcp-server"><img src="https://allmcps.com/api/badge/geonames-mcp-server?style=directory" alt="Geonames MCP Server on AllMCPs" /></a>