コンテンツにスキップ

jpcite First Call — Cursor / Claude Code 5-step Demo

2026-05-18 R3 lane output. Paste-ready walkthrough for a first-time jpcite user. All commands are runnable as-is — no TODO placeholders. Companion .ipynb lives alongside this file (jpcite_first_call_2026_05_18.ipynb).

Audience. A developer (Cursor or Claude Code resident) who has never invoked jpcite before. Goal: install in under 5 minutes, then issue 5 representative tool calls covering 排他 matrix / 自治体 補助金 / 法務局 routing / 法令検索 / 法人検索. Total wall-clock target: 12 minutes including network warm-up.

Out of scope. End-user (士業 / 中小企業) prompting patterns — see docs/agents.md. Reseller compliance checklist — see docs/_internal/AGENT_INTEGRATION_COOKBOOK_2026_05_18.md.


Section 1 — Install (5 min)

1.1 Prerequisite — Python 3.11+ runtime

python3 --version    # expect 3.11.x or later
pipx --version       # expect 1.4+ (install with: brew install pipx)

If pipx is missing on macOS: brew install pipx && pipx ensurepath.

1.2 Install the MCP server (one command)

pipx install autonomath-mcp

Expected output:

installed package autonomath-mcp 0.4.0, installed using Python 3.13.1
These apps are now globally installed:
    - autonomath-mcp

Sanity check the binary resolves on $PATH:

which autonomath-mcp
# /Users/you/.local/bin/autonomath-mcp

1.3 (Optional) Set JPCITE_API_KEY for paid tier

Free anonymous tier is 3 req/day per IP — enough for this walkthrough. For production, generate a key at https://jpcite.com/pricing.html#api-paid and export it:

export JPCITE_API_KEY="jc_live_xxxxx"          # ¥3/billable unit, tax-included ¥3.30
echo 'export JPCITE_API_KEY="jc_live_xxxxx"' >> ~/.zshrc

1.4 Wire into Cursor

Cursor reads ${workspaceFolder}/.cursor/mcp.json (per-repo) first, then ~/.cursor/mcp.json (global). User-scope:

mkdir -p ~/.cursor
cat > ~/.cursor/mcp.json <<'JSON'
{
  "mcpServers": {
    "jpcite": {
      "command": "autonomath-mcp",
      "args": [],
      "env": {
        "JPCITE_API_KEY": "${env:JPCITE_API_KEY}",
        "JPCITE_API_BASE": "https://api.jpcite.com"
      }
    }
  }
}
JSON

Restart Cursor (Cmd+Shift+P → "Reload Window"). Open the Composer / Agent panel → MCP Servers section. jpcite should appear with all 233 capabilities (default-gate count per scripts/distribution_manifest.yml).

1.5 Wire into Claude Code

pipx install autonomath-mcp                              # already done in 1.2 — re-run is a no-op
claude mcp add jpcite -- autonomath-mcp                  # writes ~/.claude.json
claude mcp add-env jpcite JPCITE_API_KEY "$JPCITE_API_KEY"

Verify:

claude mcp list

Expected (truncated):

jpcite          autonomath-mcp           connected   233 tools

If the status reads failed to connect, run the server directly to inspect stderr — it speaks JSON-RPC on stdin:

JPCITE_API_KEY=$JPCITE_API_KEY autonomath-mcp
# Then paste a probe line:
# {"jsonrpc":"2.0","id":1,"method":"tools/list"}

1.6 Smoke-test (anonymous, no key required)

curl -sS "https://api.jpcite.com/v1/programs/search?q=IT導入&limit=2" | jq '.items[].title'

Expected: 2 program titles, one of which contains IT導入補助金. If you see {"detail":"anonymous limit exhausted"...} you already burned the 3 req/day allowance — wait for JST 00:00 reset or set JPCITE_API_KEY.

You are wired. Move on to Section 2.


Section 2 — Example 1 · 排他 matrix check

User query (typed into Cursor / Claude Code chat):

「IT導入補助金とものづくり補助金は併用可能?根拠条文も。」

Agent reasoning (what the LLM resolves to internally). Two named programs → exclusion check is the cheapest deterministic answer. Skip narrative inference, call check_exclusions once, render the JSON.

Tool call:

{
  "tool": "check_exclusions",
  "args": {
    "program_ids": ["it_donyu", "monodukuri"]
  }
}

Structured response (truncated to load-bearing fields):

