Rule Trade - Japanese equity verification layer
RemoteAbout Rule Trade - Japanese equity verification layer
Rule Trade is an MCP server for Japanese equity research, organizing published verification data into statistics for researchers and analysis clients. It reads JSON produced by an existing pipeline rather than running its own engine, and does not provide trading advice.
Key features
- 01Query market regime and three-axis scores
- 02Review statistics for 50 market anomalies
- 03Inspect candlestick and indicator test results
- 04Analyze event reactions and ETF decay
- 05Retrieve market signals and update guidance
Use cases
- 01Compare verification statistics for market anomalies
- 02Review indicator performance across conditions
- 03Study events, market regimes, or leveraged ETF decay
MCP support
It provides stateless HTTP tools to MCP clients at `https://ruletrade.jp/mcp`. Results include a disclaimer and exclude raw price series, trading advice, and the full list of matching stocks.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://ruletrade.jp/mcpclaude mcp add --transport http jp-ruletrade https://ruletrade.jp/mcp{"mcpServers":{"jp-ruletrade":{"type":"http","url":"https://ruletrade.jp/mcp"}}}Open in Cursor{"servers":{"jp-ruletrade":{"type":"http","url":"https://ruletrade.jp/mcp"}}}Open in VS Code{"mcpServers":{"jp-ruletrade":{"type":"http","url":"https://ruletrade.jp/mcp"}}}{"mcpServers":{"jp-ruletrade":{"serverUrl":"https://ruletrade.jp/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
8| Parameter | Type | Required | Description |
|---|---|---|---|
| strategy | enum | No | Rule name. Currently only bnf (a contrarian rule based on deviation from the 25-day moving average) is supported.bnf |
Details
From the project READMERule Trade MCP / ルールトレード MCP
Endpoint: https://ruletrade.jp/mcp
(llms.txt: https://ruletrade.jp/mcp/llms.txt · OpenAPI: https://ruletrade.jp/mcp/openapi.json · health: https://ruletrade.jp/mcp/health)
English
A verification layer for Japanese equities, exposed over MCP.
Most Japanese-equity MCP servers cover the primary data layer — filings, prices, order execution. This one covers what is missing: what actually happened when published, mechanical rules were applied. It holds no engine of its own; it reads JSON that an existing pipeline publishes daily and reshapes it. Zero dependencies, no API key, no registration.
What you can get
| Tool | Returns |
|---|---|
get_daily_signals | One stock that matched a published mean-reversion rule (25-day moving-average deviation ≤ -15%), delayed one trading day. Counts are returned; the full list of matches is not distributed. |
get_market_regime | Machine-classified market regime (BULLISH / NEUTRAL / BEARISH / PANIC), circuit-breaker state, VIX, Nikkei 225, daily history, and a three-axis score (trend, short-term risk, supply and demand) with the reasoning behind each axis. No stock names. |
get_anomaly_summary | 50 Japanese market anomalies tested over 61 years — verdict, win rate, mean return, sample size, p-value, control group. Filter by name. Plus five crash-precursor gauges and a 7-flag ignition meter verified over 26 years. |
get_candlestick_verdict | All 12 classic Japanese candlestick patterns tested on 1,550 TSE Prime stocks over 10.5 years — trades, win rate, profit factor, excess return, p-value, losing years, and which of the five adoption criteria each one failed. None of them cleared the bar. The one with the highest profit factor (3.04) flipped sign between the first and second halves of the sample. |
get_event_reaction | What followed an event, from three separate studies — 27 event types (earthquakes, rate decisions, tariffs, pandemics), post-earnings drift across ~26,000 announcements, and index additions and deletions. All three point the same way: the move happens before the event clears. Per-stock rows and sector baskets are deliberately excluded. |
get_indicator_verdict | 26 technical indicators traded exactly as the textbooks describe — TOPIX500, 10 years, ~500,000 trades. Win rate, expectancy, profit factor and excess return over random entry, across two exits. Nine cleared every regime; thirteen did not, and those thirteen are mostly the ones beginners learn first. |
get_etf_decay | Twelve years of measured decay in leveraged and inverse ETFs — yearly theory against actual, win rate by holding period, profit factor by market condition, and 305 attempts to hold and wait for a position to come back (99.3% came back; the ones that did not lost 32.5%). |
list_tools_guide | Update times (JST), delays, what is deliberately not returned, disclaimer, roadmap. Call this first. |
What you cannot get — by design
- Raw price series, OHLCV, or financial-statement values
- Position sizing, entry/exit prices, stop-loss or take-profit levels
- The production thresholds used by the operator's own system
- Any recommendation, rating, or buy/sell signal
Every response carries a disclaimer key. Do not strip it when relaying results to a user.
Output describes whether mechanical rules matched. It is not investment advice, not a solicitation,
and promises no future return.
How to connect
# Claude Code
claude mcp add --transport http ruletrade https://ruletrade.jp/mcp
- claude.ai: Settings → Connectors → Add custom connector →
https://ruletrade.jp/mcp - Any MCP client: POST JSON-RPC 2.0 to
https://ruletrade.jp/mcp(Streamable HTTP, stateless)
Where the research comes from
The rules and verification data are published as books by the operator (Japanese, Kindle): Silent Investor BNF, Crashes Decay, and All 50 Japanese Market Anomalies Tested Over 61 Years. The anomaly dataset is a fixed snapshot taken at that book's publication (2026-08) and is not updated daily.
Good to know
- Data updates on Japan Exchange trading days. Exact times are in
list_tools_guide. - Rate limits are not enforced today. Please be reasonable.
- Statistical values are rounded; p-values use 3 significant figures so very small values stay readable.
日本語
kaburadar.jp / ruletrade.jp が毎日公開している検証済みJSON(docs/*.json)を、
AIエージェント(Claude / Cursor / ChatGPT 等)から MCP で読めるようにする 変換層 です。
エンジンは持たず、GitHub raw の JSON を読んで整形するだけ。依存パッケージゼロ。
正規URL は https://ruletrade.jp/mcp。実体は Cloudflare Workers だが、
ruletrade.jp(Vercel)の vercel.json で rewrite しているため、配信先が変わっても利用者側の URL は変わらない。
| ツール | 読むJSON | 内容 |
|---|---|---|
get_daily_signals | free_scanner.json | BNF 25日線乖離ルールの該当銘柄(1営業日遅れ)。返すのは1件のみ・件数は返す |
get_market_regime | radar.json / market_jiai.json / radar_history.json / score3.json | 地合い BULLISH〜PANIC・HALT・VIX・日経・履歴 + 3軸スコア(トレンド/短期リスク/需給・5段階・軸ごとの根拠) |
get_anomaly_summary | anomaly_results.json / gauge.json / crash.json | ジンクス50本の検証結果(61年・判定/勝率/p値。name で絞り込み)+ 『暴落は、減衰する』5つの前兆 + 着火メーター(26年検証) |
get_candlestick_verdict | candlestick_verdict.json | 酒田五法12本の検証結果(東証プライム・10年半)。12本すべて不採用・落ちた基準・不採用の理由。pattern で絞り込み(日英の別名可) |
get_event_reaction | event_reaction.json / earnings_drift.json / supply_demand_events.json | 出来事のあとに何が起きたかを3つの検証から。①出来事27種(地震・利上げ・関税ほか) ②決算後のドリフト ③指数の入替。event で絞り込み(地震 / 決算 / TOPIX など) |
get_indicator_verdict | indicator_verdict.json | テクニカル指標26種の検証結果(TOPIX500・10年・約50万回)。使える9 / 条件付き4 / 捨てろ13・8区分のどこで基準に届かなかったか。name で絞り込み(日英の別名可) |
get_etf_decay | etf_decay.json | レバレッジ・インバースETFの減価(12年の実測)。年別・保有日数別・条件別と「戻るまで待つ」305回の結果。各節の「解釈で注意すべき点」を必ず添える |
list_tools_guide | (静的) | 使い方・更新時刻・遅延・免責・今後の予定 |
法務線は人向けサイトと同一:
- 銘柄を返すのは1件だけ(2026-09-17 に上位3件から縮小)。該当した全銘柄の一覧は配布しない。件数は返す
- 推奨語(推奨/おすすめ/買うべき/儲かる 等
src/legal.jsのNG_WORDS)は出力から伏せ字にする - 全レスポンスに
disclaimerキーを常設 - 価格・株数・利確/損切ライン・本番の調整済み閾値は出さない(free_scanner.json 生成時点で既に落ちている)
- ジンクス検証は判定結果と統計値(勝率・平均・標本数・p値)のみ。格言の本文(
saying)は推奨語を含むため出力しない - 書籍の検証も統計値のみ。銘柄名・銘柄コード・銘柄バスケットは返さない。元データに併存する明細(連想の
baskets.csv499行・決算のevents_raw.csv・自社株買いのbuyback_*.csv5,523行)は生成側でも開いていない - 書籍から取り込む文章は
mcp/tools/legal_check.pyが JSON を書き出す前に検査する。伏せ字(scrub)は最後の砦で、そこに頼ると「各[表現調整]点の日経平均」のように文の意味が壊れる - ETFのコード(1357 等)だけは返す。何を検証したかを示す識別子で、個別株を名指しするのとは別
データの出どころ
docs/*.json は既存の生成側(Python)が毎日書き出しているもの。MCP は読むだけで、生成側は一切触らない。
docs/anomaly_results.json / docs/candlestick_verdict.json / docs/event_reaction.json /
docs/indicator_verdict.json / docs/etf_decay.json / docs/earnings_drift.json /
docs/supply_demand_events.json の7つは
日次ではなく 書籍刊行時点の固定データ。後の2つは mcp/tools/build_*.py で検証の生出力から機械変換し、
mcp/tools/verify_*.py で元CSVと1つずつ突き合わせている(手で書き写さない)。
docs/anomaly_results.json だけは日次ではなく 書籍刊行時点(2026-08)の固定データ。
元は 株式投資開発/jinx_verification/results/results.json(このリポジトリの外)で、
JSON 非対応の NaN を null に置換したコピー。更新するときは同じ手順でコピーし直す。
エンドポイント
| パス | 内容 |
|---|---|
POST /mcp | MCP Streamable HTTP(JSON-RPC・ステートレス) |
GET /health | 5つのJSONが読めるか確認 |
GET /llms.txt | エージェント向けの説明(英語主・日本語従) |
GET /openapi.json | OpenAPI 3.1。JSON-RPC を1エンドポイントとして記述 |
GET / | 概要 |
デプロイ(どちらか一方でOK・スマホのブラウザから完結)
A. Cloudflare Workers(推奨: ログ保持が長い・無料枠 10万req/日)
- Cloudflare ダッシュボード → Workers & Pages → Create → Import a repository
- リポジトリ
stock-trading-を選ぶ → Root directory にmcpを入れる - Build command は空、Deploy command は
npx wrangler deploy(既定のまま) - Deploy → Worker の実体は
https://ruletrade-mcp.<account>.workers.dev/mcp。 利用者に案内するのは正規URLhttps://ruletrade.jp/mcp(ruletrade.jp のsite/vercel.jsonが rewrite する)。 Worker の URL が変わったときはsite/vercel.jsonの2行とsrc/tools.jsのCANONICAL_*を直す - ログ: Worker → Logs(
wrangler.tomlの observability で有効化済み)。event:"tool_call"で絞ると呼び出し数が見える
B. Vercel
- vercel.com → Add New Project → リポジトリ
stock-trading-を Import - Root Directory を
mcpに変更、Framework Preset は Other - Deploy →
https://<project>.vercel.app/mcpがエンドポイント - ログ: Project → Logs(Hobby は保持1時間なので、集計したい場合は下の
LOG_WEBHOOKを使う)
動作確認(デプロイ後にブラウザで開くだけ)
https://ruletrade.jp/mcp/health→"ok": trueなら完了- Worker 直の
https://ruletrade-mcp.<account>.workers.dev/healthでも同じものが見える(切り分け用)
接続(正規URLを使う。*.workers.dev は案内しない)
- Claude(claude.ai): 設定 → コネクタ → カスタムコネクタを追加 → URL に
https://ruletrade.jp/mcp - Claude Code:
claude mcp add --transport http ruletrade https://ruletrade.jp/mcp - 最初に
list_tools_guideを呼ぶようinitializeの instructions で案内している
環境変数(すべて任意)
| 変数 | 用途 |
|---|---|
DATA_BASE | JSONの取得元(既定: GitHub raw の docs/)。リポジトリ非公開化時に差し替え |
ANOMALY_URL | 検証JSONを別配信先に置く場合に指定。get_anomaly_summary の jinx_verification_external にそのまま入る(通常は不要。既定は docs/anomaly_results.json) |
LOG_WEBHOOK | 呼び出しログ(1行JSON)をPOSTする先。GAS/Slack/Sheets 等で集計したい場合 |
CACHE_TTL_MS | インスタンス内キャッシュ(既定 60000) |
呼び出しログの形: {"ts","event":"tool_call","tool","args","ok","ms","scrubbed","client"}
(initialize 時は clientInfo も記録。実際にどう使われているかを見るための数字)
ローカル
cd mcp
npm test # 実際の docs/*.json をフィクスチャに35テスト(推奨語ゼロ・銘柄コードゼロの検査を含む)
node dev.js # http://localhost:8787/mcp
curl -s localhost:8787/health
curl -s -X POST localhost:8787/mcp -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_market_regime","arguments":{"history_days":5}}}'
今後
run_rule_backtestは、検証基盤(backtest_grid)ができた時点で検討。エンジンは二重に作らない- Week 1 は「読むだけ」。書き込み・発注・個別助言に相当する機能は入れない
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.