Borrowing it
Nothing to install: this file belongs to shigechika/jquants-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/shigechika/jquants-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/shigechika/jquants-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/shigechika/jquants-mcp/claude-md)<a href="https://agentmods.dev/instructions/shigechika/jquants-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shigechika/jquants-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/shigechika/jquants-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shigechika/jquants-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04084 | $0.04084 |
| Opus 5 | $0.02042 | $0.02042 |
| Sonnet 5 | $0.00817 | $0.00817 |
| Haiku 4.5 | $0.00408 | $0.00408 |
Grade A, and why
jquants-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Project Overview
jquants-mcp is an MCP server that retrieves Japanese stock market data via J-Quants API v2.
The server is stdio-only and is built on the official mcp SDK's mcp.server.fastmcp.FastMCP
(server.py + tools/). The standalone FastMCP v3 package (fastmcp) is no longer a dependency:
its last in-repo users — the HTTP/OAuth surface (auth.py, settings/, oauth_kv_store.py, the
non-stdio branch of run_server()) and scripts/smoke_test.py's client — were deleted or ported to
the official SDK in #568. httpx, SQLite cache. Multi-user OAuth is terminated upstream by the
Cloud Run gateway (oauth2-proxy + mcp-stdio serve), not in this process — see "Deployment Targets".
Commands
uv sync --dev # Install dependencies
uv run pytest -v # Run tests
uv run ruff check src/ tests/ # Lint
uv run ruff format src/ tests/ # Format
uv run python scripts/smoke_test.py # Exercise every tool against real data
uv run python scripts/smoke_test.py --only earnings --traceback # Debug one tool
Architecture
src/jquants_mcp/— Main packageserver.py— Official-SDKFastMCPserver (stdio), per-user client management, tool registrationclient.py— httpx async client with rate limiting, retry, paginationconfig.py— configparser + env vars hybrid configurationcache/store.py— 2-tier SQLite cache (Tier1: row-level, Tier2: response-level with TTL); backgroundPRAGMA quick_checkintegrity verification (verify_and_record) with a(dev, ino)-keyed sidecar (cache.db.verified.json) so a fresh per-messageCacheStorereuses a prior generation's verdict instead of re-running the multi-second check on every claude.ai messagetools/— Tool modules registered viaregister(mcp, get_client, get_cache)patterncrypto.py— AES-256-GCM encryption for user API keysdb/users.py— Per-user API key storage (SQLite, encrypted)validators.py— Input validation (code, date, sector)allowlist.py—JQUANTS_ALLOWED_EMAILSgate; the gateway-injected principal is the verified email, soserver.pypasses it straight tois_email_allowedrequest_context.py— Request-scoped plan contextvar; read byCacheStore._effective_planas a fallback before itsplan_resolver(see below), so each user's plan date window applies without threadingplanthrough tools
scripts/— Operational scriptsdaily_fetch.py— Daily data fetch (cron / scheduled-task companion for cache population)bulk_fetch_all.py— Historical data bulk fetch via J-Quants Bulk APIgcs_sync.py— Cloud Run cache.db startup download from GCS (--init-cache). Skips the download (and the atomic replace that always allocates a new inode, which would invalidateCacheStore's(dev, ino)integrity sidecar) when the GCS generation of the effective object -- whichevercache.db.zst/cache.dbthe zst-then-fallback precedence would actually use -- is unchanged since the last successful download, tracked in acache.db.generation.jsonsidecar. On Cloud Run that skip is dormant since #584 removed the periodic poll it was written for (a cold start always starts from an empty cache dir), but it stays correct and load-bearing for repeat--init-cacheruns against a populated dir. Auth DBs are no longer synced here:users.db/oauth_state.dbmoved to Firestore on Cloud Run, so_DOWNLOAD_FILES/_UPLOAD_FILESare empty and--init/--daemonare auth-DB no-opsgcs_export_cache.py— Export cache.db to GCS (used by the daily publisher)verify_cache.py— Stand-alone cache-integrity prewarm CLI: runs the sameverify_and_recordquick_check theCacheStoresidecar uses, ahead of the next request, so a freshly downloaded cache.db already has a warm(dev, ino)sidecar by the time the first per-message child process connects. Invoked byentrypoint-stdio.sh(backgrounded after the synchronous startup download)rotate_encryption_key.py— Re-encrypt user API keys during MCP_ENCRYPTION_KEY rotationcollect_metrics.py/load_test.py— Cloud Run sizing helperssmoke_test.py— Live smoke test: runs every registered tool against real data (in-process, or--urlagainst a deployment) and fails on empty/stale/error answers.smoke_harness.pyis the server-agnostic engine;smoke_probes.pyholds the per-tool specs. Needs a populated cache + API key, so it runs on the host that has them — not in CI. CI enforces only the coverage half (tests/test_smoke_probes.py: a new tool without a probe spec fails the build)entrypoint-compose.sh— the Dockerfile's defaultENTRYPOINT, for the self-hostedcompose.ymlpath. Runsmcp-stdio servein front of the stdio server with no OAuth and no GCS; auth is an optional static bearer token read fromMCP_STDIO_SERVE_TOKEN. Replaced the streamable-httpentrypoint.sh, which had crash-looped since #566 (#601). Refuses to start whenK_SERVICEis set — booting it on Cloud Run would publish an unauthenticated/mcpbehind oauth2-proxy's skip-auth route for/mcpentrypoint-stdio.sh— Docker/Cloud Run entrypoint for thejquantsservice (mcp-stdio serve, behind anoauth2-proxysidecar); downloads cache.db synchronously at startup, then backgroundsverify_cache.pyto warm the integrity sidecar. It has no in-container refresh mechanism (#584 removed the 15-minutecache-poll.crontabsupercronic poll): withmin-instances=0every cold start already re-downloads a current cache.db, and the only window a refresh could help is an instance staying warm across the publisher's once-a-weekday export. There, not-yet-cached days fall through to the live API (correct, just slower), while corrections to already-cached rows do not — the cache-vs-API decision is presence-based and Tier 1get_rowsapplies no TTL, so a restated statement or retroactive split adjustment stays stale until the instance recycles (measured lifetimes 15-26 min undermin-instances=0, i.e. the same order as the 15-minute poll it replaces). The retiredentrypoint.sh's Pub/Sub-pushed reload route has no equivalent here because a stdio-only server exposes no HTTP route for a push to land on; push-based alternatives were designed and rejected as not worth the moving parts (see #584)
tests/— pytest + pytest-asyncio tests (1272 tests as of 2026-08, after the HTTP/OAuth removal in #568)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 182 lines · 4,084 tokens per session scan A b2f197037fc5
jquants-mcp CLAUDE.md is an instructions file published in the GitHub repository shigechika/jquants-mcp (2 stars, last pushed 2d ago), licensed MIT. It adds 4,084 tokens to every session, about $0.0204 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.