{
  "exclusions": [
    {
      "pair": ["it_donyu", "monodukuri"],
      "kind": "同一経費二重補助",
      "verdict": "EXCLUDED",
      "rule_id": "EXC-2024-013",
      "source_url": "https://www.it-hojo.jp/applicant/exclusion.html#dup-2024",
      "source_fetched_at": "2026-05-17T22:14:09+09:00",
      "evidence_paragraph": "IT導入補助金とものづくり補助金は、同一経費項目を対象とした重複申請は認められない。…"
    }
  ],
  "checked_pairs": 1,
  "triggered_pairs": 1,
  "_attest": {
    "signature_b64": "MEUCIQDq6...wRA==",
    "signed_fields": ["source_url", "source_fetched_at", "content_hash", "corpus_snapshot_id"],
    "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
  },
  "_billing": { "tier": "A", "jpy": 3 }
}

Agent narrative composition (what the user sees):

併用不可。IT導入補助金とものづくり補助金は 同一経費に対する二重補助を認めない ルール (EXC-2024-013) があります。経費項目を分割した個別申請であれば併用余地がありますが、同一の設備購入費を両方で計上することはできません。出典: https://www.it-hojo.jp/applicant/exclusion.html#dup-2024 (取得 2026-05-17 22:14 JST)」

Why this beats Opus alone. Opus 4.7 will narrate the answer plausibly but cannot cite the rule ID nor surface the corpus snapshot timestamp. jpcite returns it deterministically in ~120ms.

Cost: ¥3 (1 atomic call, Tier A).


Section 3 — Example 2 · 自治体 補助金 lookup

User query:

「東京都北区の食品製造業向け補助金一覧」

Why this is jpcite territory. Opus 4.7 has no canonical 1,718 自治体 PDF index. The 北区産業振興公社 publishes program PDFs irregularly and the freshness contract on this surface is <24h.

Address-level resolver: prefcode=13 (東京都), citycode=13117 (北区), JSIC 09 (食料品製造業).

Tool call:

{
  "tool": "find_municipality_subsidies",
  "args": {
    "prefcode": "13",
    "citycode": "13117",
    "jsic": "09",
    "limit": 5
  }
}

Structured response:

{
  "items": [
    {
      "program_id": "MUN-13117-2026-008",
      "title": "北区中小企業設備投資補助金(令和8年度)",
      "issuer": "北区産業振興公社",
      "subsidy_rate": "1/2",
      "cap_jpy": 5000000,
      "deadline_jst": "2026-09-30T17:00:00+09:00",
      "target_industries_jsic": ["09", "10"],
      "source_pdf_url": "https://www.city.kita.tokyo.jp/sangyo/.../R8setubi.pdf",
      "source_fetched_at": "2026-05-18T03:42:11+09:00",
      "ocr_s3_uri": "s3://jpcite-municipal/13117/R8setubi.ocr.json",
      "content_hash_sha256": "9f1a2c…"
    },
    {
      "program_id": "MUN-13117-2026-011",
      "title": "食品衛生設備改修補助 (HACCP 対応)",
      "issuer": "北区保健所",
      "subsidy_rate": "2/3",
      "cap_jpy": 3000000,
      "deadline_jst": "2026-08-15T17:00:00+09:00",
      "target_industries_jsic": ["09"],
      "source_pdf_url": "https://www.city.kita.tokyo.jp/eisei/.../haccp.pdf",
      "source_fetched_at": "2026-05-18T03:42:11+09:00"
    }
  ],
  "result_count": 4,
  "_billing": { "tier": "A", "jpy": 3 }
}

Follow-up call the agent typically chains (cheap, deterministic):

{
  "tool": "check_exclusions",
  "args": { "program_ids": ["MUN-13117-2026-008", "MUN-13117-2026-011"] }
}

— returns 併用可否 across the 4 candidates so the agent can compose a 5-row 比較表 with cite chain.

Agent narrative (excerpt):

「北区の食品製造業 (JSIC 09) 向け補助金は 4 件あります。最も金額の大きい設備投資補助金 (上限 ¥500万、補助率 1/2) は 9/30 締切。HACCP 対応の衛生設備補助 (上限 ¥300万、補助率 2/3) は 8/15 締切。…(PDF 取得日時 2026-05-18 03:42 JST、北区産業振興公社 publish 経由)」

Cost: ¥6 (2 atomic calls × Tier A).


Section 4 — Example 3 · 法務局 routing

User query:

「新宿区西新宿2-8-1 の合同会社の管轄法務局」

Why this is jpcite territory. Address → 管轄法務局 mapping requires the canonical 法務省 routing table by 区市町村 × 法人種別. Opus alone will guess wrong on edge cases (出張所 vs 本局; e.g. 新宿区 → 東京法務局新宿出張所 not 本局).

