edinet-mcp
Enables access and analysis of Japanese corporate financial data (PL/BS/CF) via EDINET API. Supports searching companies, listing reports, and comparing financials through natural language queries.
README
edinet-mcp
EDINET APIを利用して日本企業の財務諸表データを取得・分析するMCPサーバー。 Claude DesktopやClaude CodeからEDINETの決算データに直接アクセスできます。
セットアップ
1. 依存パッケージのインストール
Python 3.10以上が必要です。
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
2. EDINET APIキーの取得
本ツールの利用にはEDINET APIのサブスクリプションキーが必要です。以下の手順で無料で取得できます。
-
アカウント作成 EDINET API 利用登録ページ にアクセスし、氏名・メールアドレス・電話番号を入力して新規登録します。
-
多要素認証 メールで届く確認コードを入力後、SMS認証を行います。電話番号は国番号
+81を選択し、先頭の0を省略して入力します(例:80-XXXX-XXXX)。 -
ブラウザのポップアップ許可 APIキーはポップアップウィンドウで表示されます。ブラウザが
https://api.edinet-fsa.go.jpのポップアップをブロックしている場合は、事前に許可設定を行ってください(Microsoft Edgeの利用も推奨されています)。 -
APIキーの取得 認証完了後、連絡先を登録するとサブスクリプションキーが画面に表示されます。
詳細な仕様は EDINET API仕様書 (Version 2) を参照してください。
3. 環境変数の設定
.env.example を .env にコピーし、APIキーを設定します:
cp .env.example .env
# .env を編集して EDINET_SUBSCRIPTION_KEY を設定
4. Claude Desktopへの登録
~/Library/Application Support/Claude/claude_desktop_config.json に以下を追加します:
{
"mcpServers": {
"edinet-mcp": {
"command": "/path/to/edinet-mcp/.venv/bin/python",
"args": ["/path/to/edinet-mcp/server.py"],
"env": {
"EDINET_SUBSCRIPTION_KEY": "your_subscription_key_here"
}
}
}
}
command と args のパスは実際のインストール先に合わせてください。
設定後、Claude Desktopを再起動すると利用可能になります。
5. リモートMCP(SSE)として利用する場合
SSEトランスポートでリモートMCPサーバーとして起動できます。
python server.py --transport sse --port 8000
クライアント側の設定:
{
"mcpServers": {
"edinet-mcp": {
"url": "https://your-server-url/sse"
}
}
}
Claude Code の場合:
claude mcp add edinet-mcp --transport sse https://your-server-url/sse
提供ツール
| ツール | 説明 |
|---|---|
search_company |
企業名からEDINETコードを検索 |
list_financial_reports |
指定期間の決算書類一覧を取得 |
get_financial_data |
企業の財務データ (PL/BS/CF) を取得・億円単位で表示 |
compare_companies |
複数企業の財務データを比較 |
使用例(Claude Desktop / Claude Codeでの質問)
- 「トヨタ自動車のEDINETコードを調べて」
- 「トヨタ自動車の2025年6月の決算書類を一覧して」
- 「トヨタ自動車の2025年6月の財務データを取得して」
- 「トヨタと本田の財務データを比較して」
パフォーマンスに関する注意
EDINET APIは1日単位でしか書類一覧を取得できないため、日付範囲は1〜2ヶ月以内を推奨します。3月決算企業の有価証券報告書は通常6月に提出されるため、例えば 2025-06-01 〜 2025-06-30 のように絞ると高速に取得できます。
一度取得した日付の書類一覧はディスクにキャッシュされるため、同じ期間の2回目以降のクエリは即座に返ります。
取得可能な財務項目
- 損益計算書 (PL): 売上高、売上原価、売上総利益、販管費、営業利益、経常利益、当期純利益 等
- 貸借対照表 (BS): 流動資産、固定資産、資産合計、負債合計、純資産合計 等
- キャッシュフロー (CF): 営業CF、投資CF、財務CF 等
プロジェクト構成
edinet-mcp/
├── server.py # MCPサーバー本体
├── edinet_analyzer/ # コアロジック
│ ├── analyzer.py # EDINET API連携・XBRL解析
│ └── config.py # 設定管理
├── config/
│ └── config.json # 運用設定 (rate_limit, timeout等)
├── data/
│ ├── master/ # EDINETコードマスタ (EdinetcodeDlInfo.csv)
│ └── cache/ # XBRLファイル・書類一覧のキャッシュ
├── logs/ # ログファイル
├── .env.example # .envのテンプレート
└── requirements.txt # 依存パッケージ
設定
config/config.json で運用パラメータを変更できます:
{
"rate_limit": 0.3,
"max_retries": 3,
"timeout": 30,
"cache_enabled": true
}
| パラメータ | 説明 | デフォルト |
|---|---|---|
rate_limit |
APIリクエスト間の最小間隔(秒) | 0.3 |
max_retries |
APIエラー時のリトライ回数 | 3 |
timeout |
APIリクエストのタイムアウト(秒) | 30 |
cache_enabled |
XBRLファイルのディスクキャッシュ | true |
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.