CSC

MCP server

Connect Country State City data to Claude Desktop and other AI assistants via Model Context Protocol.

Overview

The Model Context Protocol (MCP) integration allows you to connect location data directly to Claude Desktop and other MCP-compatible AI assistants. Query countries, states, and cities through natural language.

Setup

Add to Claude Desktop

Open your Claude Desktop configuration file and add:

claude_desktop_config.json
{
  "mcpServers": {
    "country-state-city": {
      "command": "npx",
      "args": ["-y", "@tansuasici/country-state-city"]
    }
  }
}

Restart Claude Desktop

After saving the config, restart Claude Desktop to load the MCP server.

Start querying

Ask Claude questions like:

  • "What are the top 5 countries in Europe by number of states?"
  • "Show me all cities in Istanbul"
  • "What currency does Japan use?"

Available Tools

The MCP server exposes 11 tools for querying location data:

ToolDescriptionParameters
search_countriesSearch countries by namequery
get_countryGet country by ID, ISO2, or ISO3id | iso2 | iso3
get_countries_by_regionGet countries in a regionregion
get_statesGet states by countrycountryId | countryCode
search_statesSearch states by namequery, countryId?
get_citiesGet cities with paginationstateId | countryId, limit?
search_citiesSearch cities by namequery, stateId?, countryId?
get_statsDatabase statisticsnone
get_regionsAll world regionsnone
get_timezonesAll timezonesnone
get_currenciesAll currenciesnone

Resources

The MCP server also provides 6 resource URIs for direct data access:

URIDescription
country-state-city://countriesAll countries (summary)
country-state-city://countries/{iso2}Country detail by ISO2 code
country-state-city://countries/{iso2}/statesStates for a country
country-state-city://states/{id}/citiesCities for a state
country-state-city://statsDatabase statistics
country-state-city://snapshotExact package version, data digest, generation time, and coverage URL

Usage Example

When connected, Claude can chain multiple tools to answer complex queries:

You ask: "What are the top 5 largest countries in Europe by number of states?"

Claude uses:

  1. get_countries_by_region("Europe") — gets all European countries
  2. get_states(countryId) — for each country, gets state count
  3. Sorts and returns the top 5

The MCP server runs locally via npx and does not send any data to external servers. All queries are processed on your machine.

On this page