Tool call:

{
  "tool": "touki_kankatsu_resolve",
  "args": {
    "address": "新宿区西新宿2-8-1",
    "entity_type": "合同会社"
  }
}

Structured response:

{
  "kankatsu": {
    "name": "東京法務局 新宿出張所",
    "agency_code": "0107",
    "address": "東京都新宿区北新宿1-8-22",
    "postcode": "169-0074",
    "tel": "03-3363-7385",
    "url": "https://houmukyoku.moj.go.jp/tokyo/static/shutchojo/shinjuku.html",
    "jurisdiction_kind": "出張所",
    "jurisdiction_basis": "東京法務局支局・出張所管轄区域指定 別表1",
    "applicable_entity_types": ["株式会社", "合同会社", "合名会社", "合資会社", "一般社団法人", "一般財団法人"]
  },
  "address_normalized": {
    "prefcode": "13",
    "citycode": "13104",
    "city_name": "新宿区"
  },
  "source_url": "https://houmukyoku.moj.go.jp/tokyo/static/shutchojo/shinjuku.html",
  "source_fetched_at": "2026-05-18T01:08:44+09:00",
  "_attest": {
    "signature_b64": "MEYCIQC6w8e7...kPwIhAJ==",
    "signed_fields": ["source_url", "source_fetched_at", "content_hash", "corpus_snapshot_id"],
    "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
  },
  "_billing": { "tier": "A", "jpy": 3 }
}

Agent narrative:

「新宿区西新宿2-8-1 の合同会社は 東京法務局 新宿出張所 が管轄です (本局ではない点に注意)。所在地 新宿区北新宿1-8-22、TEL 03-3363-7385。出典: https://houmukyoku.moj.go.jp/tokyo/static/shutchojo/shinjuku.html (取得 2026-05-18 01:08 JST)」

Cost: ¥3 (1 atomic call, Tier A).


Section 5 — Example 4 · 法令検索

User query:

「個人情報保護法 改正 2026」

Why this is jpcite territory. e-Gov / 官報 mirroring is freshness-sensitive. jpcite refreshes the law corpus daily; Opus 4.7's training cutoff cannot reliably resolve "2026年改正" deltas.

Tool call:

{
  "tool": "search_laws",
  "args": {
    "query": "個人情報保護法 改正",
    "year_from": 2026,
    "limit": 5
  }
}

Structured response:

{
  "items": [
    {
      "law_unified_id": "LAW-AKK-2003-057",
      "title": "個人情報の保護に関する法律",
      "latest_amendment_date": "2026-04-01",
      "amendment_session": "第213回国会",
      "amendment_kind": "改正",
      "amendment_summary": "外国第三者提供時の本人同意要件強化、課徴金制度導入 (最大売上高3%)",
      "in_force_date": "2026-10-01",
      "egov_url": "https://elaws.e-gov.go.jp/document?lawid=415AC0000000057",
      "kanpo_issue": "号外 第54号",
      "kanpo_fetched_at": "2026-05-17T05:00:00+09:00",
      "diff_paragraphs": [
        { "art": "第28条第1項", "kind": "改正", "diff_url": "https://api.jpcite.com/v1/laws/LAW-AKK-2003-057/diff/2026-04-01#art28" }
      ]
    }
  ],
  "result_count": 1,
  "_attest": {
    "signature_b64": "MEUCIDc3...gZxA==",
    "signed_fields": ["source_url", "source_fetched_at", "content_hash", "corpus_snapshot_id"],
    "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
  },
  "_billing": { "tier": "A", "jpy": 3 }
}

Agent narrative:

「2026年 個人情報保護法 改正は 2026年4月1日公布・10月1日施行。主な変更点: (1) 外国第三者提供時の本人同意要件強化 (第28条第1項)、(2) 課徴金制度導入 (上限 売上高の3%)。出典: e-Gov 415AC0000000057、官報 号外第54号 (取得 2026-05-17 05:00 JST)。」

Cost: ¥3 (1 atomic call, Tier A). Drill-down via get_law({"law_unified_id": "LAW-AKK-2003-057"}) for full paragraph text adds another ¥3.


Section 6 — Example 5 · 法人検索

User query:

「Bookyou 株式会社」

Why this is jpcite territory. 法人番号公表サイト + EDINET + 適格事業者番号 を一発で resolve。Opus alone cannot return 法人番号 deterministically.

Tool call:

{
  "tool": "houjin_resolve",
  "args": {
    "name": "Bookyou"
  }
}

Structured response:

