{"id":45571243,"url":"https://github.com/ajtgjmdjp/edinet-mcp","last_synced_at":"2026-02-26T00:01:05.001Z","repository":{"id":337201688,"uuid":"1152617669","full_name":"ajtgjmdjp/edinet-mcp","owner":"ajtgjmdjp","description":"EDINET XBRL parsing library and MCP server for Japanese financial data","archived":false,"fork":false,"pushed_at":"2026-02-15T15:16:46.000Z","size":319,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-15T20:14:02.873Z","etag":null,"topics":["ai-agent","disclosure","edinet","finance","financial-analysis","financial-data","japan","japanese","llm","mcp","mcp-server","model-context-protocol","python","securities","xbrl"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/edinet-mcp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajtgjmdjp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-08T06:28:17.000Z","updated_at":"2026-02-15T15:16:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ajtgjmdjp/edinet-mcp","commit_stats":null,"previous_names":["ajtgjmdjp/edinet-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ajtgjmdjp/edinet-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajtgjmdjp%2Fedinet-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajtgjmdjp%2Fedinet-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajtgjmdjp%2Fedinet-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajtgjmdjp%2Fedinet-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajtgjmdjp","download_url":"https://codeload.github.com/ajtgjmdjp/edinet-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajtgjmdjp%2Fedinet-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29845137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","disclosure","edinet","finance","financial-analysis","financial-data","japan","japanese","llm","mcp","mcp-server","model-context-protocol","python","securities","xbrl"],"created_at":"2026-02-23T08:01:04.097Z","updated_at":"2026-02-26T00:01:04.994Z","avatar_url":"https://github.com/ajtgjmdjp.png","language":"Python","funding_links":[],"categories":["MCP 服务器精选列表","Python"],"sub_categories":["💰 金融与加密货币","Data Sources"],"readme":"# edinet-mcp\n\nEDINET XBRL parsing library and MCP server for Japanese financial data.\n\n[![PyPI](https://img.shields.io/pypi/v/edinet-mcp)](https://pypi.org/project/edinet-mcp/)\n[![Python](https://img.shields.io/pypi/pyversions/edinet-mcp)](https://pypi.org/project/edinet-mcp/)\n[![CI](https://github.com/ajtgjmdjp/edinet-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/ajtgjmdjp/edinet-mcp/actions/workflows/ci.yml)\n[![Downloads](https://img.shields.io/pypi/dm/edinet-mcp)](https://pypi.org/project/edinet-mcp/)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)\n[![ClawHub](https://img.shields.io/badge/ClawHub-edinet--mcp-orange)](https://clawhub.com/skills/edinet-mcp)\n\n📝 [日本語チュートリアル: Claude に聞くだけで上場企業の決算がわかる (Zenn)](https://zenn.dev/ajtgjmdjp/articles/edinet-mcp-claude-desktop)\n\nPart of the [Japan Finance Data Stack](https://github.com/ajtgjmdjp/awesome-japan-finance-data): **edinet-mcp** (securities filings) | [tdnet-disclosure-mcp](https://github.com/ajtgjmdjp/tdnet-disclosure-mcp) (timely disclosures) | [estat-mcp](https://github.com/ajtgjmdjp/estat-mcp) (government statistics) | [boj-mcp](https://github.com/ajtgjmdjp/boj-mcp) (Bank of Japan) | [stockprice-mcp](https://github.com/ajtgjmdjp/stockprice-mcp) (stock prices \u0026 FX)\n\n## What is this?\n\n**edinet-mcp** provides programmatic access to Japan's [EDINET](https://disclosure.edinet-fsa.go.jp/) financial disclosure system. It normalizes XBRL filings across accounting standards (J-GAAP / IFRS / US-GAAP) into canonical Japanese labels and exposes them as an [MCP](https://modelcontextprotocol.io/) server for AI assistants.\n\n- Search 5,000+ listed Japanese companies\n- Retrieve annual/quarterly financial reports (有価証券報告書, 四半期報告書)\n- **Automatic normalization**: `stmt[\"売上高\"]` works regardless of accounting standard\n- Financial metrics (ROE, ROA, profit margins) and year-over-year comparisons\n- Parse XBRL into Polars/pandas DataFrames (BS, PL, CF)\n- **Multi-company screening**: Compare financial metrics across up to 20 companies\n- **Cross-period diff (xbrl-diff)**: Compare financial statements across periods with change amounts (増減額) and growth rates (増減率)\n- MCP server with 9 tools for Claude Desktop and other AI tools\n\n## Quick Start\n\n### Installation\n\n```bash\npip install edinet-mcp\n# or\nuv add edinet-mcp\n# or with Docker\ndocker run -e EDINET_API_KEY=your_key ghcr.io/ajtgjmdjp/edinet-mcp serve\n```\n\n### Get an API Key\n\nRegister (free) at [EDINET](https://disclosure2dl.edinet-fsa.go.jp/guide/static/disclosure/WZEK0110.html) and set:\n\n```bash\nexport EDINET_API_KEY=your_key_here\n```\n\n### 30-Second Example\n\n```python\nimport asyncio\nfrom edinet_mcp import EdinetClient\n\nasync def main():\n    async with EdinetClient() as client:\n        # Search for Toyota\n        companies = await client.search_companies(\"トヨタ\")\n        print(companies[0].name, companies[0].edinet_code)\n        # トヨタ自動車株式会社 E02144\n\n        # Get normalized financial statements\n        stmt = await client.get_financial_statements(\"E02144\", period=\"2025\")\n\n        # Dict-like access — works for J-GAAP, IFRS, and US-GAAP\n        revenue = stmt.income_statement[\"売上高\"]\n        print(revenue)  # {\"当期\": 45095325000000, \"前期\": 37154298000000}\n\n        # See all available line items\n        print(stmt.income_statement.labels)\n        # [\"売上高\", \"売上原価\", \"売上総利益\", \"営業利益\", ...]\n\n        # Export as DataFrame\n        print(stmt.income_statement.to_polars())\n\nasyncio.run(main())\n```\n\n### Financial Metrics\n\n```python\nimport asyncio\nfrom edinet_mcp import EdinetClient, calculate_metrics\n\nasync def main():\n    async with EdinetClient() as client:\n        stmt = await client.get_financial_statements(\"E02144\", period=\"2025\")\n        metrics = calculate_metrics(stmt)\n        print(metrics[\"profitability\"])\n        # {\"売上総利益率\": \"25.30%\", \"営業利益率\": \"11.87%\", \"ROE\": \"12.50%\", ...}\n\nasyncio.run(main())\n```\n\n### Multi-Company Screening\n\n```python\nimport asyncio\nfrom edinet_mcp import EdinetClient, screen_companies\n\nasync def main():\n    async with EdinetClient() as client:\n        result = await screen_companies(\n            client,\n            [\"E02144\", \"E01777\", \"E01967\"],  # Toyota, Sony, Keyence\n            period=\"2025\",\n            sort_by=\"営業利益率\",  # Sort by operating margin\n        )\n        for r in result[\"results\"]:\n            print(f\"{r['company_name']}: {r['profitability']['営業利益率']}\")\n        # 株式会社キーエンス: 51.91%\n        # ソニーグループ株式会社: 11.69%\n        # トヨタ自動車株式会社: 9.98%\n\nasyncio.run(main())\n```\n\n### Cross-Period Diff\n\n```python\nimport asyncio\nfrom edinet_mcp import EdinetClient, diff_statements\n\nasync def main():\n    async with EdinetClient() as client:\n        result = await diff_statements(\n            client, \"E02144\",\n            period1=\"2024\", period2=\"2025\",\n        )\n        for d in result[\"diffs\"][:5]:\n            print(f\"{d['科目']}: {d['増減額']:+,.0f} ({d['増減率']})\")\n        # 売上高: +7,941,027,000,000 (+21.38%)\n        # 営業利益: +1,204,832,000,000 (+28.44%)\n        # ...\n\nasyncio.run(main())\n```\n\n## MCP Server\n\nAdd to your AI tool's MCP config:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Desktop\u003c/b\u003e (~⁠/Library/Application Support/Claude/claude_desktop_config.json)\u003c/summary\u003e\n\n```json\n{\n  \"mcpServers\": {\n    \"edinet\": {\n      \"command\": \"uvx\",\n      \"args\": [\"edinet-mcp\", \"serve\"],\n      \"env\": {\n        \"EDINET_API_KEY\": \"your_key_here\"\n      }\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCursor\u003c/b\u003e (~⁠/.cursor/mcp.json)\u003c/summary\u003e\n\n```json\n{\n  \"mcpServers\": {\n    \"edinet\": {\n      \"command\": \"uvx\",\n      \"args\": [\"edinet-mcp\", \"serve\"],\n      \"env\": {\n        \"EDINET_API_KEY\": \"your_key_here\"\n      }\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Code\u003c/b\u003e\u003c/summary\u003e\n\n```bash\nclaude mcp add edinet -- uvx edinet-mcp serve\n# Then set EDINET_API_KEY in your environment\n```\n\u003c/details\u003e\n\nThen ask your AI: \"トヨタの最新の営業利益を教えて\"\n\n### Available MCP Tools\n\n| Tool | Description |\n|------|-------------|\n| `search_companies` | 企業名・証券コード・EDINETコードで検索 |\n| `get_filings` | 指定期間の開示書類一覧を取得 |\n| `get_financial_statements` | 正規化された財務諸表 (BS/PL/CF) を取得 |\n| `get_financial_metrics` | ROE・ROA・利益率等の財務指標を計算 |\n| `compare_financial_periods` | 前年比較（増減額・増減率） |\n| `screen_companies` | 複数企業の財務指標を一括比較（最大20社） |\n| `list_available_labels` | 取得可能な財務科目の一覧 |\n| `get_company_info` | 企業の詳細情報を取得 |\n| `diff_financial_statements` | 2期間の財務諸表を比較（増減額・増減率） |\n\n\u003e **Note**: The `period` parameter is the **filing year**, not the fiscal year. Japanese companies with a March fiscal year-end file annual reports in June of the following year (e.g., FY2024 → filed 2025 → `period=\"2025\"`).\n\n## CLI\n\n```bash\n# Search companies\nedinet-mcp search トヨタ\n\n# Fetch income statement\nedinet-mcp statements -c E02144 -p 2024\n\n# Screen multiple companies\nedinet-mcp screen E02144 E01777 E02529 --sort-by ROE\n\n# Compare across periods (xbrl-diff)\nedinet-mcp diff -c E02144 -p1 2023 -p2 2024\n\n# Start MCP server\nedinet-mcp serve\n```\n\n## API Reference\n\n### `EdinetClient`\n\nAll client methods are async. Use `async with` for proper resource cleanup:\n\n```python\nimport asyncio\nfrom edinet_mcp import EdinetClient\n\nasync def main():\n    async with EdinetClient(\n        api_key=\"...\",        # or EDINET_API_KEY env var\n        cache_dir=\"~/.cache/edinet-mcp\",\n        rate_limit=0.5,       # requests per second\n        max_retries=3,        # retry on 429/5xx with exponential backoff\n    ) as client:\n        # Search\n        companies: list[Company] = await client.search_companies(\"query\")\n        company: Company = await client.get_company(\"E02144\")\n\n        # Filings\n        filings: list[Filing] = await client.get_filings(\n            start_date=\"2024-01-01\",\n            edinet_code=\"E02144\",\n            doc_type=\"annual_report\",\n        )\n\n        # Financial statements (by edinet_code + period)\n        stmt: FinancialStatement = await client.get_financial_statements(\n            edinet_code=\"E02144\",\n            period=\"2024\",  # Filing year (not fiscal year)\n        )\n\n        # Or get the most recent filing (within past 365 days)\n        stmt = await client.get_financial_statements(edinet_code=\"E02144\")\n\n        df = stmt.income_statement.to_polars()  # Polars DataFrame\n        df = stmt.income_statement.to_pandas()  # pandas DataFrame (optional dep)\n\nasyncio.run(main())\n```\n\n### `Filing`\n\nFiling objects returned by `get_filings()` have the following attributes:\n\n```python\nfor filing in filings:\n    print(filing.description)    # \"有価証券報告書－第121期(...)\"\n    print(filing.filing_date)    # datetime.date(2025, 6, 18)\n    print(filing.doc_id)         # \"S100VWVY\"\n    print(filing.company_name)   # \"トヨタ自動車株式会社\"\n    print(filing.period_start)   # datetime.date(2024, 4, 1)\n    print(filing.period_end)     # datetime.date(2025, 3, 31)\n```\n\n### `StatementData`\n\nEach financial statement (BS, PL, CF) is a `StatementData` object with dict-like access:\n\n```python\n# Dict-like access by Japanese label\nstmt.income_statement[\"売上高\"]       # → {\"当期\": 45095325, \"前期\": 37154298}\nstmt.income_statement.get(\"営業利益\") # → {\"当期\": 5352934} or None\nstmt.income_statement.labels          # → [\"売上高\", \"営業利益\", ...]\n\n# DataFrame export\nstmt.balance_sheet.to_polars()    # → polars.DataFrame\nstmt.balance_sheet.to_pandas()    # → pandas.DataFrame (requires pandas)\nstmt.balance_sheet.to_dicts()     # → list[dict]\nlen(stmt.balance_sheet)           # number of line items\n\n# Raw XBRL data preserved\nstmt.income_statement.raw_items   # original pre-normalization data\n```\n\n### Normalization\n\nedinet-mcp automatically normalizes XBRL element names across accounting standards:\n\n| Accounting Standard | XBRL Element | Normalized Label |\n|---|---|---|\n| J-GAAP | `NetSales` | 売上高 |\n| IFRS | `Revenue`, `SalesRevenuesIFRS` | 売上高 |\n| US-GAAP | `Revenues` | 売上高 |\n\nMappings are defined in [`taxonomy.yaml`](src/edinet_mcp/data/taxonomy.yaml) — 161 items covering PL (42), BS (79), and CF (40), with IFRS/US-GAAP element variants automatically resolved via suffix stripping. Add new mappings by editing the YAML file, no code changes needed.\n\n```python\nfrom edinet_mcp import get_taxonomy_labels\n\n# Discover available labels\nlabels = get_taxonomy_labels(\"income_statement\")\n# [{\"id\": \"revenue\", \"label\": \"売上高\", \"label_en\": \"Revenue\"}, ...]\n```\n\n### EDINET Suffix Stripping\n\nEDINET appends accounting-standard and section-specific suffixes to XBRL element names (e.g., `TotalAssetsIFRSSummaryOfBusinessResults`). These are automatically stripped to match canonical taxonomy entries. Non-consolidated (単体) contexts are filtered out to prefer consolidated figures.\n\n## Architecture\n\n```\nEDINET API → Parser (XBRL/TSV) → Normalizer (taxonomy.yaml) → MCP Server\n                                        ↓\n                              StatementData[\"売上高\"]\n                              calculate_metrics(stmt)\n                              compare_periods(stmt)\n```\n\n## Development\n\n```bash\ngit clone https://github.com/ajtgjmdjp/edinet-mcp\ncd edinet-mcp\nuv sync --extra dev\nuv run pytest -v           # 213 tests\nuv run ruff check src/\n```\n\n## Data Attribution\n\nThis project uses data from [EDINET](https://disclosure.edinet-fsa.go.jp/)\n(Electronic Disclosure for Investors' NETwork), operated by the\nFinancial Services Agency of Japan (金融庁).\nEDINET data is provided under the [Public Data License 1.0](https://www.digital.go.jp/resources/open_data/).\n\n## Related Projects\n\n**Japan Finance Data Stack** (by same author):\n- [tdnet-disclosure-mcp](https://github.com/ajtgjmdjp/tdnet-disclosure-mcp) — TDNET timely disclosures (適時開示)\n- [estat-mcp](https://github.com/ajtgjmdjp/estat-mcp) — Government statistics (e-Stat)\n- [boj-mcp](https://github.com/ajtgjmdjp/boj-mcp) — Bank of Japan statistics\n- [stockprice-mcp](https://github.com/ajtgjmdjp/stockprice-mcp) — Stock prices \u0026 FX rates (yfinance)\n- [jfinqa](https://github.com/ajtgjmdjp/jfinqa) — Japanese financial QA benchmark\n\n**Community**:\n- [edinet2dataset](https://github.com/SakanaAI/edinet2dataset) — Sakana AI's EDINET XBRL→JSON tool\n- [EDINET-Bench](https://github.com/SakanaAI/EDINET-Bench) — Financial classification benchmark\n\n## License\n\nApache-2.0. See [NOTICE](NOTICE) for third-party attributions.\n\n\u003c!-- mcp-name: io.github.ajtgjmdjp/edinet-mcp --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajtgjmdjp%2Fedinet-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajtgjmdjp%2Fedinet-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajtgjmdjp%2Fedinet-mcp/lists"}