@datacountry/mcp-server
v1.1.0
Published
MCP server for datacountry.io geopolitical API
Maintainers
Readme
DataCountry MCP Server
A Model Context Protocol (MCP) server that provides access to the datacountry.io geopolitical API. This server enables AI assistants like Claude to query comprehensive data about countries, cities, currencies, languages, timezones, phone formats, postal codes, and more. Includes 32 tools for geopolitical data lookup and validation.
Installation
Using npx (recommended)
npx @datacountry/mcp-serverGlobal installation
npm install -g @datacountry/mcp-server
datacountry-mcpConfiguration
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| DATACOUNTRY_API_KEY | No | - | Your datacountry.io API key for higher rate limits |
| DATACOUNTRY_API_URL | No | https://api.datacountry.io/v1 | Custom API base URL |
Claude Desktop Configuration
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"datacountry": {
"command": "npx",
"args": ["@datacountry/mcp-server"],
"env": {
"DATACOUNTRY_API_KEY": "your-api-key-here"
}
}
}
}Available Tools
Countries (11 tools)
| Tool | Description |
|------|-------------|
| list_countries | List countries with filters (region, subregion, independence, UN membership, landlocked, sort, pagination) |
| search_countries | Search countries by name or code |
| get_countries_by_region | Get all countries in a region |
| get_country | Get country details with optional includes (currencies, languages, timezones, borders, translations, economic, demographic, cities) |
| get_country_borders | Get countries sharing a border |
| get_country_currencies | Get currencies used in a country |
| get_country_languages | Get languages spoken in a country |
| get_country_timezones | Get timezones in a country |
| get_country_economic | Get economic indicators (GDP, inflation, unemployment) |
| get_country_demographic | Get demographic indicators (life expectancy, literacy, age distribution) |
| get_country_cities | Get cities in a country |
Cities (3 tools)
| Tool | Description |
|------|-------------|
| list_cities | List cities with filters (country, population, capital status, sort, pagination) |
| get_capital_cities | Get all capital cities |
| search_cities | Search cities by name |
Currencies (3 tools)
| Tool | Description |
|------|-------------|
| list_currencies | List all currencies |
| get_currency | Get currency details by code |
| get_currency_countries | Get countries using a currency |
Languages (3 tools)
| Tool | Description |
|------|-------------|
| list_languages | List all languages |
| get_language | Get language details by code |
| get_language_countries | Get countries speaking a language |
Timezones (3 tools)
| Tool | Description |
|------|-------------|
| list_timezones | List all timezones |
| get_timezone | Get timezone details by name |
| get_timezone_countries | Get countries in a timezone |
Regions (3 tools)
| Tool | Description |
|------|-------------|
| list_regions | List regions with country counts |
| get_region_subregions | Get subregions in a region |
| get_all_subregions | Get all subregions globally |
Phone (5 tools)
| Tool | Description |
|------|-------------|
| list_phone_formats | List phone formats for all countries (calling codes, patterns, lengths) |
| get_phone_format | Get phone format for a specific country |
| validate_phone_number | Validate a phone number for a country (returns validity, type, formatted versions) |
| parse_phone_number | Parse a phone number into components (country code, national number, URI) |
| format_phone_number | Format a phone number (national, international, E.164, RFC3966) |
Postal (1 tool)
| Tool | Description |
|------|-------------|
| validate_postal_code | Validate a postal code for a country (returns validity and expected format) |
Rate Limits
- Anonymous: 50 requests/day
- With API key: Based on your plan (up to 10,000/day)
Get an API key at datacountry.io
Example Usage
Once configured, you can ask Claude questions like:
- "What are all the landlocked countries in Europe?"
- "Show me the economic indicators for Japan"
- "Which countries use the Euro?"
- "List the largest cities in Brazil"
- "What languages are spoken in Switzerland?"
- "Is +1-202-555-1234 a valid US phone number?"
- "Format this UK number in international format: 07911123456"
- "Validate the postal code 10001 for the United States"
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
node build/index.jsChangelog
1.1.0
- Added phone validation tools: validate, parse, and format phone numbers
- Added phone format lookup by country (calling codes, patterns, number lengths)
- Added postal code validation tool
- Total tools increased from 26 to 32
1.0.1
- Initial public release
- 26 tools covering countries, cities, currencies, languages, timezones, and regions
License
MIT
