paper-fx-mcp
Integrates OANDA FX trading with technical analysis, economic news, stock/indices quotes, corporate financials, EDINET disclosures, and composite scoring into a unified MCP server.
README
OANDA + Multi-Source FX/Equity MCP Server
FX 売買 (OANDA) を中核に、テクニカル分析・経済ニュース・株価/指数 (日経平均含む)・企業財務・EDINET 開示・複合スコアリングまで一つの MCP に統合。
ファイル構成
| ファイル | 役割 |
|---|---|
oanda_mcp_server.py |
MCP エントリ。全ツールを登録 |
oanda_client.py |
OANDA REST API クライアント |
indicators.py |
テクニカル指標(純Python)とスコアリングロジック |
requirements.txt |
依存 |
.env.example |
環境変数テンプレ |
セットアップ
pip install -r requirements.txt
export OANDA_API_TOKEN="..."
export OANDA_ACCOUNT_ID="101-001-xxxxxxx-001"
export OANDA_ENVIRONMENT="practice" # デフォルト practice
export NEWSAPI_KEY="..." # https://newsapi.org の無料枠
export EDINET_API_KEY="..." # https://disclosure2.edinet-fsa.go.jp/
Claude Code 登録:
claude mcp add oanda -- python /絶対パス/oanda_mcp_server.py
公開ツール一覧
売買 (OANDA)
get_price— 通貨ペアの bid/askget_candles— OANDA ローソク足get_account— 残高・建玉place_order— 成行発注 (SL必須、サイズ自動計算)close_position— 指定銘柄の全決済kill_switch/reset_kill_switch— 緊急停止
株価・指数 (yfinance, 無料)
get_index— 指数:^N225日経 /^TPXTOPIX /^GSPCS&P /^DJIダウ /^IXICNasdaqget_stock_quote— 銘柄株価: 日本株は7203.T(トヨタ) 形式、米株はAAPL等get_stock_history— 過去 OHLC
財務・開示
get_financials— PL/BS/CF (yfinance、日米両対応)search_edinet— 有報・四半期報告書・臨時報告書を日付検索
ニュース
get_news— NewsAPI 経由のキーワード検索 (language='ja'で日本語)
分析・スコアリング
technical_analysis— FX も株も自動ルーティングで指標一式composite_score— テクニカル(自動) + ファンダ + ニュースを加重合成
スコアリングの考え方
technical_score は3コンポーネント(トレンド40% / モメンタム35% / 平均回帰25%)を -100〜+100 に正規化。これだけで戦略になるものではなく、ファンダとニュースは Claude が get_financials と get_news の出力を読んで -100〜+100 の数値を作り、composite_score に渡す ワークフローを想定しています。
例: トヨタの判定
1. technical_analysis("7203.T", granularity="D")
→ テクニカルスコア取得
2. get_financials("7203.T")
→ Claude が「営業利益率改善・FCF黒字・負債健全」と読み、+60 とする
3. get_news("Toyota", language="en", max_results=10)
→ Claude が見出し10件読んで「中立〜やや好材料」と判断、+15
4. composite_score("7203.T", granularity="D",
fundamental_score=60, news_sentiment_score=15)
→ 加重合成スコア
完全自動売買に進む前のチェックリスト
- デモで最低1ヶ月走らせる
- プロセス監視(落ちたら通知)
- ネット断/API障害時のフェイルセーフ確認
- 戦略をバックテスト(このMCPには未実装、要追加)
- 税務と申告の理解
- 失っても生活に影響しない金額のみ
既知の限界
- ポジションサイジングは「クォート通貨 ≒ 口座通貨」前提の近似
- yfinance はレート制限あり (短時間に大量呼び出し禁止)
- NewsAPI 無料枠は1日100リクエスト、過去1ヶ月のみ
- EDINET は 書類リストの取得まで。本文の取得・XBRL解析は別途
- スコアは「相対的にどちらに偏っているか」の指標であって、勝率や期待値の保証ではない
- キルスイッチ状態は in-memory(本番なら永続化必須)
拡張ロードマップ
- バックテストツール (
backtest_strategy) - EDINET 書類本文ダウンロードと XBRL パース
- TDnet 適時開示の取得
- 価格ストリーミング (
stream_pricesvia OANDA stream API) - ポジション履歴の SQLite 永続化
- Discord/Slack 通知連携
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.