Country State City
БесплатноНе проверенProvides complete world location data (countries, states, cities) as an MCP server for AI assistants, enabling search and retrieval of geographic information th
Описание
Provides complete world location data (countries, states, cities) as an MCP server for AI assistants, enabling search and retrieval of geographic information through 11 tools and 5 resources.
README
Complete World Location Data — NPM Package, MCP Server & Web App
About
Country State City provides 250+ countries, 5,000+ states, and 150,000+ cities as an NPM package, an MCP server for AI assistants, and an interactive web app — all ISO 3166-1 compliant.
Features
- 250+ Countries, 5K+ States, 150K+ Cities — ISO 3166-1 compliant
- Multiple Formats — JSON, CSV, XML, YAML output
- MCP Server — Connect to Claude Desktop and AI assistants
- TypeScript — Full type definitions included
- Dual Entry Points — Separate browser (ESM) and Node.js (CJS/ESM) builds
- Search — Filter countries, states, and cities by name
- Interactive Playground — Test the API at the live demo
Quick Start
npm install @tansuasici/country-state-city
import { CountryStateCity } from '@tansuasici/country-state-city';
const countries = CountryStateCity.getAllCountries();
const turkey = CountryStateCity.getCountryByIso2('TR');
const states = CountryStateCity.getStatesByCountryId(225);
const cities = CountryStateCity.getCitiesByStateId(2175);
// Search
const results = CountryStateCity.searchCountries('United');
// Different formats
const csv = CountryStateCity.getAllCountries('csv');
const xml = CountryStateCity.getStatesByCountryId(231, 'xml');
const yaml = CountryStateCity.getCitiesByStateId(1416, 'yaml');
MCP Integration
Use location data directly in Claude Desktop and other MCP-compatible AI assistants.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"country-state-city": {
"command": "npx",
"args": ["@tansuasici/country-state-city", "mcp"]
}
}
}
11 Tools — search_countries, get_country, get_countries_by_region, get_states, search_states, get_cities, search_cities, get_stats, get_regions, get_timezones, get_currencies
5 Resources — ://countries, ://countries/{iso2}, ://countries/{iso2}/states, ://states/{id}/cities, ://stats
API Reference
Country Methods
CountryStateCity.getAllCountries(format?: 'json' | 'csv' | 'xml' | 'yaml');
CountryStateCity.getCountryById(id: number);
CountryStateCity.getCountryByIso2(iso2: string);
CountryStateCity.getCountryByIso3(iso3: string);
CountryStateCity.searchCountries(query: string);
CountryStateCity.getCountriesByRegion(region: string);
CountryStateCity.getCountriesBySubregion(subregion: string);
State Methods
CountryStateCity.getAllStates(format?: 'json' | 'csv' | 'xml' | 'yaml');
CountryStateCity.getStateById(id: number);
CountryStateCity.getStatesByCountryId(countryId: number, format?: string);
CountryStateCity.getStatesByCountryCode(countryCode: string, format?: string);
CountryStateCity.searchStates(query: string, countryId?: number);
City Methods
CountryStateCity.getAllCities(format?: 'json' | 'csv' | 'xml' | 'yaml');
CountryStateCity.getCityById(id: number);
CountryStateCity.getCitiesByStateId(stateId: number, format?: string);
CountryStateCity.getCitiesByCountryId(countryId: number, format?: string);
CountryStateCity.searchCities(query: string, stateId?: number, countryId?: number);
Utility Methods
CountryStateCity.getStats();
CountryStateCity.getAllRegions();
CountryStateCity.getAllSubregions();
CountryStateCity.getAllTimezones();
CountryStateCity.getAllCurrencies();
CountryStateCity.exportData(dataType, format, options?);
TypeScript
import {
CountryStateCity,
Country,
State,
City,
DataFormat,
FormatOptions,
} from '@tansuasici/country-state-city';
Development
# Install dependencies
npm install
# Start dev server
npm run dev
# Build NPM package
npm run build:lib
# Build MCP server
npm run build:mcp
# Run tests
npm test
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
License
MIT — see LICENSE for details.
Made with ❤️ by tansuasici
Установка Country State City
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/tansuasici/CountryStateCityFAQ
Country State City MCP бесплатный?
Да, Country State City MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Country State City?
Нет, Country State City работает без API-ключей и переменных окружения.
Country State City — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Country State City в Claude Desktop, Claude Code или Cursor?
Открой Country State City на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Country State City with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
