Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words Sign in

Houki Nta MCP

by shuji-bonjiversion 0.27.1i★ 2iRuns on your computerRepository ↗
Registry nameio.github.shuji-bonji/houki-nta-mcp

How to install

What it does

Japan NTA tax notices (tsutatsu) and Q&A, marked with legal_status and linked back to the law.

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Law & government data

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity6/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness7/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score13/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install Houki Nta MCP. Follow https://mcp.popnx.com/i/shuji-bonji-houki-nta-mcp.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 13, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Houki Nta MCP for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "houki-nta": { "command": "npx", "args": [ "-y", "@shuji-bonji/houki-nta-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Houki Nta MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "houki-nta": {
          "command": "npx",
          "args": [
            "-y",
            "@shuji-bonji/houki-nta-mcp"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use Houki Nta MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Houki Nta MCP or shows a Houki Nta MCP tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Houki Nta MCP yet

Houki Nta MCP runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Houki Nta MCP

  • Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)

B · Others in Law & government data that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Houki Nta MCP for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user houki-nta -- npx -y @shuji-bonji/houki-nta-mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Houki Nta MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user houki-nta -- npx -y @shuji-bonji/houki-nta-mcp
  4. Type /mcp in Claude Code

    You should see Houki Nta MCP listed as connected

  5. Try it

    Use Houki Nta MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Houki Nta MCP or shows a Houki Nta MCP tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Houki Nta MCP for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "houki-nta": { "command": "npx", "args": [ "-y", "@shuji-bonji/houki-nta-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Houki Nta MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use Houki Nta MCP and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Houki Nta MCP or shows a Houki Nta MCP tool in the answer, you are connected

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Houki Nta MCP for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "houki-nta": { "type": "stdio", "command": "npx", "args": [ "-y", "@shuji-bonji/houki-nta-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Houki Nta MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use Houki Nta MCP and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Houki Nta MCP or shows a Houki Nta MCP tool in the answer, you are connected

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Houki Nta MCP💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user houki-nta -- npx -y @shuji-bonji/houki-nta-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "houki-nta": {
      "command": "npx",
      "args": [
        "-y",
        "@shuji-bonji/houki-nta-mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "houki-nta": {
      "command": "npx",
      "args": [
        "-y",
        "@shuji-bonji/houki-nta-mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "houki-nta": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@shuji-bonji/houki-nta-mcp"
      ]
    }
  }
}

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
119/wk
Connection
Runs on your computer
Latest versioni
0.27.1
Published to registryi
Oct 12, 2026
Code last changedi
Oct 12, 2026
Maker
shuji-bonji
Packages
npm: @shuji-bonji/houki-nta-mcp
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 20, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account shuji-bonji, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 39 days ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for @shuji-bonji/houki-nta-mcp@0.27.1

Checks only this package version, not every dependency · checked Nov 15, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/shuji-bonji-houki-nta-mcp.svg)](https://mcp.popnx.com/en/servers/shuji-bonji-houki-nta-mcp)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Law & government datai

  • More stars than 92% of the other 1961 servers in this category
  • Published to the registry more recently than 44% of the other 1961 servers in this category
  • Basic checks equal to or better than 99% of the other 1961 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Houki Nta MCP safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 39 days ago, and the latest version (0.27.1) reached the registry 39 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.

What can I use instead?

In the same category: Global law, Open Legal Data (Germany), LibreJustice, InfraNode, Fedlex Connector

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Global law

The law of nearly every country on earth, any date: read it, see what changed it, check citations.

by lexifinaWidely used★ 2.1KUpdated 10 days ago

Runs in the cloud✓ lexifina.com

LibreJustice

Search French-language and European case law and French legal texts (codes, statutes, treaties).

by librejusticeEarly★ 38Updated 2 months ago

Runs in the cloud✓ service owner · librejustice.fr

InfraNode

Keyless open data for 84 German cities: 12 lean read-only MCP tools covering 67 data types.

by street1983nkEarly★ 18Updated 5 months ago

Runs in the cloud✓ service owner · infranode.dev

Fedlex Connector

Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.

by JayTheSkierEarly★ 8Updated 7 months ago

Runs in the cloud✓ service owner · fedlex-connector.ch
Compared with similar ones
This one
Houki Nta MCP
Global lawOpen Legal Data (Germany)LibreJusticeInfraNodeFedlex Connector
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyNoNoNoNoNoNo
Add with + in ClaudeNoNoNoNoNoNo
Basic checks3/34/44/44/44/44/4
LicenseMITNOASSERTIONMITApache-2.0Apache-2.0MIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

Houki NTA MCP Server

税務の下調べで、国税庁(NTA)の通達と事例を LLM から引くための MCP サーバーです。国税庁公式サイトの 基本通達・改正通達・事務運営指針・文書回答事例・タックスアンサー・質疑応答事例 をローカル SQLite に取り込み、FTS5 で全文検索します。「法律で決まっている」と「通達でそうなっている」を混ぜずに、legal_status(通達は国民を拘束しない旨)と根拠条文への案内と鮮度を添えて返します。

法律本文(法・政令・省令)は別 MCP の @shuji-bonji/houki-egov-mcp が担当します。通達の応答からは next_actions で houki-egov-mcp の get_law へ戻れます。

🔗 4 つを併用したい方へ — houki-egov-mcp (法令本文) と pdf-reader-mcp (添付 PDF 抽出) と組み合わせた install → 設定 → 実例 4 ユースケース をまとめた統合ガイドを用意しています。

👉 [docs/HOUKI-FAMILY-INTEGRATION.md](docs/HOUKI-FAMILY-INTEGRATION.md)

できること

経理・税務の担当者や、会計・税務のアプリを作る開発者が、国税庁の公式な解説と通達を根拠つきで確かめるための機能です。

  • 下の表の 6 種類の文書を、キーワードで検索できます。応答には出典の URL と取得日時が付きます
  • 応答ごとに legal_status を付け、「法律で決まっている」ことと「通達や解説でそうなっている」ことを区別できるようにします
  • 基本通達の応答には、その通達が解釈している法律・政令・省令と、houki-egov-mcp で条文を読むための next_actions が付きます
  • 改正通達の添付 PDF(新旧対照表など)は、どれを先に読むべきかと読み方を返します
種類件数拘束力(legal_status)
基本通達 4 種(消基通・所基通・法基通・相基通)3,456 項税務署員を拘束する。国民・裁判所は拘束しない
改正通達118 件同上
事務運営指針32 件同上
文書回答事例487 件個別の照会への国税庁の回答。一般的な法的拘束力はない
タックスアンサー746 件国税庁の参考解説。法的拘束力はない
質疑応答事例(9 税目)1,841 件同上

件数は、2026-09-07〜09-24 JST に全種別を取り込んだ手元の DB の実数です。国税庁サイトの更新で増減します。

相談の形の問いでの使い方

「会社員で、副業の所得が 20 万円以下なら確定申告はしなくてよいか」と尋ねると、LLM が nta_search_tax_answer(keyword="給与所得者で確定申告が必要な人") を呼び、タックスアンサーのコード 1900「給与所得者で確定申告が必要な人」と、1906「給与所得者がネットオークション等により副収入を得た場合」が返ります。応答の legal_status は、これらが国税庁の参考解説で法的拘束力を持たないことを示します。

根拠の条文(所得税法第 121 条第 1 項「確定所得申告を要しない場合」)は、houki-egov-mcp の get_law で読めます。解説と条文を並べると、給与の支払者の数や年末調整の有無のように、答えを分ける条件が分かります。個別の事案に当てはめた結論(「あなたは申告が不要です」)は返しません。理由は業法との関係に書いています。

まず試す

claude_desktop_config.json に次の設定を足して、Claude Desktop を再起動します。

{

"mcpServers": { "houki-nta": { "command": "npx", "args": ["-y", "@shuji-bonji/houki-nta-mcp"] } } }

取り込みをしなくても、nta_get_tsutatsu・nta_get_tax_answer・nta_get_qa は国税庁サイトから直接取ります。検索ツール(nta_search_*)には取り込みが要ります。まず 1 本だけ入れるなら、次のコマンドで消費税法基本通達を約 3〜5 分で取り込めます。

npx -y @shuji-bonji/houki-nta-mcp --quickstart

全種別の取り込みと税目ごとの絞り込みは「初回セットアップ(bulk DL)」をご覧ください。

主な機能

  • 6 大コンテンツに対応: 基本通達 4 種 + 改正通達・事務運営指針・文書回答事例・タックスアンサー・質疑応答事例
  • 14 ツール提供: 取得 + FTS5 全文検索 + PDF メタ取得 + 略称解決
  • 高速応答: bulk DL 済なら DB から即時応答(~10ms)。未投入のときの動きは取得ツールごとに違います(取得ツールが DB をどう使うか)
  • 正規化済み検索: Normalize-everywhere 原則で全角・半角ゆらぎを吸収(数字・英字・ハイフン・チルダ・空白。実装は houki-hub family 共通の @shuji-bonji/houki-abbreviations)
  • 改正検知: SHA-1 content_hash で個別文書の変化を検知、4 パターン集計(新規 / 更新 / 削除 / 移動)
  • HP 構造変更耐性 (v0.6.0 / v0.9.4): 9 種別 baseline で履歴管理 + --health-check CLI で週次 canary 検証 + --check-baseline-drift で menu.htm を真の正典として世代移行 (sozoku2 / hyoka_new 等) を事前検知 + soft-404 (/error/404.htm 着地) を fetchNtaPage で自動 fail させる二重防御。--check-baseline-drift が判定するのは基本通達 4 種と改正通達の索引の 5 件で、ほかの 4 件は not-applicable です(v0.24.0)
  • 添付 PDF kind 分類 (v0.7.0): タイトルから 6 種別(新旧対照表 / 別紙・別表 / Q&A / 参考資料 / 通知・連絡 / その他)に自動分類。Markdown 出力は kind 優先度ソートの表 + pdf-reader-mcp 呼び出し例つき
  • `hasPdf` 検索フィルタ + `nta_inspect_pdf_meta` (v0.7.1): PDF 付きの重要文書だけを抽出 / PDF メタだけを軽量に返す軽量 API を提供
  • 添付 PDF の読み方を返し、読み手は固定しない (v0.19.0): 添付 PDF の kind(comparison=新旧対照表 / attachment=別紙・別表 など。「新旧対応表」の表記ゆれにも対応)ごとに read_strategy(表として取る / 本文として読む / 先頭を見て決める)と layout_note(紙面の組み方)を付ける。save: true で PDF をサーバー側に保存して絶対パスを返す。next_actions に pdf-reader-mcp の呼び出し例(保存済みなら extract_tables / read_text に file_path、未保存なら read_url に url)と、他の PDF 読み取りツール向けの汎用の 1 件を置く。houki-nta-mcp 自身は PDF の本文を読まない。改正通達で「別紙 N」とだけ題した PDF は新旧対照表本体のことが多いので、comparison として返す (v0.20.0)
  • レスポンスに `freshness` 付き: 利用者(LLM)が staleness を判定でき、db_path でどの DB の結果かが分かります(v0.25.0)
  • 法的位置付けを明示: 各レスポンスに legal_status フィールド(通達 = 税務署員のみ拘束、QA = 参考情報、等)
データフロー全体俯瞰

国税庁 HP の 6 大コンテンツを bulk DL で SQLite cache に投入し、MCP tool はローカル DB を先に引いて応答します。DB に無かったときの動きは取得ツールごとに違うので、取得ツールが DB をどう使うかを参照してください。

flowchart TB

subgraph NTA["国税庁 HP (www.nta.go.jp)"] direction TB N1["基本通達 4 種 消基通 / 所基通 法基通 / 相基通"] N2["改正通達"] N3["事務運営指針"] N4["文書回答事例"] N5["タックスアンサー"] N6["質疑応答事例"] end

subgraph DL["bulk DL 層 (CLI)"] DLA["--bulk-download-everything または個別 --bulk-download-*"] end

subgraph DBLayer["SQLite cache ~/.cache/houki-nta-mcp/cache.db"] direction TB DB1["document (本文 + content_hash)"] DB2["section / clause (章節構造)"] DB3["FTS5 全文検索 (Normalize-everywhere)"] end

subgraph Tools["14 MCP tool"] direction TB T1["nta_get_* × 6 nta_search_* × 6"] T2["nta_inspect_pdf_meta resolve_abbreviation"] end

NTA -->|"scrape + parse (週次 health-check で監視)"| DLA DLA -->|"normalize + insert"| DBLayer DBLayer -->|"DB-first ~10ms"| Tools NTA -.->|"live fallback ~700ms (DB 未投入時のみ)"| Tools Tools -->|"freshness / legal_status を埋め込んで応答"| LLM(["LLM / Claude"])

classDef nta fill:#fff3cd,stroke:#ffc107,color:#333 classDef db fill:#d4edda,stroke:#28a745,color:#333 classDef tool fill:#cce5ff,stroke:#0066cc,color:#333 classDef cli fill:#e2d6f3,stroke:#7952b3,color:#333 class NTA nta class DBLayer db class Tools tool class DL cli

提供ツール(14 ツール)

Tool用途
nta_get_tsutatsu通達本文を取得(DB → 無ければ国税庁サイト、4 通達対応)
nta_search_tsutatsu通達を FTS5 全文検索(freshness 付き)
nta_get_kaisei_tsutatsu改正通達を docId で取得(DB のみ。本文 + kind 分類付き PDF 表)
nta_search_kaisei_tsutatsu改正通達を FTS5 検索(hasPdf フィルタ・freshness)
nta_get_jimu_unei事務運営指針を取得(DB のみ)
nta_search_jimu_unei事務運営指針を FTS5 検索(hasPdf フィルタ・freshness)
nta_get_bunshokaitou文書回答事例を取得(DB のみ)
nta_search_bunshokaitou文書回答事例を FTS5 検索(hasPdf フィルタ・freshness)
nta_get_tax_answerタックスアンサー本文を取得(DB → 無ければ国税庁サイト)
nta_search_tax_answerタックスアンサーを FTS5 全文検索(hasPdf フィルタ・freshness)
nta_get_qa質疑応答事例の本文を取得(DB → 無ければ国税庁サイト)
nta_search_qa質疑応答事例を FTS5 全文検索(topic で税目の絞り込み・freshness 付き)
nta_inspect_pdf_meta指定文書の添付 PDF の一覧に kind と読み方(read_strategy / layout_note)を付けて返す。save: true で PDF を保存して絶対パスを返し、next_actions に pdf-reader-mcp の呼び出し例と汎用の 1 件を置く。本文は読まない (v0.7.1、v0.19.0 で読み手を固定しない形に)
resolve_abbreviation略称→エントリ解決(houki-abbreviations 経由)
取得ツールが DB をどう使うか

取得ツール 6 つは、ローカル DB を先に引く点は同じですが、DB に無かったときの動きが 2 通りに分かれます(v0.16.0 / Issue #29)。

ツールDB を先に引くDB に無いときDB へ書き戻す応答の source
nta_get_tsutatsu引く国税庁サイトから取得書き戻す"db" / "live"
nta_get_qa引く国税庁サイトから取得書き戻す"db" / "live"
nta_get_tax_answer引く国税庁サイトから取得書き戻す"db" / "live"
nta_get_kaisei_tsutatsu引くDOC_NOT_FOUND を返す—付かない
nta_get_jimu_unei引くDOC_NOT_FOUND を返す—付かない
nta_get_bunshokaitou引くDOC_NOT_FOUND を返す—付かない

ローカル DB を開けないとき(SQLite でないファイル、フォルダー、パスの途中が普通のファイル、DB のファイルを読む権限が無い、置き場所のフォルダー(またはパスの途中のフォルダー)に入る権限が無い)、nta_get_tsutatsu・nta_get_qa・nta_get_tax_answer は DB を使わずに国税庁サイトから取って返します(source: "live")。取った内容は DB に書かず、MCP サーバーのログに warn の行を出します。目次とタックスアンサーの索引も保存しないので、呼び出しのたびに国税庁サイトから取り直します(v0.26.0。v0.25.x までは国税庁サイトに取りに行かずに INTERNAL_ERROR を返していました)。置き場所のフォルダーに入る権限が無いときは、v0.26.x では DB のファイルが無いものとして扱い、取った内容を DB に書こうとして書けず、warn の行も出していませんでした(v0.27.0 で「開けない」に含めました)。

nta_get_qa と nta_get_tax_answer は、国税庁サイトにそのページが無い(HTTP 404・410、または /error/404.htm への転送)と、番号の誤りとして DOC_NOT_FOUND(retryable: false)を返し、next_actions で検索ツールを案内します。v0.21.x までは SOURCE_API_ERROR(retryable: true)でした。

nta_get_tax_answer は、DB に無い記事の URL を国税庁の索引(/taxes/shiraberu/taxanswer/code/)で決めます(v0.24.0)。8xxx(災害)の記事も取れます。索引は DB に保存して使い回し、番号が見つからないときだけ取り直します。索引に無い番号は、記事を取りに行かずに DOC_NOT_FOUND を返します。v0.23.0 までは番号の先頭の桁で税目のフォルダを決めていたため、8xxx は INVALID_ARGUMENT になり、先頭の桁とフォルダが合わない記事(2010・4402・7400 など)は DOC_NOT_FOUND になっていました。

改正通達・事務運営指針・文書回答事例の 3 つは、docId から個別ページの URL を組み立てるのに税目フォルダの世代差(sozoku / sozoku2 など)を解く必要があるため、国税庁サイトへは取りに行きません。エラーには --bulk-download-* の案内が付きます。

nta_get_qa と nta_get_tax_answer が DB から返せるのは、`structured_json` を持つ行だけです。この列は v0.16.0 で増えたので、v0.15.x までに投入した行は持っていません。持っていない行は国税庁サイトから取得して書き戻すので、1 度引けば次からは DB から返ります。--bulk-download-qa / --bulk-download-tax-answer を実行しても埋まります(この 2 種別では、構造を持たない行は条件付き GET を使わずに取り直します)。

国税庁の索引から消えた文書(v0.17.0 / Issue #30)

bulk download を再実行したときに、国税庁の索引から消えていた文書は DB から消しません。索引から外れても、過去の課税期間の判断では依然として意味を持つ通達があるためです。

代わりに document.orphaned_at に「索引から消えたことを最初に確認した日時」を入れ、応答で現行の文書と区別できるようにしています。

応答付くもの
nta_search_*(5 種別)各件に index_status: "removed_from_index" と orphaned_at、search_notes に「N 件のうち M 件は索引から外れています」の 1 行
nta_get_*(5 種別)index_status / orphaned_at / notice(Markdown 形式では「索引の状態」の行と注記)

0.24.1 から、検索ツールの freshness は国税庁の索引にある文書だけで判定します。索引から消えた文書(index_status: "removed_from_index")は取り直されないため、0.24.0 までは、その古い取得日時のせいで投入をやり直しても stale や outdated のままになることがありました。DB を作り直す必要はありません。

検索結果から除外はしません。除外すると、過去の期間を調べたい利用者が引けなくなります。

印の付け外しは --bulk-download-* のときに行います。

  • 索引に戻っていれば印を外します(国税庁サイトの一時的な不整合や、世代ディレクトリの移行中に消えたように見える場合があるため)
  • 索引にある文書と題名が一致する行には印を付けません(sozoku → sozoku2 のような世代移行で doc_id が変わっただけの文書を、消えたと数えないため)
  • 索引の取得に失敗した税目がある実行では、判定そのものを行いません(その税目の文書が丸ごと「消えた」と判定されるため)
対応通達(4 種)
通達略称TOC スタイルclause 番号体系
消費税法基本通達消基通shohi3 階層 1-4-13の2
所得税基本通達所基通shotoku2 階層 2-4の2 / 共通通達 183~193共-1
法人税基本通達法基通hojin3 階層、節の2 を含む 1-3の2-N
相続税法基本通達相基通sozokuflat 構造、ナカグロ複数条共通 1の3・1の4共-1

この 4 種以外の通達(電帳法取通 など)は、国税庁サイトから取ることも、投入のフラグ(--bulk-download の --tsutatsu)で DB に入れることもできません。nta_get_tsutatsu は TSUTATSU_NOT_FOUND を返し、hint でそのことを知らせます(v0.27.0。v0.26.x は実行できない投入のコマンドを案内していました)。

clause 番号は Normalize-everywhere で全角→半角統一されているため、ユーザーが半角・全

Only the beginning is shown; read the rest in the repo