@countrydataapi/mcp-server
v1.0.0
Published
MCP Server for Country Data API - enables Claude and other LLMs to query geographical data
Downloads
107
Maintainers
Readme
Country Data API - MCP Server
MCP (Model Context Protocol) Server for the Country Data API. This enables Claude and other LLMs to query geographical data including countries, states, cities, and postal codes.
Installation
npm install -g @countrydataapi/mcp-serverOr use directly with npx:
npx @countrydataapi/mcp-serverConfiguration
Environment Variables
Set your API key as an environment variable:
export COUNTRY_DATA_API_KEY=your-api-key-hereClaude Desktop Configuration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"country-data-api": {
"command": "npx",
"args": ["@countrydataapi/mcp-server"],
"env": {
"COUNTRY_DATA_API_KEY": "your-api-key-here"
}
}
}
}Available Tools
Countries
| Tool | Description |
|------|-------------|
| get_countries_all | Get all countries |
| get_country_by_name | Get country by name |
| get_country_by_code | Get country by ISO code (ES, ESP, 724) |
| get_countries_by_region | Get countries by region (Europe, Asia, etc.) |
| get_countries_by_currency | Get countries by currency (EUR, USD, etc.) |
| get_countries_by_language | Get countries by language (spa, eng, etc.) |
| get_countries_by_timezone | Get countries by timezone |
States
| Tool | Description |
|------|-------------|
| get_states_all | Get all states/provinces |
| get_states_by_country | Get states for a country |
| get_states_by_city | Get states containing a city |
Cities
| Tool | Description |
|------|-------------|
| get_cities_all | Get all cities |
| get_city | Get city by name |
| get_cities_by_country | Get cities for a country |
| get_cities_by_state | Get cities for a state |
Zipcodes
| Tool | Description |
|------|-------------|
| get_zipcodes_by_country | Get zipcodes for a country |
| get_zipcodes_by_state | Get zipcodes for a state |
Select (Optimized - 1 token each)
| Tool | Description |
|------|-------------|
| get_select_countries | Lightweight country list for dropdowns |
| get_select_states | Lightweight state list for dropdowns |
| get_select_cities | Lightweight city list for dropdowns |
Status
| Tool | Description |
|------|-------------|
| get_api_status | Get remaining API tokens |
Example Usage in Claude
Once configured, you can ask Claude things like:
- "What countries are in Europe?"
- "Get me information about Spain"
- "What states are in Germany?"
- "List cities in California"
- "How many API tokens do I have left?"
Common Parameters
Most tools accept these optional parameters:
| Parameter | Description |
|-----------|-------------|
| lang | Response language: en, es, pt, fr, de, it |
| fields | Comma-separated list of fields to return |
| limitToken | Maximum tokens to use for this request |
Get an API Key
Visit countrydataapi.com to get your API key.
License
MIT
