nta-invoice-mcp
This server queries Japan's National Tax Agency invoice (qualified invoice issuer) publication data for one or up to ten registration numbers on a given date, and retrieves per-number publication histories.
Look up a single registration status (
lookup_invoice_registration): pass a registration number (T+ 13 digits) and a date (YYYY-MM-DD) to see whether the business was registered on that date, with source and last-updated info.Look up up to 10 numbers at once (
lookup_invoice_registration_numbers/lookup_invoice_registrations): batch-check the same date for 1–10 registration numbers, returned in input order (including numbers with no record).Retrieve publication history (
get_invoice_registration_history): get one number's records oldest-first, including name, registration date, cancellation date, expiry date, update date,process_code(new/change/expiry/cancellation) andlatestflag.Interpret statuses: results distinguish
registered,not_registered,no_record, andunknownfor the specified date.Get provenance: each tool returns the data's last-update date and the NTA source attribution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nta-invoice-mcp T1234567890123の2024年4月1日時点のインボイス登録状況を確認して"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nta-invoice-mcp
国税庁のインボイス公表情報を、MCP・CLI・Pythonから照会できます。取引日時点の登録状況を最大10件まとめて確認でき、登録番号ごとの公表履歴も取得できます。
MCP登録 · CLI · Pythonライブラリ
利用前に
uv と Git が必要です。Python 3.12以上に対応しています。国税庁への届出で発行されたインボイスWeb-API用のアプリケーションIDが必要です。下の例の YOUR_NTA_INVOICE_APP_ID を手元の設定で差し替えてください。
Related MCP server: jp-invoice-check
MCPクライアントに登録する
公開GitHubリポジトリから uvx で起動します。初回は依存関係の準備に時間がかかることがあります。
Codex
codex mcp add nta-invoice-mcp --env "NTA_INVOICE_APP_ID=YOUR_NTA_INVOICE_APP_ID" -- uvx --python 3.12 --from git+https://github.com/koizumikento/nta-invoice-mcp.git@main nta-invoice-mcp
codex mcp list新しいセッションで /mcp を開くと、接続を確認できます。デスクトップ版では設定の「MCP servers」で、下のJSON例と同じコマンド・引数・環境変数を指定できます。Codexの公式設定ガイド
Claude Desktop / Cursor
Claude Desktop(Windows)
%APPDATA%/Claude/claude_desktop_config.jsonClaude Desktop(macOS)
~/Library/Application Support/Claude/claude_desktop_config.jsonCursor
.cursor/mcp.json(プロジェクト内)
設定ファイルの mcpServers に項目を追加して、クライアントを再起動してください。uvx が見つからない場合は、実行ファイルの絶対パスを指定します。
{
"mcpServers": {
"nta-invoice-mcp": {
"command": "uvx",
"args": ["--python", "3.12", "--from", "git+https://github.com/koizumikento/nta-invoice-mcp.git@main", "nta-invoice-mcp"],
"env": {"NTA_INVOICE_APP_ID": "YOUR_NTA_INVOICE_APP_ID"}
}
}
}登録後の質問例
この取引先のインボイス登録番号について、2024年4月1日時点の公表上の登録状況と出典を確認して。
この取引先の登録履歴から、取消日や失効日が公表されているか確認して。
MCPツール
ツール | 用途 | 引数 |
| 1件の登録状況を指定日で確認する |
|
| 最大10件の登録状況を同じ日付で確認する |
|
| 1件の公表履歴を取得する |
|
登録番号は T と13桁の数字、日付は YYYY-MM-DD です。指定日の照会結果は status で確認できます。
値 | 意味 |
| 指定日は登録期間内 |
| 指定日は登録期間外 |
| 指定条件に合う公表情報がない |
| 公表情報はあるが、登録日がないため判定できない |
一括照会では、公表情報が見つからなかった番号も含めて入力順に返します。
履歴は古い順に返します。各行に名称・登録日・取消日・失効日・更新日があり、process_code で新規("01")、公表内容の変更("02")、失効("03")、取消("04")を確認できます。latest が "1" の行は最新、"0" は過去の履歴です。各ツールはデータの最終更新日と出典も返します。
CLIで使う
CLIやPythonを実行するシェルで環境変数を設定します。
$env:NTA_INVOICE_APP_ID = "YOUR_NTA_INVOICE_APP_ID"macOSやLinuxのシェルでは export NTA_INVOICE_APP_ID="YOUR_NTA_INVOICE_APP_ID" を使います。
結果は標準出力にUTF-8のJSONで返ります。下の番号は形式例です。実際に照会したい登録番号に差し替えてください。
uvx --python 3.12 --from git+https://github.com/koizumikento/nta-invoice-mcp.git@main nta-invoice-mcp lookup-invoice-registration --registration-number T0000000000000 --day 2024-04-01
uvx --python 3.12 --from git+https://github.com/koizumikento/nta-invoice-mcp.git@main nta-invoice-mcp lookup-invoice-registrations --registration-numbers T0000000000000 T0000000000001 --day 2024-04-01
uvx --python 3.12 --from git+https://github.com/koizumikento/nta-invoice-mcp.git@main nta-invoice-mcp get-invoice-registration-history --registration-number T0000000000000Pythonライブラリとして使う
自分のPythonプロジェクト(pyproject.toml があるディレクトリ)で依存関係に追加します。CLIで使うと同様に、実行するシェルで NTA_INVOICE_APP_ID を設定してください。
uv add "git+https://github.com/koizumikento/nta-invoice-mcp.git@main"次のコードを example.py に保存し、同じディレクトリで uv run python example.py を実行します。
import asyncio
from nta_invoice_mcp import (
get_invoice_registration_history,
lookup_invoice_registration,
lookup_invoice_registrations,
)
number = "T0000000000000"
day = "2024-04-01"
print(asyncio.run(lookup_invoice_registration(number, day)))
print(asyncio.run(lookup_invoice_registrations([number, "T0000000000001"], day)))
print(asyncio.run(get_invoice_registration_history(number)))すでにイベントループがある場合は、関数を直接 await してください。
出典と利用条件
コードはMIT Licenseです。照会結果を扱う場合は、個人事業者の情報を含め、国税庁の利用規約に従って管理してください。
照会には登録番号を指定します。期間を指定した全件差分の取得には対応していません。
このサービスは、適格請求書発行事業者公表システムWeb-API機能を利用して取得した情報をもとに作成しているが、サービスの内容は国税庁によって保証されたものではない。
公式API案内 · リクエスト・応答仕様 · Web-API利用規約
開発
uv sync --locked
uv run ruff check .
uv run ty check
uv run pytest
uv buildAvailable Tools
3 toolsget_invoice_registration_historyARead-onlyIdempotent
Read published registration, cancellation and expiry history for one number.
Inputs: registration_number (required). Returns: object
lookup_invoice_registrationBRead-onlyIdempotent
Look up one Japanese invoice registration number on a specified date (YYYY-MM-DD).
Inputs: day (required), registration_number (required). Returns: object
lookup_invoice_registrationsBRead-onlyIdempotent
Look up up to ten Japanese invoice registration numbers on one date (YYYY-MM-DD).
Inputs: day (required), registration_numbers (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
lookup_invoice_registration and lookup_invoice_registrations differ only by a trailing 's', so an agent must read descriptions carefully to avoid selecting the wrong one; the batch variant's 'up to ten' limit is the only real discriminator. The history tool is clearly distinct. Boundaries are workable but the singular/plural pair invites misselection.
All three follow a recognizable verb_noun pattern (lookup_*, get_*_history) with consistent snake_case. The only deviation is the near-identical singular/plural naming of the two lookup tools, which is consistent with convention but makes the pair harder to distinguish than ideal.
Three tools for a narrow, single-purpose domain (Japanese invoice registration lookup) is well-scoped and each tool earns its place. One could argue the batch lookup could be folded into the single lookup, but the count itself is not excessive or thin.
The surface covers single lookup, batch lookup, and historical/status data for one number, but has notable gaps: no reverse lookup by registrant name or entity, no batch history retrieval, and no way to list or search registrations. Agents can handle the core validity check but will dead-end on discovery-style queries.
Maintenance
Related MCP Connectors
Verify Japanese companies, invoice-issuer registrations and addresses against government open data.
Japan corporate number & invoice registration number lookup — official National Tax Agency data.
Validate Japanese invoice registration numbers (T+13) and corporate numbers. No API key.
Japan Corporate Number (法人番号) & Qualified Invoice (インボイス / T-number) lookup for KYB & accounting.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to access and compare Japanese public data from e-Stat, corporate registration, real estate, and invoice APIs, automatically converting codes into human-readable formats with sources and timestamps.1439 PyPI13MIT
- AlicenseAqualityBmaintenanceEnables AI agents to validate a Japanese qualified invoice against the six required items, reduced-rate markings, per-rate totals, and once-per-invoice-per-rate tax rounding, while flagging the common line-by-line rounding mistake, and to normalize and verify T + 13-digit registration numbers. Read-only tools also compute expected consumption tax for a given amount, rate, price basis, and rounding method.3MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to identify Japanese companies by name, look up corporate numbers, addresses, and qualified invoice registration status, and batch-match company lists using read-only tools.4644 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables lookup of any of Japan's 5.8M registered 13-digit corporate numbers for legal name, katakana/English name, address, corporate kind and merger/closure status, with check-digit validation and clear reasons for malformed or missing numbers. Also supports company search by Japanese or romanised name, corporate suffix, and prefecture, bridging to GLEIF LEI records when the tax agency published no English name.65 npmMIT