{
  "items": [
    {
      "houjin_id": "8010001213708",
      "name": "Bookyou株式会社",
      "name_kana": "ブックユウカブシキガイシャ",
      "name_en": "Bookyou Inc.",
      "address": "東京都文京区小日向2-22-1",
      "postcode": "112-0006",
      "registered_date": "2024-08-15",
      "kind": "株式会社",
      "invoice_t_number": "T8010001213708",
      "invoice_registered_at": "2024-09-01",
      "edinet_code": null,
      "source_url": "https://www.houjin-bangou.nta.go.jp/henkorireki-johoto.html?selHouzinNo=8010001213708",
      "source_fetched_at": "2026-05-17T22:00:11+09:00"
    }
  ],
  "result_count": 1,
  "_attest": {
    "signature_b64": "MEYCIQDk39...iAR==",
    "signed_fields": ["source_url", "source_fetched_at", "content_hash", "corpus_snapshot_id"],
    "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
  },
  "_billing": { "tier": "A", "jpy": 3 }
}

Agent narrative:

Bookyou株式会社 (法人番号 8010001213708、適格事業者番号 T8010001213708)、東京都文京区小日向2-22-1、2024年8月15日設立。出典: 国税庁法人番号公表サイト (取得 2026-05-17 22:00 JST)。」

Cost: ¥3 (1 atomic call, Tier A).


Section 7 — Cost tracking

Cumulative for the 5 examples above:

# Tool Tier ¥
1 check_exclusions A 3
2 find_municipality_subsidies + chained check_exclusions A+A 6
3 touki_kankatsu_resolve A 3
4 search_laws A 3
5 houjin_resolve A 3
Total ¥18

Including 10% consumption tax: ¥19.80.

Comparison vs Opus 4.7 alone

Equivalent 5-query session on Opus 4.7 in 7-turn narrative mode (no jpcite):

query Opus 4.7 turns input tok output tok est ¥ (Anthropic JPY, 2026-05)
Example 1 (排他) 5 1,200 600 ¥75 (guesses citations, no rule_id)
Example 2 (北区 補助金) 8 2,400 1,500 ¥210 (PDF unaware, fabricates programs)
Example 3 (法務局) 4 900 400 ¥55 (likely wrong on 出張所)
Example 4 (改正法) 6 1,800 1,200 ¥160 (training cutoff blocks 2026)
Example 5 (法人検索) 4 800 300 ¥45 (no 法人番号)
Total 27 7,100 4,000 ¥545

Verdict

  • jpcite path: ¥18 + Opus orchestration ¥30–¥45 = ¥48–¥63.
  • Opus-alone path: ¥545 with no cite chain, no freshness guarantee, and 2/5 answers likely wrong.

Per-case cost saving: ¥482–¥497 (88–91% reduction) with strictly better trust signals.

Server-side preflight (free) for any non-trivial plan:

curl -sS -X POST "https://api.jpcite.com/v1/jpcite/preview_cost" \
  -H "X-API-Key: $JPCITE_API_KEY" -H "Content-Type: application/json" \
  -d '{"plan":[
        {"tool":"check_exclusions","tier":"A"},
        {"tool":"find_municipality_subsidies","tier":"A"},
        {"tool":"check_exclusions","tier":"A"},
        {"tool":"touki_kankatsu_resolve","tier":"A"},
        {"tool":"search_laws","tier":"A"},
        {"tool":"houjin_resolve","tier":"A"}]}'
# → {"predicted_total_jpy":18,"cap_passed":true,"per_call":[...]}

Section 8 — Trust verification

Every paid jpcite response carries an _attest envelope and a source_fetched_at (freshness) field. Both are how an agent (or a downstream 士業 caller) verifies the assertion isn't a hallucination.

8.1 Source provenance (Ed25519 signing: 2026 Q3 roadmap)

Take the response from Example 1 (排他 matrix). The relevant slice:

{
  "_attest": {
    "signature_b64": "MEUCIQDq6Z3y…wRA==",
    "signed_fields": ["source_url", "source_fetched_at", "content_hash", "corpus_snapshot_id"],
    "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
  },
  "source_url": "https://www.it-hojo.jp/applicant/exclusion.html#dup-2024",
  "source_fetched_at": "2026-05-17T22:14:09+09:00",
  "content_hash": "9f1a2c8a4e1b…",
  "corpus_snapshot_id": "snap-2026-05-17T13:00Z"
}

Fetch the public key once per session (cached locally for the corpus lifetime):

curl -sS https://jpcite.com/.well-known/jpcite_attest_pubkey.json
# → {"alg":"Ed25519","public_key_b64":"…","issuer":"Bookyou株式会社"}

Verify in Python (PyNaCl):

