MCP Server

Connect any AI assistant to countries.dev through the Model Context Protocol. A hosted, no-key MCP endpoint that exposes country, city, postal-code, distance and IP-geolocation tools over Streamable HTTP.

countries.dev runs a hosted MCP server, so AI assistants like Claude, Cursor and ChatGPT can query country and geographic data directly — no API key, no install, no local process.

Endpoint

https://countries.dev/api/mcp

It speaks the Streamable HTTP transport (MCP spec 2025-06-18, with 2025-03-26 and 2024-11-05 negotiated for older clients). It's stateless and read-only — point any MCP client at the URL and the tools appear.

Connect your client

claude mcp add --transport http countries https://countries.dev/api/mcp

Add to ~/.cursor/mcp.json (or a project's .cursor/mcp.json):

{
  "mcpServers": {
    "countries": { "url": "https://countries.dev/api/mcp" }
  }
}

Settings → Connectors → Add custom connector, then paste the URL:

https://countries.dev/api/mcp

For older builds that only speak stdio, bridge with mcp-remote:

{
  "mcpServers": {
    "countries": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://countries.dev/api/mcp"]
    }
  }
}

In Settings → Connectors → Add, choose a custom MCP server and enter:

https://countries.dev/api/mcp

Any client that follows the standard mcpServers schema:

{
  "mcpServers": {
    "countries": {
      "type": "http",
      "url": "https://countries.dev/api/mcp"
    }
  }
}

Tools

ToolWhat it does
get_countryRecord for one country by ISO code or name.
list_countriesList or filter countries by region, subregion, currency, language, calling code or timezone.
get_bordersFull records of the countries bordering a given one.
search_citiesSearch cities by name and/or country, ordered by population.
search_placesSearch the full GeoNames gazetteer — mountains, lakes, parks, landmarks and more.
reverse_geocodeNearest cities to a latitude/longitude.
distanceGreat-circle distance between two cities or coordinate pairs.
lookup_postal_codeResolve a postal / ZIP code to its place, region and coordinates.
geolocate_ipCountry for an IPv4 or IPv6 address.
random_countryA random country — for quizzes and sample data.
list_reference_dataDistinct regions, subregions, currencies, languages or time zones.

Each tool maps directly to a REST endpoint, so results match the documented API exactly.

Country results are lean by default to keep payloads small. Tools that return countries (get_country, list_countries, get_borders, random_country, geolocate_ip) take an optional fields argument — pass "full" for the complete record, or a comma-separated list to pick exact fields.

Try it

Once connected, ask your assistant something like:

"What's the capital and currency of Japan, and how far is Tokyo from Osaka?"

It'll call get_country and distance and answer from live data.

Test it yourself

The endpoint is a normal HTTP server — list the tools with one curl:

curl -s https://countries.dev/api/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

On this page