关于 CountryCallingCodes
CountryCallingCodes 是提供国际电话号码查询与分析的托管只读 MCP 服务和 JSON API,支持号码查找、规范化、拨号指导及通话时间窗口计算,并返回来源证据和限制说明。
主要功能
- 01国家与拨号代码查询
- 02电话号码解析与格式化
- 03批量规范化及重复分组
- 04按拨出地提供拨号说明
- 05号码地区解析与诊断
- 06考虑时区的通话窗口计算
适用场景
- 01查询国家代码和拨号前缀
- 02规范化一批电话号码记录
- 03排查格式错误
- 04查找不同时区的重叠工作时间
MCP 相关
它通过托管的 Streamable HTTP MCP 端点提供 11 个只读工具和 3 个资源。每个工具也有返回相同结构化数据的 REST 接口。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://www.countrycalling.codes/api/mcpclaude mcp add --transport http countrycallingcodesmcp https://www.countrycalling.codes/api/mcp{"mcpServers":{"countrycallingcodesmcp":{"type":"http","url":"https://www.countrycalling.codes/api/mcp"}}}在 Cursor 中打开{"servers":{"countrycallingcodesmcp":{"type":"http","url":"https://www.countrycalling.codes/api/mcp"}}}在 VS Code 中打开{"mcpServers":{"countrycallingcodesmcp":{"type":"http","url":"https://www.countrycalling.codes/api/mcp"}}}{"mcpServers":{"countrycallingcodesmcp":{"serverUrl":"https://www.countrycalling.codes/api/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
11| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| countryCode | string | 否 | |
| operation | enum | 否 | get_phone_capabilities | analyze_phone_number | get_dialing_instructions | normalize_phone_numbers | compare_phone_numbers | resolve_phone_region | get_phone_input_rules | diagnose_dialing_problem | find_calling_windows |
详细介绍
国家/地区电话区号 MCP
托管的国家/地区电话区号 MCP 服务的纯元数据列表仓库 (服务版本 1.4.0)。
| Agent 技能 | Kajdep/countrycalling-codes-skill |
官方注册表名称:io.github.Kajdep/countrycallingcodesmcp。
托管的 MCP 服务
- 端点:
https://www.countrycalling.codes/api/mcp - 传输方式:Streamable HTTP
- 身份验证:无
- 协议:
2025-11-25 - 工具:11 个只读工具(见下文)
- 资源:
countrycalling://capabilities、countrycalling://coverage,以及模板countrycalling://countries/{code}/phone-input - 网站:
https://www.countrycalling.codes - 开发者文档:
https://www.countrycalling.codes/developers#mcp - 大模型指南:
https://www.countrycalling.codes/llms-full.md - 技能清单:
https://www.countrycalling.codes/skill.json - OpenAPI:
https://www.countrycalling.codes/api/calling-codes/openapi.json - 状态:
https://www.countrycalling.codes/api/calling-codes/status - 注册表清单(实时):
https://www.countrycalling.codes/server.json
本仓库中的 server.json 与网站提供的文档相同,且官方 MCP 注册表已将其发布为 1.4.0。
注册表发布由实现仓库负责(v0-countrycallingcodes 中的
.github/workflows/publish-mcp.yml),而非本列表仓库。
功能
面向应用和 Agent 的国际电话号码只读工作流:
- 国家和地区电话区号查询(ISO 代码、E.164 拨号代码、地区、国内长途前缀、NANP)
- 基于版本化编号元数据进行电话号码分析和临时格式化
- 针对已审核国家/地区对的来源地特定拨号说明
- 批量规范化(最多 100 条记录)并按重复项分组
- 号码比较、地区解析、表单输入提示和格式诊断
- 在明确指定的 IANA 时区之间查找重叠的拨号时段
每个 MCP 工具都有一个 REST 对应接口,返回相同的结构化载荷。结果包含来源 evidence 和 limitations 数组。格式正确的号码并不能证明该号码已分配、有效、可接通、归属某人,或已获得联系许可。
面向 Agent 的使用规则(何时调用哪个工具、如何处理歧义、如何清理 CRM 列)详见技能,而非本文档。
MCP 客户端配置
适用于支持远程 Streamable HTTP 服务的客户端——此配置与技能和实时发现文档使用的配置相同:
{
"mcpServers": {
"country-calling-codes": {
"type": "streamable-http",
"url": "https://www.countrycalling.codes/api/mcp"
}
}
}
对于需要本地 stdio 桥接的客户端,请使用 mcp-remote:
{
"mcpServers": {
"country-calling-codes": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://www.countrycalling.codes/api/mcp"
]
}
}
}
可直接复制粘贴的版本位于 mcp-config.json。
工具
所有工具均标注为 readOnlyHint,具有非破坏性、幂等且封闭世界的特性。电话号码字符串上限为 64 个字符;工具参数上限为 64 KiB;JSON-RPC 信封上限为 128 KiB。
| MCP 工具 | REST 对应接口 | 用途 |
|---|---|---|
lookup_country_calling_code | GET /api/calling-codes | 在 233 个国家和地区中按自由文本、ISO 代码、拨号代码或地区查询。设置 includeExamples 可获取经审核的模式。 |
format_international_phone_number | POST /api/phone/format | 更轻量的临时格式化工具。若需要状态、检查结果、候选项或依据,请优先使用 analyze_phone_number。 |
get_phone_capabilities | GET /api/capabilities | 各国审核状态、支持的操作、依据、数据集版本和请求限制。查询不熟悉的国家时,请先调用此工具。 |
analyze_phone_number | POST /api/phone/analyze | 根据带版本的编号元数据进行严格解析。国家/地区内号码需要提供 numberCountryCode;国际拨出前缀需要提供 originCountryCode。 |
get_dialing_instructions | POST /api/dialing/instructions | 针对经审核的国家/地区组合,提供拨号字符串、步骤和模式。 |
normalize_phone_numbers | POST /api/phone/batch | 最多处理 100 条带有唯一标识的记录,保留顺序并提供逐条错误;可选择按规范形式分组重复项。 |
compare_phone_numbers | POST /api/phone/compare | 分析后比较是否相等。extensionPolicy 默认值为 exact;仅后缀匹配时绝不视为相等。 |
resolve_phone_region | POST /api/phone/region | 根据元数据提供国家/地区候选项或非地理号码分类。不会进行地理定位或运营商查询。 |
get_phone_input_rules | GET /api/countries/{code}/phone-input | 提供显示用占位符和国内冠码指南。不是验证掩码。 |
diagnose_dialing_problem | POST /api/phone/diagnose | 说明格式化失败原因,并提出范围受限、经审核的前缀修复方案供确认。 |
find_calling_windows | POST /api/calling-windows | 为最多 8 位参与者查找重叠工作时段;需指定 IANA 时区,范围为 1–31 天,并考虑夏令时。 |
示例(lookup_country_calling_code):
{
"code": "GB",
"includeExamples": true
}
预期结果包含英国记录,其拨号代码为 +44。
完整的参数和响应结构请参阅 skill API 参考 和托管的 OpenAPI。 请勿在此仓库中再维护一份重复的接口契约。
资源
| URI | 内容 |
|---|---|
countrycalling://capabilities | 完整的能力文档(与 GET /api/capabilities 的负载相同) |
countrycalling://coverage | 同一文档的覆盖范围视图 |
countrycalling://countries/{code}/phone-input | 单个 ISO alpha-2 国家/地区经审核的输入规则 |
覆盖范围和限制
- 编号元数据:libphonenumber-js 1.13.12,max metadata,涵盖 245 个国家和地区,以及受支持的非地理编号。
- 经审核的拨号指南和输入示例:AE、AU、BR、CN、DE、FR、GB、IN、IT、JP、SG、US、ZA。拨号说明要求起始地和目的地均经过审核。
- 目录数据集:233 个国家和地区。
- 不提供短信、通话、HLR/HSS、MNP、运营商查询、联系人修改或出站数据提交。
- 含电话号码的响应和 MCP 传输响应均设置为
no-store。应用层不会按客户端设置配额;如果托管方实施了配额,请遵守429和Retry-After。
目录提交元数据
Name: Country Calling Codes
Description: Calling codes, phone analysis, dialing guidance, batch normalization and calling windows.
Category: Data / Search / Reference / API
Website: https://www.countrycalling.codes
MCP URL: https://www.countrycalling.codes/api/mcp
Registry: io.github.Kajdep/countrycallingcodesmcp
Version: 1.4.0
OpenAPI URL: https://www.countrycalling.codes/api/calling-codes/openapi.json
Skill: https://github.com/Kajdep/countrycalling-codes-skill
Skill manifest: https://www.countrycalling.codes/skill.json
LLM guide: https://www.countrycalling.codes/llms-full.md
Implementation: https://github.com/Kajdep/v0-countrycallingcodes
GitHub listing: https://github.com/Kajdep/countrycallingcodesmcp
Tools: 11 (see table above)
Auth: None
Cost to user: Free/public read-only lookup and analysis
数据与隐私
此仓库不包含私人数据或数据集导出。托管的 MCP 服务为只读。服务会临时处理电话号码,不会存储这些号码;MCP 客户端和第三方网关可能会保留各自的对话历史。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。