Real API and MCP access
Run the public JSON API below, download its OpenAPI contract, inspect live service status, or connect an MCP client to the same country-calling-code lookup logic. No authentication is required for these read-only interfaces.
Live service endpoints
Try the REST API
The API accepts cross-origin GET requests and returns HTTP 400 with field-level details for invalid parameters. Responses include an API version header and links back to this documentation and the OpenAPI contract.
Live API explorer
This form calls the deployed JSON route directly. No sample response is hard-coded.
Select parameters and run the request.cURL
curl --get 'https://countrycalling.codes/api/calling-codes' \
--data-urlencode 'code=GB' \
--data-urlencode 'include=examples'JavaScript
const response = await fetch(
'https://countrycalling.codes/api/calling-codes?code=GB'
)
if (!response.ok) throw new Error(await response.text())
const data = await response.json()Connect the MCP server
The remote endpoint implements MCP over Streamable HTTP and exposes the read-onlylookup_country_calling_codetool. It returns both text content and schema-backed structured content.
{
"mcpServers": {
"country-calling-codes": {
"type": "streamable-http",
"url": "https://countrycalling.codes/api/mcp"
}
}
}- No API key or OAuth flow is required.
- Tool calls use the same tested accessor as REST and country pages.
- The server publishes an official Registry-format manifest.
- Requests are read-only and do not validate live subscriber status.
Scope and reliability
These interfaces provide static calling-code and reviewed formatting guidance. They do not perform HLR, carrier, reachability, ownership or consent checks. Source dates and limitations travel with reviewed example records.