Content
[English](README.en.md) |
# Tool List
`open-zeimu-mcp` is an OSS MCP server for searching Japanese tax information. It is a tool for tax accountants and accounting firms to search for publicly available tax information directly from AI assistants like Claude.
## What can this tool do?
- Directly search for National Tax Agency's Tax Answers from AI assistants like Claude
- Search for laws such as the Income Tax Law and Corporate Tax Law on the spot
- Collect and confirm primary information such as notifications, Q&A examples, and decision examples
- Shorten the tax confirmation process from "searching for search destinations"
## What is MCP?
MCP is like a plugin that adds specialized knowledge to AI assistants.
- Plugin: A mechanism to add functions to your usual AI later
- Specialized knowledge: In this case, publicly available tax information and laws
In other words, by using MCP, you can add a "tax information searcher" to your AI assistant.
## How to use MCP
### Prerequisites
- MCP-compatible AI tools like Claude Desktop (AI apps that can use MCP)
- Environment where `npx` can be used (temporary execution command included with Node.js)
### 1. Using Claude Desktop
In Claude Desktop, write the MCP server information in the setting file `claude_desktop_config.json`.
Usually located at `~/Library/Application Support/Claude/claude_desktop_config.json` on Mac.
Example settings:
```json
{
"mcpServers": {
"open-zeimu-mcp": {
"command": "npx",
"args": ["-y", "@zeimu-ai/open-zeimu-mcp"],
"env": {
"EMBEDDING_BACKEND": "none",
"LOG_LEVEL": "info",
"DATA_DIR": "./data"
}
}
}
}
```
Steps:
1. Open Claude Desktop's setting file `claude_desktop_config.json`
2. Add the above content to `mcpServers`
3. Save
4. Restart Claude Desktop
5. Ask tax-related questions in AI chat
### 2. Using npx
Using `npx` (Node.js temporary execution command), you can start without installing it in advance.
Here's what to do:
1. Open the setting screen of MCP-compatible AI tools
2. Specify `npx` for `command`
3. Specify `-y @zeimu-ai/open-zeimu-mcp` for `args`
4. Set `env` such as `EMBEDDING_BACKEND` as needed
5. Save and restart
### 3. What you can ask
You can input the following questions directly to the AI assistant:
- "Please tell me about the simplified taxation system for consumption tax"
- "Please investigate the special deduction for blue returns in the Income Tax Law"
- "Please confirm the concept of entertainment expenses in the Corporate Tax Law"
- "Please search for explanations of deductions for dependents in Tax Answers"
- "Please investigate notifications related to input tax deductions"
### 4. Image of screen operation
- Open Claude Desktop
- Add MCP server to setting file
- Restart
- Input questions to AI
- Confirm sources and laws in returned answers as needed
## Q&A
### Can I use it for free?
This tool itself is OSS (open-source software), so you can use it for free. However, there may be charges for AI assistants like Claude Desktop.
### Where does the data come from?
It mainly uses the following public information:
- National Tax Agency's Tax Answers
- National Tax Agency's notifications, document answers, Q&A examples
- National Tax Bureau's decision examples
- e-Gov law API (law public data)
### Will my data be sent?
This tool is for searching publicly available tax information. It does not acquire your accounting data or in-house database.
However, the question text input to the AI assistant is sent according to the specifications of the AI tool used. It is safe to operate with limited input of personal information and confidential information.
## Information for developers
The following are detailed information necessary for setup and development.
- `health`: Returns operating status, uptime, and vector asset status
- `stats`: Returns the number of documents for each source type and lexical/semantic readiness
- `lexical_search`: Lexical search for bundled Markdown data
- `list_tax_answer_categories` / `get_tax_answer` / `search_tax_answer`
- `list_written_answer_categories` / `get_written_answer` / `search_written_answer`
- `list_tsutatsu_categories` / `get_tsutatsu` / `search_tsutatsu`
- `list_qa_case_categories` / `get_qa_case` / `search_qa_case`
- `list_saiketsu_categories` / `get_saiketsu` / `search_saiketsu`
- `get_law` / `search_law`: Call e-Gov law API v2 with 24h in-memory cache
- `crawl:tax-answer`: Normalize NTA Tax Answers to Markdown + metadata
- `crawl:written-answer`: Normalize NTA document answers to Markdown + metadata
- `crawl:tsutatsu`: Normalize NTA notifications to Markdown + metadata
- `crawl:qa-case`: Normalize NTA Q&A examples to Markdown + metadata
- `crawl:saiketsu`: Normalize KFS decision examples to Markdown + metadata
- `precompute:embeddings`: Precompute embeddings for packaged sources in chunks
- `release:vectors`: Generate release assets for local semantic search
## Quick Start
```bash
npm install @zeimu-ai/open-zeimu-mcp
```
Example MCP client settings:
```json
{
"mcpServers": {
"open-zeimu-mcp": {
"command": "npx",
"args": ["-y", "@zeimu-ai/open-zeimu-mcp"],
"env": {
"EMBEDDING_BACKEND": "none",
"LOG_LEVEL": "info",
"DATA_DIR": "./data"
}
}
}
}
```
## Settings
| Variable | Default | Description |
| --- | --- | --- |
| `EMBEDDING_BACKEND` | `none` | `none` / `local` / `supabase` |
| `LOG_LEVEL` | `info` | Pino log level |
| `DATA_DIR` | `./data` | Root directory of dataset |
| `VECTORS_CACHE_DIR` | `~/.cache/open-zeimu-mcp/vectors` | Local vector cache |
| `ONNX_MODEL_FILENAME` | `bge-m3-int8.onnx.tar.gz` | Local semantic model asset name |
| `TOKENIZER_FILENAME` | `tokenizer.json` | Tokenizer asset name |
| `TOKENIZER_CONFIG_FILENAME` | `tokenizer_config.json` | Tokenizer config asset name |
| `EMBEDDING_CHUNK_SIZE` | `512` | Character chunk length used for precomputation and search |
| `EMBEDDING_CHUNK_OVERLAP` | `64` | Overlap width of adjacent chunks |
| `EMBEDDING_MAX_TOKENS` | `512` | Maximum token number for query/chunk encoding |
Settings are read only from `process.env`. Do not directly read `.env`.
When `EMBEDDING_BACKEND=local`, local semantic backend is ready when there are model + tokenizer and at least one source vector asset under `VECTORS_CACHE_DIR/<package-version>/`.
- `bge-m3-int8.onnx.tar.gz`
- `tokenizer.json`
- `tokenizer_config.json`
- `<source_type>-vectors-<package-version>.bin`
- `<source_type>-vectors-<package-version>.index.json`
If any are missing, it falls back and you can check the status with `health`.
## Usage Examples
Category-based Tax Answer search:
```json
{
"name": "search_tax_answer",
"arguments": {
"query": "basic deduction",
"category": "shotoku",
"limit": 5
}
}
```
Semantic search:
```json
{
"name": "search_tax_answer",
"arguments": {
"query": "purpose of salary deduction",
"category": "shotoku",
"limit": 5,
"search_mode": "semantic"
}
}
```
Hybrid search:
```json
{
"name": "search_tax_answer",
"arguments": {
"query": "basic deduction",
"category": "shotoku",
"limit": 5,
"search_mode": "hybrid"
}
}
```
List of document answer categories:
```json
{
"name": "list_written_answer_categories",
"arguments": {}
}
```
Document answer search with `page_hint`:
```json
{
"name": "search_written_answer",
"arguments": {
"query": "page 2",
"category": "hyoka",
"limit": 5
}
}
```
Notification search:
```json
{
"name": "search_tsutatsu",
"arguments": {
"query": "input tax deduction",
"category": "shohi",
"limit": 5
}
}
```
Q&A example search:
```json
{
"name": "search_qa_case",
"arguments": {
"query": "entertainment expenses",
"category": "hojin",
"limit": 5
}
}
```
Decision example retrieval/search:
```json
{
"name": "get_saiketsu",
"arguments": {
"id": "sai-001"
}
}
```
```json
{
"name": "search_saiketsu",
"arguments": {
"query": "eviction fee",
"category": "shotoku",
"limit": 5
}
}
```
## Tax Answer Crawler
Crawl NTA Tax Answers from `www.nta.go.jp`, respecting `robots.txt` and maintaining `1 req/sec`.
Dry-run:
```bash
npm run crawl:tax-answer -- --ids 1200,3105 --data-dir ./data --repo-dir .
```
Apply:
```bash
npm run crawl:tax-answer -- --apply --limit 50 --data-dir ./data --repo-dir .
```
Output:
```text
data/tax_answer/<id>/<id>.md
data/tax_answer/<id>/<id>.meta.json
```
## Document Answer Crawler
Crawl NTA document answers from `www.nta.go.jp`, respecting `robots.txt` and maintaining `1 req/2sec`.
Dry-run:
```bash
npm run crawl:written-answer -- --ids bunshokaito-shotoku-250101,bunshokaito-hojin-250102 --data-dir ./data --repo-dir .
```
Apply:
```bash
npm run crawl:written-answer -- --apply --limit 80 --data-dir ./data --repo-dir .
```
Output:
```text
data/written_answer/<id>/<id>.md
data/written_answer/<id>/<id>.meta.json
```
## Notification Crawler
Crawl NTA notifications from `www.nta.go.jp`, respecting `robots.txt` and maintaining `1 req/2sec`.
Dry-run:
```bash
npm run crawl:tsutatsu -- --ids tsutatsu-shotoku-01-01,tsutatsu-hojin-01-01_01 --data-dir ./data --repo-dir .
```
Apply:
```bash
npm run crawl:tsutatsu -- --apply --limit 150 --data-dir ./data --repo-dir .
```
Output:
```text
data/tsutatsu/<id>/<id>.md
data/tsutatsu/<id>/<id>.meta.json
```
## Q&A Example Crawler
Crawl NTA Q&A examples from `www.nta.go.jp`, respecting `robots.txt` and maintaining `1 req/2sec`.
Dry-run:
```bash
npm run crawl:qa-case -- --ids qa-shotoku-01-01,qa-hojin-01-01 --data-dir ./data --repo-dir .
```
Apply:
```bash
npm run crawl:qa-case -- --apply --limit 100 --data-dir ./data --repo-dir .
```
Output:
```text
data/qa_case/<id>/<id>.md
data/qa_case/<id>/<id>.meta.json
```
## Decision Example Crawler
Crawl KFS decision examples from `www.kfs.go.jp`, respecting `robots.txt` and maintaining `1 req/2sec`.
Dry-run:
```bash
npm run crawl:saiketsu -- --ids saiketsu-01-001,saiketsu-01-002 --data-dir ./data --repo-dir .
```
Apply:
```bash
npm run crawl:saiketsu -- --apply --limit 50 --data-dir ./data --repo-dir .
```
Output:
```text
data/saiketsu/<id>/<id>.md
data/saiketsu/<id>/<id>.meta.json
```
## Data License
- NTA Tax Answers: National Tax Agency public data
- NTA document answers: National Tax Agency public data
- NTA notifications: National Tax Agency public data
- NTA Q&A examples: National Tax Agency public government work (CC-BY 4.0 compatible)
- KFS decision examples: National Tax Bureau public decision examples
## Vector Release Scaffold
```bash
npm run release:vectors
npm run precompute:embeddings -- 0.1.0-alpha.0
```
Generate `artifacts/vectors/release-plan.json` and placeholder directory. `precompute:embeddings` outputs `<source_type>-vectors-<version>.bin` and `<source_type>-vectors-<version>.index.json` to `VECTORS_CACHE_DIR/<version>/`. Actual ONNX model, tokenizer asset, and vector binary are not included in git but uploaded as GitHub Release assets.
## Current Status
Under active development. Currently implemented: lexical search, semantic search, hybrid search, tax-answer crawler, document answer crawler, notification crawler, 5 source type packaged retrieval/search, category filter, e-Gov law acquisition, vector precomputation, release dry-run scaffold.
## Development
```bash
npm install --include=dev
npm run typecheck
npm test
npm run build
npm run precompute:embeddings -- 0.1.0-alpha.0
npm run release:vectors
npx changeset status
npm run release:dry-run
npm start
```
Details:
- Architecture: [docs/architecture.md](docs/architecture.md)
- Tool API examples: [docs/api.md](docs/api.md)
- Data-source/vector operations: [docs/data-sources.md](docs/data-sources.md)
- Roadmap: [docs/ROADMAP.md](docs/ROADMAP.md)
- Testing notes: [docs/TESTING.md](docs/TESTING.md)
## License
[MIT](LICENSE)
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available