Metadata-Version: 2.4
Name: autonomath-mcp
Version: 0.5.0
Summary: REST + MCP context-compression layer for Japanese institutional public data. jpcite turns long PDFs, official pages, and search results into compact Evidence Packets with source URLs, fetched timestamps, known gaps, and compatibility/exclusion rules before downstream AI agents draft answers. 3 yen/billable unit metered (3.30 tax-incl), anonymous 3/day per IP free.
Project-URL: Homepage, https://jpcite.com
Project-URL: Documentation, https://jpcite.com/docs/
Project-URL: Repository, https://github.com/shigetosidumeda-cyber/autonomath-mcp
Project-URL: Issues, https://github.com/shigetosidumeda-cyber/autonomath-mcp/issues
Author-email: Bookyou株式会社 <info@bookyou.net>
License: MIT
License-File: LICENSE
Keywords: agent-tools,anthropic,citation,claude,compliance,cursor,evidence,gemini,government,gpt,invoice,japan,japanese,law,legal-tech,loan,mcp,mcp-server,rag,regulation,subsidy,tax,法令,税制,補助金,適格請求書
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: bcrypt<6,>=4.2
Requires-Dist: beautifulsoup4<5,>=4.12
Requires-Dist: email-validator<3,>=2.0
Requires-Dist: fastapi<0.136.2,>=0.136.1
Requires-Dist: httpx<1.0,>=0.28
Requires-Dist: icalendar<7,>=5.0
Requires-Dist: jinja2>=3.1
Requires-Dist: keyring<26,>=24.0
Requires-Dist: mcp>=1.2
Requires-Dist: openpyxl<4,>=3.1
Requires-Dist: opentelemetry-api<2,>=1.27
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.27
Requires-Dist: opentelemetry-instrumentation-fastapi<1,>=0.48b0
Requires-Dist: opentelemetry-sdk<2,>=1.27
Requires-Dist: orjson<4,>=3.10
Requires-Dist: pdfplumber<1,>=0.11
Requires-Dist: pydantic-settings<3,>=2.6
Requires-Dist: pydantic<3,>=2.9
Requires-Dist: python-docx<2,>=1.1
Requires-Dist: python-multipart<1,>=0.0.27
Requires-Dist: scipy<2,>=1.14
Requires-Dist: sentry-sdk[fastapi]<3,>=2.19
Requires-Dist: sqlite-utils<4,>=3.38
Requires-Dist: starlette<2,>=1.0.1
Requires-Dist: stripe<13,>=11.3
Requires-Dist: structlog>=24.4
Requires-Dist: tenacity<10,>=9.0
Requires-Dist: uvicorn[standard]<0.40,>=0.32
Requires-Dist: weasyprint>=62.0
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: duckdb>=1.1; extra == 'dev'
Requires-Dist: httpx>=0.28; extra == 'dev'
Requires-Dist: huggingface-hub<1,>=0.25; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pandas>=2.2; extra == 'dev'
Requires-Dist: playwright>=1.48; extra == 'dev'
Requires-Dist: pre-commit>=4.0; extra == 'dev'
Requires-Dist: pyarrow<25,>=18; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.6; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: rapidfuzz<4,>=3.6; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Provides-Extra: e2e
Requires-Dist: httpx>=0.28; extra == 'e2e'
Requires-Dist: playwright>=1.48; extra == 'e2e'
Requires-Dist: pytest-asyncio>=0.24; extra == 'e2e'
Requires-Dist: pytest-playwright>=0.6; extra == 'e2e'
Requires-Dist: pytest>=8.3; extra == 'e2e'
Provides-Extra: site
Requires-Dist: jinja2>=3.1; extra == 'site'
Requires-Dist: pykakasi>=2.2; extra == 'site'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://jpcite.com"><img src="https://jpcite.com/assets/github-social-card.png" alt="jpcite — Japan regulatory MCP server (60-second answers for AI agents)" width="800"></a>
</p>

# jpcite

> **packets = ingredients, your AI agent finishes**

日本の制度・税法・法令の **ingredient (素材)** を AI agent に提供する MCP server.

agent が packet を読み、user 文脈で finishing (~500 token, ~¥10) して end-user に返す前提.
合計 **¥30-¥45 (ingredient + finishing)** で LLM 単独 ¥120 より 67% 安い + 出典付き.

**English**: jpcite packets are **ingredients (foundation data)**, not final answers. AI agents read packets and apply **finishing** (~500 tokens, ~¥10) to produce end-user deliverables. Total cost: ingredient (¥3-¥30) + finishing (¥5-¥15) = ¥30-¥45 typical, vs LLM-only ¥120.

<p align="center">
  <a href="https://jpcite.com/try"><img src="https://img.shields.io/badge/Try%20free-3%20req%2Fday-4c1.svg?style=for-the-badge" alt="Try free"></a>
  <a href="https://pypi.org/project/autonomath-mcp/"><img src="https://img.shields.io/badge/pip%20install-autonomath--mcp-3776AB.svg?style=for-the-badge&logo=pypi&logoColor=white" alt="pip install autonomath-mcp"></a>
  <a href="https://github.com/shigetosidumeda-cyber/autonomath-mcp"><img src="https://img.shields.io/badge/GitHub-Star%20%E2%98%85-181717.svg?style=for-the-badge&logo=github&logoColor=white" alt="GitHub Star"></a>