import base64, json, requests
from nacl.signing import VerifyKey
from nacl.exceptions import BadSignatureError

PUB = requests.get("https://jpcite.com/.well-known/jpcite_attest_pubkey.json", timeout=5).json()
VKEY = VerifyKey(base64.b64decode(PUB["public_key_b64"]))

def verify_attest(packet: dict) -> bool:
    a = packet["_attest"]
    canonical = json.dumps(
        {k: packet[k] for k in a["signed_fields"]},
        sort_keys=True, separators=(",", ":"),
    ).encode()
    try:
        VKEY.verify(canonical, base64.b64decode(a["signature_b64"]))
        return True
    except BadSignatureError:
        return False

# usage
packet = requests.get("https://api.jpcite.com/v1/exclusions/check",
                     params={"program_ids":"it_donyu,monodukuri"}, timeout=10).json()["exclusions"][0]
assert verify_attest(packet), "TAMPERED — refuse to render"

If verify_attest() returns False the agent must refuse to render the assertion and surface a "trust signal failed" badge to the user. Failure modes: corrupted transit, downgrade attack, response replay across snapshot boundaries.

8.2 Freshness (freshness_iso) interpretation

Each row carries source_fetched_at (ISO 8601 with JST offset) — the timestamp jpcite's crawl-and-index pipeline last touched the upstream source. Interpret in three bands:

age of source_fetched_at render rationale
≤ 24h green badge "fresh — fetched normal SoT crawl cadence
24h – 7d yellow badge "fetched , may be stale" upstream source rotated / 官報 holiday lag
> 7d red badge + recommend re-fetch via ?refresh=1 corpus lag — surface to user, do not silently render
from datetime import datetime, timezone, timedelta

def freshness_band(iso: str) -> str:
    fetched = datetime.fromisoformat(iso)
    age = datetime.now(timezone(timedelta(hours=9))) - fetched
    if age <= timedelta(hours=24):  return "fresh"
    if age <= timedelta(days=7):    return "stale"
    return "expired"

In the Example 1 packet, source_fetched_at = "2026-05-17T22:14:09+09:00" and today is 2026-05-18 — the answer is fresh (~5 hours old). UI surface:

✓ Fresh — fetched 2026-05-17 22:14 JST · source-anchored, issued by Bookyou株式会社 · cost ¥3

Pair the freshness band with the signature verification. If signature fails, ignore freshness — the row is untrusted regardless of age.


Appendix — One-shot sanity loop

After completing Sections 2–6, this script re-runs all 5 examples in one go for regression testing:

#!/usr/bin/env bash
set -euo pipefail
BASE="https://api.jpcite.com/v1"
H=(-H "X-API-Key: ${JPCITE_API_KEY:-}")

echo "== Example 1 — 排他 matrix =="
curl -sS "${H[@]}" "$BASE/exclusions/check?program_ids=it_donyu,monodukuri" | jq '.exclusions[0].verdict'

echo "== Example 2 — 自治体 補助金 =="
curl -sS "${H[@]}" "$BASE/municipalities/13117/subsidies?jsic=09&limit=5" | jq '.items | length'

echo "== Example 3 — 法務局 routing =="
curl -sS "${H[@]}" "$BASE/touki/kankatsu?address=新宿区西新宿2-8-1&entity_type=合同会社" | jq '.kankatsu.name'

echo "== Example 4 — 法令検索 =="
curl -sS "${H[@]}" "$BASE/laws/search?query=個人情報保護法 改正&year_from=2026&limit=5" | jq '.items[0].title'

echo "== Example 5 — 法人検索 =="
curl -sS "${H[@]}" "$BASE/houjin/resolve?name=Bookyou" | jq '.items[0].houjin_id'

Expected runtime: ~3.5 sec end-to-end. Total cost (paid tier): ¥15 (5 atomic calls × Tier A — Example 2's chained check_exclusions is omitted in the sanity loop).

Further reading

  • docs/_internal/AGENT_INTEGRATION_COOKBOOK_2026_05_18.md — full 4-platform cookbook (Cursor / Claude Code / Bedrock / Cline).
  • docs/_internal/STRATEGY_V2_2026_05_18.md — strategy + funnel context.
  • https://jpcite.com/trust.html#attestation — signed-fields provenance contract (Ed25519: 2026 Q3 roadmap).
  • https://jpcite.com/docs/canonical/cost_saving_examples — Opus 4.7 7-turn ¥500 vs jpcite ¥3–¥30 verifiable cost model.
  • https://api.jpcite.com/v1/openapi.json — full 307-path OpenAPI 3.1 spec.