Skip to main content

EDINET XBRL parsing library and MCP server for Japanese financial data

Project description

edinet-mcp

EDINET XBRL parsing library and MCP server for Japanese financial data.

PyPI Python License

What is this?

edinet-mcp provides programmatic access to Japan's EDINET financial disclosure system. It parses XBRL filings into structured DataFrames and exposes them as an MCP server for AI assistants.

  • Search 5,000+ listed Japanese companies
  • Retrieve annual/quarterly financial reports (有価証券報告書, 四半期報告書)
  • Parse XBRL into Polars/pandas DataFrames (BS, PL, CF)
  • MCP server for Claude Desktop and other AI tools
  • J-GAAP / IFRS / US-GAAP detection

Quick Start

Installation

pip install edinet-mcp
# or
uv add edinet-mcp

Get an API Key

Register (free) at EDINET and set:

export EDINET_API_KEY=your_key_here

30-Second Example

from edinet_mcp import EdinetClient

client = EdinetClient()

# Search for Toyota
companies = client.search_companies("トヨタ")
print(companies[0].name, companies[0].edinet_code)
# トヨタ自動車株式会社 E02144

# Get financial statements as a Polars DataFrame
stmt = client.get_financial_statements("E02144", period="2024")
print(stmt.income_statement.to_polars())

MCP Server (for Claude Desktop)

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "edinet": {
      "command": "uvx",
      "args": ["edinet-mcp", "serve"],
      "env": {
        "EDINET_API_KEY": "your_key_here"
      }
    }
  }
}

Then ask Claude: "トヨタの最新の営業利益を教えて"

Available MCP Tools

Tool Description
search_companies 企業名・証券コード・EDINETコードで検索
get_filings 指定期間の開示書類一覧を取得
get_financial_statements 財務諸表 (BS/PL/CF) を構造化データで取得
get_company_info 企業の詳細情報を取得

CLI

# Search companies
edinet-mcp search トヨタ

# Fetch income statement
edinet-mcp statements -c E02144 -p 2024

# Start MCP server
edinet-mcp serve

API Reference

EdinetClient

client = EdinetClient(
    api_key="...",        # or EDINET_API_KEY env var
    cache_dir="~/.cache/edinet-mcp",
    rate_limit=0.5,       # requests per second
)

# Search
companies: list[Company] = client.search_companies("query")
company: Company = client.get_company("E02144")

# Filings
filings: list[Filing] = client.get_filings(
    start_date="2024-01-01",
    edinet_code="E02144",
    doc_type="annual_report",
)

# Financial statements
stmt: FinancialStatement = client.get_financial_statements(
    edinet_code="E02144",
    period="2024",
)
df = stmt.income_statement.to_polars()  # Polars DataFrame
df = stmt.income_statement.to_pandas()  # pandas DataFrame (optional dep)

StatementData

Each financial statement (BS, PL, CF) is a StatementData object:

stmt.balance_sheet.to_polars()    # → polars.DataFrame
stmt.balance_sheet.to_pandas()    # → pandas.DataFrame (requires pandas)
stmt.balance_sheet.to_dicts()     # → list[dict]
len(stmt.balance_sheet)           # number of line items

Development

git clone https://github.com/ajtgjmdjp/edinet-mcp
cd edinet-mcp
uv sync --dev
uv run pytest -v
uv run ruff check .
uv run mypy src/

Data Attribution

This project uses data from EDINET (Electronic Disclosure for Investors' NETwork), operated by the Financial Services Agency of Japan (金融庁). EDINET data is provided under the Public Data License 1.0.

Related Projects

  • edinet2dataset — Sakana AI's EDINET XBRL→JSON tool
  • EDINET-Bench — Financial classification benchmark
  • jfinqa — Japanese financial QA benchmark (companion project)

License

Apache-2.0. See NOTICE for third-party attributions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edinet_mcp-0.1.1.tar.gz (169.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edinet_mcp-0.1.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file edinet_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: edinet_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 169.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for edinet_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2befc83b7764a4f65a8b0a594c49f6070d0ad0690dadb5d452d25634bd97b1ba
MD5 1c1270f5bff8656eff5a7858cb17b5b8
BLAKE2b-256 d5673b1d49ef80f24c485de08fe0ba86c15eec4cc3a0d21c63b9ad6a865a2ae0

See more details on using hashes here.

File details

Details for the file edinet_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: edinet_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for edinet_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 043e71ce6236928894c3a16c3573dd067fd0df2096e4944c11e7099c4c427ea3
MD5 1b9a79333c1c3977a51c44d988861400
BLAKE2b-256 6772b9bdd6ecd435964fdf0e112ea2e515888061eeff192c9a24d72c08f0287d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page