关于 Torify — Japanese Locale APIs for AI Agents
Torify 是面向 AI Agent 和应用的日本本地化及行政数据 API,提供日期、地址、金融、身份信息和文本等处理接口,适用于日本特定数据的转换与验证。
主要功能
- 01和历转换与节假日处理
- 02发票及标识符验证
- 03邮编查询与地址规范化
- 04银行及转账数据处理
- 05日文文本与姓名处理
适用场景
- 01将公历日期转换为和历
- 02规范化输入的日本地址
- 03验证发票号、电话号码或 ID
- 04查询银行和网点信息
MCP 相关
Torify 通过 HTTP MCP 服务向兼容客户端提供日本本地化 API。README 所述免费额度为每个 IP 每天 100 次请求。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://torify-mcp.torify.workers.devclaude mcp add --transport http torify-examples https://torify-mcp.torify.workers.dev{"mcpServers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}在 Cursor 中打开{"servers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}在 VS Code 中打开{"mcpServers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}{"mcpServers":{"torify-examples":{"serverUrl":"https://torify-mcp.torify.workers.dev"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
torify-examples
Torify 的代码示例 — 面向 AI Agent 的日语地区 API。
提供 40 个端点,涵盖和历(年号日期)、发票验证、企业查询、地址规范化、银行/支店搜索(完整的 Zengin 数据库,共 1,152 家机构)、法定休息日(《劳动基准法》)、学校代码等。
收录目录
- Smithery — https://smithery.ai/servers/endenibrk/torify(评分 100/100)
- MCP.so — https://mcp.so/server/torify-%E2%80%94-japanese-locale-apis-for-ai-agents/hiroki-sonoda
- Anthropic Official MCP Registry — https://registry.modelcontextprotocol.io/v0/servers/dev.torify/japanese-locale-mcp
- Cursor MCP Directory — https://cursor.directory/mcp (等待审核)
- Cline MCP Marketplace — https://github.com/cline/mcp-marketplace/issues/1603 (Issue #1603 · 等待审核)
- x402scan — https://www.x402scan.com
- a2aregistry.org — https://a2aregistry.org
定价
| 方案 | 价格 | 限额 | 身份验证方式 |
|---|---|---|---|
| Free Trial | 免费 | 每月 100 次调用 | X-Trial-Key(通过电子邮件注册) |
| MCP | 免费 | 每个 IP 每天 100 个请求 | 无需身份验证 |
| x402 | $0.02/次调用 | 无限制 | X-PAYMENT 标头(Base L2 上的 USDC) |
| Pro | $49/月 | 每月 10,000 次调用 | X-API-Key |
| Enterprise | $499/月 | 每月 1,000,000 次调用(合理使用) | X-API-Key + 优先支持 + SLA |
获取免费试用密钥
curl -X POST https://torify.dev/v1/trial/signup \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]"}'
# { "ok": true, "data": { "trialKey": "tk_..." } }
将返回的密钥用作 X-Trial-Key 标头。限额:每月 100 次调用,每月重置。
curl -H "X-Trial-Key: tk_..." \
"https://torify.dev/v1/wareki/convert?direction=g2w&date=2024-05-01"
快速入门
免费方案(MCP — 无需钱包,无需注册)
添加到 claude_desktop_config.json:
{
"mcpServers": {
"torify": {
"type": "http",
"url": "https://torify-mcp.torify.workers.dev"
}
}
}
每个 IP 每天可免费发送 100 个请求。可在 Claude Desktop 和 Cursor 中使用。
x402 按次付费(Base L2 上每次 $0.02 USDC)
npm install x402-fetch viem
export PRIVATE_KEY="0x..."
npx ts-node typescript/x402-example.ts
API 密钥订阅(Pro 每月 $49 或 Enterprise 每月 $499)
通过 Polar 订阅,即可通过电子邮件收到 API 密钥:
- Pro(每月 $49):https://buy.polar.sh/polar_cl_N7Q6P6X3TMOlv9TqaGHrbqzviFnnmSuICsTdT06N2LW
- Enterprise(每月 $499):https://buy.polar.sh/polar_cl_mWV5CA7nv6rfR0aGM1H7HJjmgVLJGXBCKeHre05RvHe
export TORIFY_API_KEY="your-key"
npx ts-node typescript/apikey-example.ts
示例
和历(年号日期)转换
# Gregorian → Wareki
curl "https://torify.dev/v1/wareki/convert?direction=g2w&date=2024-05-01"
# { "ok": true, "data": { "era": "令和", "eraYear": 6, "formatted": "令和6年5月1日" } }
# Wareki → Gregorian (edge case: Showa ended Jan 7, 1989; Heisei started Jan 8, 1989)
curl "https://torify.dev/v1/wareki/convert?direction=w2g&era=showa&eraYear=64&month=1&day=7"
# { "ok": true, "data": { "gregorian": "1989-01-07" } }
发票号码验证
# Format + check digit validation (no payment needed)
curl "https://torify.dev/v1/invoice/validate?number=T7000012050002"
# { "ok": true, "data": { "valid": true } }
状态:NTA 注册表集成正在等待外部 API 审批。即将推出。
# NTA registry lookup — is this T-number actually registered?
curl "https://torify.dev/v1/invoice/verify?number=T1180301018771" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "registered": true, "registrantName": "トヨタ自動車株式会社", "confidence": 0.99 } }
企业编号查询
状态:企业编号查询正在等待外部 API 审批。即将推出。
curl "https://torify.dev/v1/houjin/lookup?number=7000012050002" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "name": "国税庁", "address": "東京都千代田区霞が関3丁目1番1号", "status": "active" } }
邮政编码查询
curl "https://torify.dev/v1/postal/lookup?zipcode=1000013"
# { "ok": true, "data": { "prefecture": "東京都", "city": "千代田区", "town": "霞が関" } }
电话号码验证
# Tokyo (2-digit area code 03)
curl "https://torify.dev/v1/phone/validate?phone=03-1234-5678"
# { "ok": true, "data": { "valid": true, "type": "landline", "region": "東京" } }
# Rural (4-digit area code 0266)
curl "https://torify.dev/v1/phone/validate?phone=0266-12-3456"
# { "ok": true, "data": { "valid": true, "type": "landline", "region": "長野" } }
地址规范化
响应架构(v0.3.0+)
{
prefecture: string | null,
city: string | null,
town: string | null,
streetNumber: string | null,
streetNumberHyphen: string | null,
streetNumberFormal: string | null,
addressType: 'block' | 'street' | 'rural' | 'other', // NEW: first-class enum
streetRef: { // NEW: Kyoto intersection
intersection: string;
direction: '上る' | '下る' | '東入' | '西入' | null;
} | null,
addressee: string | null, // NEW: 様方/気付/c/o separated
}
示例
| 输入 | addressType | streetRef | addressee | 备注 |
|---|---|---|---|---|
| 東京都千代田区霞が関3丁目1番1号 | block | null | null | 普通地址 |
| 京都府京都市中京区烏丸通三条上る場之町 | street | {"direction": "上る", "intersection": "烏丸通三条上る"} | null | 京都街道名称 |
| 東京都港区赤坂2-3-4 山田様方 | block | null | "山田" | 地址补充信息 |
| 東京都港区赤坂二丁目 | block | null | null | 汉字数字 1-99 → 自动转换为阿拉伯数字 |
# 通常住所 (block)
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都千代田区霞が関3丁目1番1号" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "千代田区", "town": "霞が関",
# "addressType": "block", "streetRef": null, "addressee": null } }
# 京都通り名 (street + streetRef populated)
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=京都府京都市中京区烏丸通三条上る場之町" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "京都府", "city": "京都市中京区",
# "addressType": "street",
# "streetRef": { "intersection": "烏丸通三条上る", "direction": "上る" },
# "addressee": null } }
# 方書 — addressee 分離
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都港区赤坂2-3-4 山田様方" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "港区", "town": "赤坂",
# "addressType": "block", "streetRef": null, "addressee": "山田" } }
# 漢数字 → Arabic 自動変換
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都港区赤坂二丁目" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "港区", "town": "赤坂2丁目",
# "addressType": "block", "streetRef": null, "addressee": null } }
银行查询、搜索和列表(完整的 Zengin 数据库,1,150 多家银行)
# Look up by bank code + branch code
curl "https://torify.dev/v1/bank/lookup?bankCode=0001&branchCode=001" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "bankName": "みずほ銀行", "bankNameEn": "Mizuho Bank",
# "branchName": "東京営業部", "found": true, "branchFound": true } }
# Search banks by partial name (kanji / kana / romaji)
curl "https://torify.dev/v1/bank/search" --get --data-urlencode "name=みずほ" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "mode": "bank", "hits": [...], "total": 2 } }
# Search branches within a specific bank
curl "https://torify.dev/v1/bank/search?bankCode=0001" --get --data-urlencode "name=東京" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "mode": "branch", "hits": [...] } }
# Paginated full bank list
curl "https://torify.dev/v1/bank/list?limit=5" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "total": 1152, "banks": [...] } }
银行转账验证(Zengin 格式)
curl "https://torify.dev/v1/bank/transfer/validate?bankCode=0001&branchCode=001&accountType=1&accountNumber=1234567" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "valid": true, "accountTypeName": "普通", "isYucho": false } }
法定休息日检查(《劳动基准法》第 35 条)
# Standard 5-day work week (Sun = legal holiday, Sat = non-legal rest day)
curl "https://torify.dev/v1/legal-holiday/check?date=2024-05-05&restDays=sun,sat" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "isLegalHoliday": true, "overtimePremiumRate": 0.35,
# "overtimePremiumRateLegalNonHoliday": 0.25,
# "legalReference": "Labor Standards Act Article 35 (労働基準法第35条)" } }
MEXT 学校代码验证(13 个字符)
curl "https://torify.dev/v1/school-code/validate?code=B213123456X00" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "valid": true, "schoolType": "elementary",
# "establishment": "public_prefectural", "prefectureJa": "東京都" } }
获取本机 IP 地址(免费,无需身份验证)
curl "https://torify.dev/v1/whoami"
# { "ok": true, "data": { "ip": "...", "country": "JP", "userAgent": "..." } }
使用 x402 的 TypeScript(自主支付)
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
const wallet = createWalletClient({
account: privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`),
chain: base,
transport: http()
});
const fetch402 = wrapFetchWithPayment(fetch, wallet);
// Agent pays $0.02 USDC automatically — no API key needed
const res = await fetch402("https://torify.dev/v1/invoice/verify?number=T1180301018771");
const { ok, data } = await res.json();
console.log(data.registered, data.confidence); // true, 0.99
使用 API 密钥的 Python
import os, requests
headers = {"X-API-Key": os.environ["TORIFY_API_KEY"]}
r = requests.get(
"https://torify.dev/v1/address/normalize",
params={"address": "東京都千代田区霞が関3丁目1番1号"},
headers=headers
)
data = r.json()["data"]
print(data["prefecture"], data["city"], data["town"])
# 東京都 千代田区 霞が関
所有端点
完整文档:torify.dev/docs
全部 40 个端点(付费,每次调用 $0.02;MCP / whoami 免费):
| 类别 | 端点 |
|---|---|
| 纪年与日期 | wareki/convert、holiday/check、age/calculate、legal-holiday/check |
| 法律与税务 | invoice/validate、invoice/verify、tax/calculate、eltax/check (POST)、freelance/order/validate (POST) |
| 企业 | houjin/lookup、industry/lookup |
| 地址 | postal/lookup、address/normalize、region/lookup、coordinate/convert |
| 地理 | geo/geocode(通过 GSI 将地址转换为经纬度,PDL 1.0)、geo/reverse-geocode(通过 GSI 将经纬度转换为市町村及町名,PDL 1.0) |
| 法律搜索 | law/search(通过 e-Gov API v2 搜索日本法律,政府标准利用条款) |
| 文本 | name/romanize、name/split、name/validate、kana/convert、text/normalize、kanji/to-kana(Cloudflare Workers AI、Llama 3.3 70B)、kanji/normalize (POST) |
| 金融 | bank/lookup、bank/search、bank/list、bank/transfer/validate、yucho/convert、payment/3ds/check |
| 身份 | mynumber/validate、passport/validate、insurance/validate、plate/validate、barcode/validate、phone/validate |
| 教育 | school-code/validate |
| 诊断 | whoami(免费,无需身份验证) |
| 批量 | wareki/convert/bulk、invoice/validate/bulk、invoice/verify/bulk(最多 300 项)、tax/calculate/bulk(最多 1000 项) |
许可证
MIT — 仅适用于示例。Torify API 服务为专有服务。
最后更新:2026-05-27
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。