</p>

mcp-name: io.github.shigetosidumeda-cyber/autonomath-mcp

**v0.4.0 LIVE on Fly.io Tokyo** — production at `api.jpcite.com`. Current public docs, manifests, and release tags are the source of truth for version and pricing.

[![PyPI version](https://img.shields.io/pypi/v/autonomath-mcp.svg)](https://pypi.org/project/autonomath-mcp/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/)
[![MCP 2025-06-18](https://img.shields.io/badge/MCP-2025--06--18-6E56CF.svg)](https://modelcontextprotocol.io/)
[![Made in Japan](https://img.shields.io/badge/made%20in-%F0%9F%87%AF%F0%9F%87%B5-red.svg)](https://jpcite.com)

[![Smithery](https://img.shields.io/badge/Smithery-planned-yellow.svg)](https://smithery.ai)
[![Glama](https://img.shields.io/badge/Glama-planned-yellow.svg)](https://glama.ai/mcp)
[![mcp.so](https://img.shields.io/badge/mcp.so-Listed-2563EB.svg)](https://mcp.so/server/jpcite/bookyou)
[![mcphub.dev](https://img.shields.io/badge/mcphub-planned-yellow.svg)](https://mcphub.dev)
[![awesome-mcp](https://img.shields.io/badge/awesome--mcp-pending-yellow.svg)](https://github.com/punkpeye/awesome-mcp-servers/pull/6192)

[![mypy strict](https://img.shields.io/badge/mypy%20strict-0%20errors-4c1.svg)](./CHANGELOG.md)
[![pytest](https://img.shields.io/badge/pytest-8215%2B%20PASS-4c1.svg)](./tests/)
[![production gate](https://img.shields.io/badge/production%20gate-4%2F7%20PASSING-yellow.svg)](./docs/_internal/CL6_PRODUCTION_GATE_4_FAIL_AUDIT_2026_05_17.md)
[![API status](https://img.shields.io/badge/api-LIVE%20Fly%20Tokyo-4c1.svg)](https://jpcite.com/status)

## AI agent commerce — 5-stage funnel

```
[1] AI search     →  [2] Hit jpcite packet  →  [3] Recommend  →  [4] 1-tap Pay  →  [5] Unlock
    (GPT/Claude/      (paywalled URL with        (agent shows      (¥30 Apple Pay     (full evidence
     Gemini SERP)      JSON-LD + freshness       URL + reason       or x402 USDC,      packet, <24h
                       source_url + fetched_at)   to end user)       2-sec settle)      freshness, cited
                                                                                       source_url)
```

**Why this works**: GPT-4o / Claude Opus / Gemini Pro index public packet URLs at training and re-fetch at inference. Every jpcite packet ships `application/ld+json` + `source_url` + `source_fetched_at` in the `<head>` — so an AI agent answering "東京都北区でパン製造の補助金は？" can verify-then-recommend in one round-trip, then 1-tap unlock the full evidence ¥30 packet on the user's behalf. (Cryptographic attestation is on the Q3 2026 roadmap — see [docs/security/signing-spec](./docs/security/signing-spec).) Customer = the CLI AI agent (Opus 4.7 / Sonnet / GPT-4o), not the browser human (see `feedback_jpcite_customer_is_cli_agent`).

## 5 sample packets (AI-search SERP test corpus)

Drop these URLs into ChatGPT / Claude / Gemini and ask "is this evidence reliable?" — the agent will read the JSON-LD preamble + check `source_url` + `source_fetched_at` + cite back:

| # | Topic | Packet URL |
|---|---|---|
| 1 | 北区パン製造補助金 (SME) | <https://jpcite.com/packets/sme-kita-ku-pan-seizou-hojokin-2026-05-18.html> |
| 2 | 軽減税率対象品目 (税理士) | <https://jpcite.com/packets/zeirishi-keigen-zeiritsu-2026-2026-05-18.html> |
| 3 | 法務局 routing (司法書士) | <https://jpcite.com/packets/shihou-shihou-shoshi-vs-houmu-kyoku-routing-2026-05-18.html> |
| 4 | 商標出願戦略 (弁理士) | <https://jpcite.com/packets/benri-senkou-shouhyou-search-routine-2026-05-18.html> |
| 5 | 法人税試算 (税理士) | <https://jpcite.com/packets/zeirishi-bouei-tokubetsu-houjinzei-2026-2026-05-18.html> |

Full catalog: <https://jpcite.com/packets/> (500+ packets, freshness <24h, source-linked, agent.json indexed).

## Quickstart — Cursor / Claude Code (30 seconds)

Drop into `~/.cursor/mcp.json` **or** `~/.claude/mcp.json`:

```json
{ "mcpServers": { "jpcite": { "command": "uvx", "args": ["autonomath-mcp"] } } }
```

Restart your client. Ask: 「東京都北区でパン製造の補助金を教えて」 — your agent will hit jpcite, pay ¥3-¥30 per call from your credit wallet, and cite back with `source_url` + freshness.

REST one-liner (no MCP client needed):

```bash
curl -G "https://api.jpcite.com/v1/programs/search" --data-urlencode "q=パン製造" --data-urlencode "prefecture=東京都" -H "X-API-Key: jc_xxx"
```

## Opus alone vs Opus + jpcite

| Dimension | Opus 4.7 alone (7-turn chain) | Opus 4.7 + jpcite (1-turn evidence) |
|---|---|---|
| Cost / query | **¥347-¥500** | **¥3-¥30** (jpcite tier A-D) |
| Freshness | Training cutoff (months stale) | **<24h** (`source_fetched_at` stamped) |
| Citation | Hallucinated / outdated URLs | **Verified `source_url`** + `source_fetched_at` (cryptographic attestation: Q3 2026 roadmap) |
| Japan regulatory recall | ~60% on JCRB-v1 (scaffold) | **~95% (design target)** — empirical benchmark in progress, 5/250 fixtures populated (see [P5 benchmark](./docs/_internal/P5_BENCHMARK_RESULTS_2026_05_17.md)) |
| 8業法 fence | Manual disclaimer | Auto-injected `_disclaimer` envelope |
| Settlement | API key + monthly invoice | **1-tap Apple Pay / x402 USDC** |

Per-call savings: **17x (Tier D) ... 167x (Tier A)**. Full math: [`docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md`](./docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md).

## Trust footer

- **Operator**: Bookyou 株式会社 (T8010001213708) — 国税庁適格事業者番号
- **Attestation roadmap**: Cryptographic cite-chain attestation (Ed25519 signature header + public key + verify endpoint) is on the **Q3 2026 roadmap** — see [`docs/security/signing-spec`](./docs/security/signing-spec). Current responses carry `source_url` + `source_fetched_at` + `content_hash` for traceability; signatures are not yet emitted.
- **Freshness**: `source_fetched_at` <24h on all hot tables; per-source distribution at `/v1/stats/freshness`
- **Compliance**: 8業法 disclaimer envelope (税理士法 §52 / 弁護士法 §72 / 公認会計士法 §47の2 / 行政書士法 §1の2 / 司法書士法 §3 / 社会保険労務士法 §27 / 弁理士法 §75 / 労働基準法 §36)

---

## TL;DR for AI agents

**Thesis (canonical positioning, 2026-05-18)**: **Sonnet 4.6 / Haiku / GPT-4o-mini / Gemini Flash + jpcite agent = Opus 4.7-equivalent Japan regulatory deliverables at 80% cost reduction.** Down-model agents read jpcite Evidence Packets (pre-structured by 504K canonical entities × 6.2M source-backed facts + 181 exclusion/prerequisite rules + 8 業法 fence) instead of running a 7-turn Opus 4.7 chain themselves. The packet contains the structured ground truth Opus would re-derive turn-by-turn, so a down-model can match Opus output quality for Japan regulatory tasks (税理士月次 / 監査調書 / 適格性チェック / 登記 watch / 補助金 lineage / DD / M&A) at ¥10-¥40 per call instead of ¥347-¥500.

**What it is**: 261-tool MCP / REST surface — the Japanese-regulation packet bank AI agents find and buy — over Japanese public-program data (補助金 / 法令 / 判例 / 税制 / 適格事業者 / 法人 360° / 行政処分 / 入札 / 融資) with `source_url`, `content_hash`, `source_fetched_at` on every record.

**How to use**: `uvx autonomath-mcp` for stdio MCP, or `X-API-Key` against `https://api.jpcite.com/v1/*` for REST. No OpenAI / Anthropic / Gemini key needed — jpcite calls **no LLM in production**; reasoning stays in the caller's agent. Bring your own *small/cheap* model — jpcite Evidence handles the regulatory accuracy floor.

**Cost**: **¥3 / billable unit** (tax-excluded; ¥3.30 inc. tax). Tier A=¥3 / B=¥6 / C=¥12 / D=¥30 — every tier is **1/17x to 1/167x** of a Claude Opus 4.7 7-turn evidence chain (~¥500). Anonymous 3 req/day free per IP, JST reset. Empirical equivalence benchmark in progress (scaffold, 5/250 fixtures populated): see [`docs/_internal/P5_BENCHMARK_RESULTS_2026_05_17.md`](./docs/_internal/P5_BENCHMARK_RESULTS_2026_05_17.md) (JCRB-v1 50-query Opus vs Sonnet+jpcite).

## Tier pricing — Opus 4.7 anchor comparison

Single billable-unit is ¥3; "tier" is the **narrative bundle depth** label tied to the agent-economy band. Full derivation: [`docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md`](./docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md) §3 (FF1 SOT, validator-gated).

| Tier | jpcite ¥/req | Opus equiv turns | Opus equiv ¥ | Saving % | Saving ¥ | Default tool families |
|:---:|---:|:---:|---:|:---:|---:|---|
| **A** | **¥3**  | 3 (light)  | ¥54  | **94.4%** | ¥51  | `search_*`, `list_*`, `get_simple_*`, `enum_*` |
| **B** | **¥6**  | 5 (medium) | ¥170 | **96.5%** | ¥164 | `search_v2_*`, `expand_*`, `get_with_relations_*` |
| **C** | **¥12** | 7 (deep)   | ¥347 | **96.5%** | ¥335 | `HE-1`, `HE-3`, `precomputed_answer`, `agent_briefing`, `cohort_*` |
| **D** | **¥30** | 7 (deep+)  | ¥500 | **94.0%** | ¥470 | `HE-1 full`, `evidence_packet_full`, `portfolio_analysis`, `regulatory_impact_chain` |

Saving ratio envelope: **min 17x (Tier D)** ... **max 167x (Tier A)** vs Opus 4.7 7-turn Deep++ tool-calling chain @ ¥150/USD FX. Per-case API-fee-delta form only — no aggregate profit/return projection (see [`docs/canonical/cost_saving_examples.md`](./docs/canonical/cost_saving_examples.md)).

## How it works (ingredient + finishing)

jpcite is the **ingredient supplier**, not the chef. The AI agent in your CLI / IDE / Custom GPT does the finishing — composing the final, user-shaped answer from the structured packet jpcite ships. End-user never sees raw packets.

**6-step flow** (end-user → answer):

```
[1] end-user asks       →  [2] AI agent receives    →  [3] agent discovers jpcite
    "東京都北区で                 query in caller             via SERP / agent.json /
    パン製造の補助金は？"          context (chat / IDE /        Smithery / .well-known
                                  ticket / mail thread)        and selects 1 tool

[4] agent fetches       →  [5] agent finishes       →  [6] end-user reads
    ingredient packet           in user context             tailored answer
    (¥3-¥30, <500ms,            (~500 token, ~¥10           with cited 補助金 list
    source_url + fetched_at,     LLM cost) — tone /          + amount + deadline
    JSON-LD + known_gaps)        format / language /         + source links
                                 user-history weave
```

**Cost breakdown (single end-user query)**:

| Component | Who pays | Cost | What it buys |
|---|---|---:|---|
| **ingredient** (jpcite packet) | agent → jpcite | ¥3-¥30 | structured, source-linked, <24h-fresh regulatory facts |
| **finishing** (LLM finishing turn) | agent → LLM provider | ~¥10 | user-context shaping, language, tone, ~500 token gen |
| **Total** | end-user (via agent margin) | **¥30-¥45** | one delivered answer with citations |
| LLM-only baseline (no jpcite) | agent → LLM provider | ~¥120 | 7-turn Opus 4.7 chain, no citations, training-cutoff stale |

Net delta: **¥75-¥90 saved per query (~67%)** plus citations (`source_url` + `source_fetched_at` + `known_gaps`) the LLM-only path can't produce. (Cryptographic attestation is on the Q3 2026 roadmap — see [`docs/security/signing-spec`](./docs/security/signing-spec).)

**5 cohort scenarios** (full table at [`docs/canonical/cost_saving_examples.md`](./docs/canonical/cost_saving_examples.md)):

- **税理士 月次** — Tier B ingredient ¥6 + finishing ¥10 = ¥16/query vs LLM-only ¥120 (87% saving, audit-trail citations).
- **会計士 監査調書** — Tier C ¥12 + finishing ¥10 = ¥22/query vs ¥347 (94% saving, 出典 lineage).
- **行政書士 適格性** — Tier B ¥6 + finishing ¥10 = ¥16/query vs ¥170 (91% saving, 8業法 fence auto-injected).
- **司法書士 登記 watch** — Tier A ¥3 + finishing ¥5 = ¥8/query vs ¥54 (85% saving, 30 watch/月 batch).
- **SME / 補助金** — Tier C+D ¥30 + finishing ¥15 = ¥45/query vs ¥500 (91% saving, lineage + acceptance probability).

The agent is the chef. jpcite ships the ingredients. End-user gets a plate.

## MCP server quickstart (Claude Desktop, 30 seconds)

```json
{
  "mcpServers": {
    "jpcite": {
      "command": "uvx",
      "args": ["autonomath-mcp"],
      "env": {
        "JPCITE_API_KEY": "jc_xxx",
        "JPCITE_API_BASE": "https://api.jpcite.com"
      }
    }
  }
}
```

Drop into `~/Library/Application Support/Claude/claude_desktop_config.json`, restart Claude Desktop, then ask: 「東京都で設備投資に使える補助金を教えて」. The `JPCITE_API_KEY` is for jpcite metered billing — **not** an LLM provider key. `uvx`-installed wheels ship without DB and auto-fall back to `api.jpcite.com` over HTTP for the top 10 tools (`search_programs`, `get_program`, `search_case_studies`, `search_loan_programs`, `search_enforcement_cases`, `search_tax_incentives`, `search_certifications`, `list_open_programs`, `dd_profile_am`, `rule_engine_check`). Other tools return `error: "remote_only_via_REST_API"` with the REST URL. Clone the repo for the full local-DB surface.

## REST quickstart (30 seconds)

```bash
# Always --data-urlencode JA params — raw 補助金/設備投資 breaks curl's HTTP request line.
curl -G "https://api.jpcite.com/v1/programs/search" \
  --data-urlencode "q=設備投資" \
  --data-urlencode "prefecture=東京都" \
  -H "X-API-Key: jc_xxx"
```

Get a key: <https://jpcite.com/pricing.html#api-paid>. Dashboard / usage / billing: <https://jpcite.com/dashboard>.

### Output sample

`GET /v1/programs/search?q=設備投資&prefecture=東京都` (truncated to 1 result):

```json
{
  "total": 47,
  "results": [
    {
      "unified_id": "UNI-example-energy-dx",
      "primary_name": "東京都 中小企業 省エネ設備導入支援",
      "amount_max_man_yen": 500,
      "application_window": {"end_date": "2026-06-30"},
      "source_url": "https://www.metro.tokyo.lg.jp/.../energy-dx.html",
      "source_fetched_at": "2026-04-30T00:00:00+09:00",
      "tier": "A"
    }
  ]
}
```

## Cohort coverage — 5 cohorts × per-call saving

Mix-weighted annual API-fee-delta examples (per-cohort 100 query / year / user, mirrors `site/pricing.html`):

| Cohort | Tier mix | jpcite ¥/yr | Opus ¥/yr | Saving ¥/yr | Ratio |
|---|---|---:|---:|---:|---:|
| 税理士 (tax-firm) | 70 B + 30 C | ¥780 | ¥22,310 | ¥21,530 | 28.6x |
| 会計士 (CPA / audit) | 40 B + 60 C | ¥960 | ¥27,620 | ¥26,660 | 28.8x |
| 行政書士 | 60 B + 40 C | ¥840 | ¥23,990 | ¥23,150 | 28.6x |
| 司法書士 (登記 watch) | 60 A + 40 B | ¥420 | ¥10,040 | ¥9,620 | 23.9x |
| SME / 補助金 | 30 B + 50 C + 20 D | ¥1,380 | ¥36,910 | ¥35,530 | 26.7x |

Per-product cohort packs (from FF1 SOT §4): A1 税理士 月次 12 packets/yr @ ¥6 → ¥72 vs ¥6,000 (**83.3x**). A2 会計士 監査 10 件 @ ¥12 → ¥120 vs ¥3,000 (**25.0x**). A3 行政書士 適格 1 件 @ ¥6 → ¥6 vs ¥170 (**28.3x**). A4 司法書士 登記 30 watch/月 @ ¥3 → ¥90 vs ¥1,620 (**18.0x**). A5 SME 補助金 5 候補 @ ¥12 → ¥60 vs ¥1,735 (**28.9x**).

Public copy uses "API fee delta" language only — see [`docs/canonical/cost_saving_examples.md`](./docs/canonical/cost_saving_examples.md). No return-multiple / labor-reduction / business-outcome claims (per `feedback_cost_saving_not_roi` guard).

## Data moat — live corpus snapshot

Source-linked records carry `source_url` + `content_hash` + `source_fetched_at` lineage; known gaps surfaced explicitly. Aggregator pages are excluded from citation sources where detected.

| Surface | Live count | Note |
|---|---:|---|
| Canonical entities (`am_entities`) | **504,238** | 法人 / 制度 / 法令 / 判例 / 採択 / 行政処分 unified ID space |
| Entity facts (`am_entity_facts`) | **6,228,893** | source_id-backed atomic facts (A6 done, source_id 0→81,787 backfilled) |
| Precomputed answers (`am_precomputed_answer`) | **5,473** | cohort × question Tier C/D bundles |
| Searchable programs | **11,601** | 47 prefectures + national; tier S=114 / A=1,340 / B=4,186 / C=5,961 |
| Full program catalog | **14,472** | + 2,871 publication-review rows |
| Laws full-text indexed | **6,493** | e-Gov CC-BY (out of 9,484 metadata stubs) |
| Tax rulesets | **50** | structured 措置法 + 通達 cross-ref |
| Invoice registrants | **13,801** | 国税庁 適格事業者 PDL v1.0 delta |
| 採択事例 | **2,286** | + 108 融資 (担保/個人保証人/第三者保証人 三軸) |
| 行政処分 | **1,185** | + 22,258 enforcement-detail rows |
| Court decisions | **2,065** | + 362 bids |
| Exclusion / prerequisite rules | **181** | 125 exclude + 17 prerequisite + 15 absolute + 24 other |

agents.json corpus snapshot (2026-05-07) shows 503,930 entities / 6.12M facts at snapshot time; live values trump snapshot during drift windows.

## Verify links (agent-readable SOT)

| Surface | URL | Purpose |
|---|---|---|
| `.well-known/agents.json` | <https://jpcite.com/.well-known/agents.json> | machine-readable AI-capability spec (tools / pricing / corpus snapshot) |
| OpenAPI agent-safe | <https://api.jpcite.com/v1/openapi.agent.json> | ChatGPT Custom GPT Actions importer |
| OpenAPI full | <https://api.jpcite.com/v1/openapi.json> | SDK generators / Postman |
| Cost-saving SOT (FF1) | [`docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md`](./docs/_internal/JPCITE_COST_ROI_SOT_2026_05_17.md) | tier quintuple `(yen, opus_turns, opus_yen, saving_pct, saving_yen)` — validator-gated |
| Cost-saving public copy | [`docs/canonical/cost_saving_examples.md`](./docs/canonical/cost_saving_examples.md) | API-fee-delta narrative, 14 audience entries + 6 use-case calculator |
| MCP tool catalog | [`docs/mcp-tools.md`](./docs/mcp-tools.md) | full 261-tool list + arguments |
| Distribution manifest | [`scripts/distribution_manifest.yml`](./scripts/distribution_manifest.yml) | canonical published counts (tool/route/openapi) |
| llms.txt (JA / EN) | <https://jpcite.com/llms.txt> / <https://jpcite.com/llms.en.txt> | AI-agent discovery surface |
| Benchmark (FF3 / P5) | [`docs/_internal/P5_BENCHMARK_RESULTS_2026_05_17.md`](./docs/_internal/P5_BENCHMARK_RESULTS_2026_05_17.md) | quality / latency benchmark walk |
| Evaluation suite | [`evals/gold.yaml`](./evals/gold.yaml) | 79-query gold-standard (run `.venv/bin/python evals/run.py`) |
| Stats — coverage / freshness | `/v1/stats/coverage`, `/v1/stats/freshness`, `/v1/stats/usage` | live transparency endpoints |

## How jpcite compares to single-source MCP servers

jpcite is the **横断 + Evidence Packet** layer. The 3 active single-source Japanese MCP servers each handle one slice — they are **complementary**, not competitive:

- **vs jgrants-mcp** ([`digital-go-jp/jgrants-mcp-server`](https://github.com/digital-go-jp/jgrants-mcp-server), 5 tools, jGrants 補助金 only): jpcite adds 法令 / 判例 / 行政処分 / 適格事業者 / 法人 360° / 排他併用判定. Use jgrants-mcp for the grant application path; use jpcite for cross-source compliance check. → [/compare/jgrants-mcp/](https://jpcite.com/compare/jgrants-mcp/)
- **vs tax-law-mcp** ([`kentaroajisaka/tax-law-mcp`](https://github.com/kentaroajisaka/tax-law-mcp), 7 tools, e-Gov + NTA + KFS live scrape): jpcite adds 50 structured tax_rulesets + 9,484 e-Gov laws + 28,201 article rows pre-indexed (median <100ms, no live-scrape latency) + 通達 cross-ref to 制度 / 採択 / 行政処分. Use jpcite for pre-indexed answers + 通達 cross-ref; use tax-law-mcp for ad-hoc lookups. → [/compare/tax-law-mcp/](https://jpcite.com/compare/tax-law-mcp/)
- **vs japan-corporate-mcp** ([`yamariki-hub/japan-corporate-mcp`](https://github.com/yamariki-hub/japan-corporate-mcp), 8 tools, gBizINFO + EDINET + e-Stat live API, 3 user keys required): jpcite ships pre-indexed 166,969 法人 + 13,801 適格事業者 + 1,185 行政処分 + 22,258 enforcement detail with anonymous trial (no user API key required). Use jpcite for analyst pre-screening; use japan-corporate-mcp for live regulator pulls when keys are already provisioned. → [/compare/japan-corporate-mcp/](https://jpcite.com/compare/japan-corporate-mcp/)

## Architecture overview (4-layer)

1. **Ingest / corpus** — primary-source crawl (経産省, MAFF, JFC, 総務省, NTA, e-Gov, 47 都道府県公報) → `am_source` with `content_hash` + `last_verified`. Aggregator domains excluded.
2. **Entity / fact graph** — 504,238 canonical entities × 6,228,893 source-backed facts in `autonomath.db` (~16 GB SQLite, FTS5 trigram + FAISS IVF+PQ embeddings, `nprobe=8` floor per PERF-23). No cross-DB ATTACH.
3. **Composition / outcome** — Wave 21-94 composition tools (eligibility chain, complementary programs, simulate_application, due-diligence questions, kessan briefing, jurisdiction cross-check, application kit, industry packs construction/manufacturing/real_estate, plus Wave 60-94 agent_briefing_pack + agent_cohort_deep/ultra primitives).
4. **Wire layer** — FastMCP (stdio, MCP `2025-06-18`) + FastAPI REST (`/v1/*`). 364 stable-gate routes, 307 OpenAPI paths, 261 default-gate MCP tools. Stripe metered billing on Fly.io Tokyo + Cloudflare Pages + Cloudflare WAF. Token-bucket rate-limit middleware on every request. `decision_insights` / `next_questions` / `eligibility_gaps` / `document_readiness` / `decision_support` envelopes for agent-side scaffolding.

Full refresh: root `AGENTS.md` (vendor-neutral SOT) + `DIRECTORY.md` (directory map) + `CLAUDE.md` (Claude-specific shim).

## MCP tools — 261 at default gates

| Group | Coverage |
|-------|----------|
| **Core** | Programs, Case Studies, Loans, Enforcement, Exclusions, Laws, Court Decisions, Bids, Tax Rulesets, Quota probe (`get_usage_status`) |
| **Audit / composition** | `audit_batch_evaluate`, `compose_audit_workpaper`, `resolve_citation_chain` |
| **jpcite generic** | Entity/Fact DB, funding stack, evidence/source manifests, lifecycle/graph/rule-engine, tax/certification/loan/enforcement wrappers |
| **V4 universal** | `get_annotations`, `validate`, `get_provenance`, `get_provenance_for_fact` |
| **Static resources** | `list_static_resources_am`, `get_static_resource_am`, `list_example_profiles_am`, `get_example_profile_am`, `deep_health_am` |
| **NTA corpus** | `cite_tsutatsu`, `find_bunsho_kaitou`, `find_saiketsu`, `find_shitsugi` |
| **Eligibility composition** | `apply_eligibility_chain_am`, `find_complementary_programs_am`, `program_active_periods_am`, `simulate_application_am`, `track_amendment_lineage_am` |
| **Application composition** | `bundle_application_kit`, `cross_check_jurisdiction`, `forecast_program_renewal`, `match_due_diligence_questions`, `prepare_kessan_briefing` |
| **Industry packs** | `pack_construction`, `pack_manufacturing`, `pack_real_estate` |
| **Corporate layer** | `get_houjin_360_am`, `list_edinet_disclosures`, `search_invoice_by_houjin_partial` |
| **Wave 60-94 outcome / cohort** | `agent_briefing_pack`, `agent_cohort_deep`, `agent_cohort_ultra`, M&A / talent / brand / safety / real_estate / insurance outcome primitives |

Default-gate tool count is canonical at **261** (`scripts/distribution_manifest.yml` `tool_count_default_gates`). Full list with arguments: [`docs/mcp-tools.md`](./docs/mcp-tools.md). Runtime probe: `python scripts/probe_runtime_distribution.py`.

## Constraints / non-goals (what jpcite isn't)

- **Not legal / tax / 行政書士 / 司法書士 advice** (弁護士法 § 72 / 税理士法 § 52 / 行政書士法 § 1の2 / 司法書士法 § 3). Responses ship `_disclaimer` envelopes on every 8-fence-sensitive surface (税理士法 §52・弁護士法 §72・公認会計士法 §47の2・行政書士法 §1の2・司法書士法 §3・社会保険労務士法 §27・弁理士法 §75・労働基準法 §36).
- **No LLM inside the service** — no external LLM API calls in the data / evidence path. Content endpoints are generated from the corpus and deterministic application code; reasoning lives in the caller's agent. `tests/test_no_llm_in_production.py` enforces this gate.
- **Not real-time amendment tracking** — snapshot data with partial historical diffs. Verify primary sources before any business decision.
- **No aggregator scraping** — second-tier aggregator pages excluded from citation sources where detected.
- **No subscription tiers / seat fees / annual minimums** — anonymous trial calls do not require signup and remain capped at 3 requests/day per IP. Zero-touch ops, solo operator.
- **Optional disabled domains** — Labor-agreement (36協定) gated behind `AUTONOMATH_36_KYOTEI_ENABLED` (default off pending 社労士 supervision review). Healthcare and real-estate datasets disabled by default until primary-source coverage + disclaimers are ready. Experimental reasoning tools disabled by default.

Capability boundaries: [`docs/honest_capabilities.md`](./docs/honest_capabilities.md).

## REST API & SDKs

> WARNING: The MCP package is published on PyPI; REST SDKs remain pre-release.

**Python MCP package** (`autonomath-mcp`) — package name kept for client compatibility:

```bash
pip install autonomath-mcp
# or
uvx autonomath-mcp
```

**TypeScript / JavaScript SDK** (`@autonomath/sdk`) — package name kept for compatibility. Public package release pending; the REST API v1 surface is the stable contract while the SDK remains pre-release. The package ships dual ESM + CJS output with `.d.ts` and exposes both REST (`@autonomath/sdk`) and MCP (`@autonomath/sdk/mcp`) entry points. Zero runtime dependencies (uses platform `fetch`).

**Runnable examples**

- Python: [`examples/python/`](./examples/python/) — search by prefecture, check exclusions, program detail, pandas CSV export
- TypeScript: [`examples/typescript/`](./examples/typescript/) — search, exclusions, MCP CLI, Next.js page

## Self-serve dashboards & transparency

- **Dashboard** (authenticated): `GET /v1/me/dashboard` — month-to-date spend, request count, cap state, top tools. See [`docs/dashboard_guide.md`](./docs/dashboard_guide.md).
- **Amendment alerts**: `POST /v1/me/alerts/subscribe` — subscribe by tool / law_id / program_id / industry_jsic / all, with severity gating (critical / important / info). See [`docs/alerts_guide.md`](./docs/alerts_guide.md).
- **Stats** (public transparency): `GET /v1/stats/coverage` (per-prefecture / authority / kind program counts), `GET /v1/stats/freshness` (per-source `source_fetched_at` distribution), `GET /v1/stats/usage` (anonymised request volume).

## Pricing — packet bank product lines

The packet bank ships 7 product lines, all metered (no seat fees, no annual minimums):

- **raw record** — **¥3 per billable unit** (税込 ¥3.30); normal search/detail calls are 1 unit, batch/export endpoints bill by documented fan-out units
- **Evidence Packet** — **¥30** structured, source-linked, <24h-fresh bundle (ingredient the agent finishes)
- **deep / cohort bundles** — up to **¥240** for the heaviest packet lines (portfolio / regulatory-impact / cohort-ultra)
- **weekly passport** — flat-rate weekly access for high-frequency agents (JST week boundary)
- **First 3 requests/day free** (anonymous, IP-based, JST daily reset)
- **No subscription tiers, no seat fees, no annual minimums**
- **Cost preview**: `/v1/cost/preview` for jpcite billable-unit estimates. Use Evidence Packet `include_compression=true` to compare caller-supplied input-context estimates with the caller baseline. Provider output/reasoning/search/cache costs remain outside jpcite.

## SLA & infrastructure

- **Monthly uptime target: 99.0%** on `api.jpcite.com` (Fly.io Tokyo + Cloudflare Pages + Cloudflare WAF). See [`docs/sla.md`](./docs/sla.md).
- **Tokushoho disclosure** — full statutory disclosure under 特定商取引法 at [`site/tokushoho.html`](./site/tokushoho.html).
- **Spec surfaces** — `site/llms.txt` and `site/llms-full.txt` (JA); `site/llms.en.txt` and `site/llms-full.en.txt` (EN) for AI-agent discovery.

## Evaluation

Tool quality is publicly verifiable: see [`evals/`](./evals/) for a 79-query gold-standard suite (`gold.yaml` + `run.py`) covering 農業 / 製造 / IT / 創業 / 都道府県 / 税制 / 融資 / 採択事例 / prescreen / 行政処分 / cross-dataset / edge cases / 7 one-shot discovery tools (smb_starter_pack / deadline_calendar / subsidy_combo_finder / similar_cases / subsidy_roadmap_3yr / regulatory_prep_pack). Every `expected_ids` list was generated against the local evaluation snapshot; CI runs the suite on every PR. Per-tool precision table: [`docs/per_tool_precision.md`](./docs/per_tool_precision.md). Run locally with `.venv/bin/python evals/run.py`.

## Known limitations

jpcite is a public-record evidence layer, not a legal, tax, audit, credit, or filing decision service. Corpus coverage, source freshness, and field-level provenance vary by source family. Responses include `source_url`, `source_fetched_at`, `known_gaps`, and disclaimers where applicable so callers can verify primary sources before business decisions.

## Support

- Docs: <https://jpcite.com/docs/> (search: built-in lunr; Algolia DocSearch pending OSS-program approval)
- Email: <info@bookyou.net>

## License

MIT © 2026 jpcite

---

## Launch state — 2026-05-16/17 (Wave 50 RC1 LANDED + Wave 51 + Wave 60-94)

**Wave 50 RC1 = LANDED (2026-05-16).** Contract layer + production deploy preflight gate substrate fully landed across 20 commits (Stream G 6 PR + cleanup PR7 + Wave 49 G2 + 73-tick revert + Wave 51 dim K-S foundational). Wave 51 tick 0 (9/9 dim K-S + L1 source-family + L2 math sweep, 11 modules, 416 tests PASS) closed in the same session. Wave 60-94 added M&A / talent / brand / safety / real_estate / insurance outcome primitives (432 cumulative outcomes). Canonical closeouts: [`docs/_internal/WAVE50_RC1_FINAL_CLOSEOUT_2026_05_16.md`](./docs/_internal/WAVE50_RC1_FINAL_CLOSEOUT_2026_05_16.md), [`docs/_internal/WAVE51_DIM_K_S_CLOSEOUT_2026_05_16.md`](./docs/_internal/WAVE51_DIM_K_S_CLOSEOUT_2026_05_16.md), [`docs/_internal/AWS_CANARY_INFRA_LIVE_2026_05_16.md`](./docs/_internal/AWS_CANARY_INFRA_LIVE_2026_05_16.md).

- **mypy strict**: 0 errors (tick 6 71→0 achieved; new strict errors are red gate)
- **pytest**: 8215+ PASS, 0 fail (collected 8628, +200+ tests landed)
- **coverage**: 76%+ (tick 9)
- **production deploy readiness gate**: 4/7 PASSING (CL6 audit — earlier 7/7 regressed during PERF cascade; remediation in flight)
- **preflight**: 5/5 READY (Stream A 5 preflight artifacts all READY)
- **preflight_scorecard.state**: `AWS_CANARY_READY` (operator token gate `--unlock-live-aws-commands` required to flip live_aws=true; scorecard runner authority only)
- **RC1 contract layer**: 19 Pydantic models + 20 JSON Schema, `scripts/check_schema_contract_parity.py` bidirectional round-trip 0 drift
- **Release Capsule**: 21 artifacts in manifest + 14 outcome contracts (¥300-¥900 band 実値 filled) + 3 inline packets
- **AWS canary infra**: Phase 1-8 DONE + Phase 9 dryrun verified ($18,425 verified credit remaining post-CL16 audit; wet-run gated on operator UNLOCK)

See [`CHANGELOG.md`](./CHANGELOG.md) for the full release walk.

---

Keywords: mcp, mcp-server, mcp-tools, claude, rag, agent-tools, japan, japanese, legal-tech, subsidies, grants, loans, tax, tax-incentives, corporate-registry, enforcement, evidence, citation, government, compliance, jpcite, autonomath-mcp, 補助金, 助成金, 融資, 税制優遇, 認定制度, 採択事例, 行政処分, 国税庁, e-Gov, mcp-2025-06-18

## Badges

[![PyPI version](https://img.shields.io/pypi/v/autonomath-mcp)](https://pypi.org/project/autonomath-mcp/)
[![PyPI downloads](https://img.shields.io/pypi/dm/autonomath-mcp)](https://pypi.org/project/autonomath-mcp/)
[![License](https://img.shields.io/github/license/shigetosidumeda-cyber/autonomath-mcp)](./LICENSE)
[![MCP 2025-06-18](https://img.shields.io/badge/MCP-2025--06--18-6E56CF)](https://modelcontextprotocol.io/specification/2025-06-18)
[![API status](https://img.shields.io/badge/api-status-4c1)](https://jpcite.com/status)

Offline / mirrored copies of the same badges live in [`badges/`](./badges/) for use in environments where shields.io is unreachable.

last_updated: 2026-05-17
