If your AI assistant can speak the Model Context Protocol, it can now query countries.dev directly. There's one hosted URL to add — no key, no install, no local server to keep running.
The endpoint
https://countries.dev/api/mcpIt's a remote MCP server over the Streamable HTTP transport, so any compatible client connects with just the URL.
Add it to your client
# Claude Code
claude mcp add --transport http countries https://countries.dev/api/mcpFor Cursor, ChatGPT and others, drop the URL into the standard config:
{
"mcpServers": {
"countries": { "url": "https://countries.dev/api/mcp" }
}
}What the model gets
A set of read-only tools, each mapping to a documented REST endpoint:
get_country/list_countries/get_borders— countries by code or name, filtered lists, and neighbourssearch_cities/search_places— cities by population, or the full GeoNames gazetteer (mountains, lakes, landmarks)reverse_geocode/distance— coordinates to a place name, and great-circle distance between two pointslookup_postal_code— ZIP/postal code to place and coordinatesgeolocate_ip— country for an IP addressrandom_country/list_reference_data— a random country, and the distinct regions/currencies/languages/timezones
So a prompt like "how far is Tokyo from Osaka, and what currency do they use?" resolves against live data instead of the model's memory.
Country results are lean by default — the bulky translations, altSpellings, maps and regionalBlocs fields are dropped unless you ask for them with fields: "full". The same applies to the REST API via ?full=true.
It's just HTTP
The server is stateless and standards-compliant, so you can poke it without any MCP client at all:
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"}'New here? Start on the MCP server page. Prefer raw REST? Every tool is also a plain endpoint — see the API reference or the MCP setup guide.
Written by
Dov Azencot
At
Thu Jun 25 2026