Token导航 LogoToken导航TokenDH.com
Edinet MCP logo
金融服务stdio官方级别未说明来源级核验

Edinet MCP

MCP Server

edinet-mcp是一个用于解析日本金融数据EDINET XBRL文件的库和MCP服务器,支持多种会计准则的标准化处理和财务数据比较。

工具数

9

提示词数

0

GitHub Stars

9

资源数

0
PythonClaude金融数据Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ajtgjmdjp

提供方

ajtgjmdjp

最后核验

2026/5/17 20:44

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install edinet-mcp

详细介绍

edinet mcp

日本金融数据的EDINET XBRL解析库和MCP服务器。

![PyPI](https://pypi.org/project/edinet-mcp/) ![Python](https://pypi.org/project/edinet-mcp/) ![CI](https://github.com/ajtgjmdjp/edinet-mcp/actions/workflows/ci.yml) ](https://pypi.org/project/edinet-mcp/) ![License](LICENSE) ![ClawHub](https://clawhub.com/skills/edinet-mcp)

📝 日语教程:只需问Claude就能知道上市公司的决算(Zenn)

这是什么?

edinet mcp 提供对日本的程序访问 埃迪内 财务披露制度。它将跨会计准则(J-GAAP/IFRS/US-GAAP)的XBRL文件标准化为规范的日本标签,并将其作为 主控程序 用于AI助手的服务器。

  • 搜索5000多家日本上市公司
  • Retrieve annual/quarterly financial reports(有似证券报告书,四半期报告书)
  • 自动标准化: stmt["売上高"] 不按会计准则办事
  • 财务指标(ROE、ROA、利润率)和同比比较
  • 将XBRL解析为Polars/pandas数据帧(BS、PL、CF)
  • 多公司筛选:比较多达20家公司的财务指标
  • 跨周期差异(xbrl差异):将不同时期的财务报表与变化金额和增长率进行比较
  • MCP服务器,配备9个克劳德桌面工具和其他人工智能工具

快速开始

安装

pip install edinet-mcp
# or
uv add edinet-mcp
# or with Docker
docker run -e EDINET_API_KEY=your_key ghcr.io/ajtgjmdjp/edinet-mcp serve

获取API密钥

注册(免费) 埃迪内 并设置:

export EDINET_API_KEY=your_key_here

30秒示例

import asyncio
from edinet_mcp import EdinetClient

async def main():
    async with EdinetClient() as client:
        # Search for Toyota
        companies = await client.search_companies("トヨタ")
        print(companies[0].name, companies[0].edinet_code)
        # トヨタ自動車株式会社 E02144

        # Get normalized financial statements
        stmt = await client.get_financial_statements("E02144", period="2025")

        # Dict-like access — works for J-GAAP, IFRS, and US-GAAP
        revenue = stmt.income_statement["売上高"]
        print(revenue)  # {"当期": 45095325000000, "前期": 37154298000000}

        # See all available line items
        print(stmt.income_statement.labels)
        # ["売上高", "売上原価", "売上総利益", "営業利益", ...]

        # Export as DataFrame
        print(stmt.income_statement.to_polars())

asyncio.run(main())

财务指标

import asyncio
from edinet_mcp import EdinetClient, calculate_metrics

async def main():
    async with EdinetClient() as client:
        stmt = await client.get_financial_statements("E02144", period="2025")
        metrics = calculate_metrics(stmt)
        print(metrics["profitability"])
        # {"売上総利益率": "25.30%", "営業利益率": "11.87%", "ROE": "12.50%", ...}

asyncio.run(main())

多公司筛选

import asyncio
from edinet_mcp import EdinetClient, screen_companies

async def main():
    async with EdinetClient() as client:
        result = await screen_companies(
            client,
            ["E02144", "E01777", "E01967"],  # Toyota, Sony, Keyence
            period="2025",
            sort_by="営業利益率",  # Sort by operating margin
        )
        for r in result["results"]:
            print(f"{r['company_name']}: {r['profitability']['営業利益率']}")
        # 株式会社キーエンス: 51.91%
        # ソニーグループ株式会社: 11.69%
        # トヨタ自動車株式会社: 9.98%

asyncio.run(main())

跨期差异

import asyncio
from edinet_mcp import EdinetClient, diff_statements

async def main():
    async with EdinetClient() as client:
        result = await diff_statements(
            client, "E02144",
            period1="2024", period2="2025",
        )
        for d in result["diffs"][:5]:
            print(f"{d['科目']}: {d['増減額']:+,.0f} ({d['増減率']})")
        # 売上高: +7,941,027,000,000 (+21.38%)
        # 営業利益: +1,204,832,000,000 (+28.44%)
        # ...

asyncio.run(main())

MCP服务器

添加到AI工具的MCP配置中:

Claude Desktop (~⁠/Library/Application Support/Claude/claude_desktop_config.json)

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

Cursor (~⁠/.cursor/mcp.json)

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

Claude Code

claude mcp add edinet -- uvx edinet-mcp serve
# Then set EDINET_API_KEY in your environment

Then ask your AI:“告诉我丰田最新的营业利润”

可用的MCP工具

工具说明
search_companies 用企业名、证券代码、EDINET代码搜索
get_filings指定期间の开示书类一覧を取得
get_financial_statements 获取标准化财务报表(BS/PR/CF)
get_financial_metricsROE・ROA・利益率等の财务指标を计算
compare_financial_periods前年比较(增减額・增减率)
screen_companies复数企业の财务指标を一括比较(最大20社)
list_available_labels |可获得的财务科目一览|
get_company_info 获取企业详细信息
diff_financial_statements2期间の财务诸表を比较(增减額・增减率)
备注:The period 参数是 申请年份不是财政年度。3月财政年度末的日本公司在次年6月提交年度报告(例如2024财年→ 2025年提交→ period="2025").

命令行界面

# Search companies
edinet-mcp search トヨタ

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

# Screen multiple companies
edinet-mcp screen E02144 E01777 E02529 --sort-by ROE

# Compare across periods (xbrl-diff)
edinet-mcp diff -c E02144 -p1 2023 -p2 2024

# Start MCP server
edinet-mcp serve

API 参考

EdinetClient

所有客户端方法都是异步的。使用 async with 为了进行适当的资源清理:

import asyncio
from edinet_mcp import EdinetClient

async def main():
    async with EdinetClient(
        api_key="...",        # or EDINET_API_KEY env var
        cache_dir="~/.cache/edinet-mcp",
        rate_limit=0.5,       # requests per second
        max_retries=3,        # retry on 429/5xx with exponential backoff
    ) as client:
        # Search
        companies: list[Company] = await client.search_companies("query")
        company: Company = await client.get_company("E02144")

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

        # Financial statements (by edinet_code + period)
        stmt: FinancialStatement = await client.get_financial_statements(
            edinet_code="E02144",
            period="2024",  # Filing year (not fiscal year)
        )

        # Or get the most recent filing (within past 365 days)
        stmt = await client.get_financial_statements(edinet_code="E02144")

        df = stmt.income_statement.to_polars()  # Polars DataFrame
        df = stmt.income_statement.to_pandas()  # pandas DataFrame (optional dep)

asyncio.run(main())

Filing

退回的归档对象 get_filings() 具有以下属性:

for filing in filings:
    print(filing.description)    # "有価証券報告書-第121期(...)"
    print(filing.filing_date)    # datetime.date(2025, 6, 18)
    print(filing.doc_id)         # "S100VWVY"
    print(filing.company_name)   # "トヨタ自動車株式会社"
    print(filing.period_start)   # datetime.date(2024, 4, 1)
    print(filing.period_end)     # datetime.date(2025, 3, 31)

StatementData

每份财务报表(BS、PL、CF)都是 StatementData 具有类似dict访问权限的对象:

# Dict-like access by Japanese label
stmt.income_statement["売上高"]       # → {"当期": 45095325, "前期": 37154298}
stmt.income_statement.get("営業利益") # → {"当期": 5352934} or None
stmt.income_statement.labels          # → ["売上高", "営業利益", ...]

# DataFrame export
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

# Raw XBRL data preserved
stmt.income_statement.raw_items   # original pre-normalization data

归一化

edinet-mcp自动规范跨会计准则的XBRL元素名称:

会计准则XBRL元素标准化标签
J-GAAPNetSales売上高
IFRSRevenue, SalesRevenuesIFRS売上高
US-GAAPRevenues売上高

映射在中定义 taxonomy.yaml --161个项目涵盖PL(42)、BS(79)和CF(40),IFRS/US-GAAP要素变体通过后缀剥离自动解析。通过编辑YAML文件添加新的映射,无需更改代码。

from edinet_mcp import get_taxonomy_labels

# Discover available labels
labels = get_taxonomy_labels("income_statement")
# [{"id": "revenue", "label": "売上高", "label_en": "Revenue"}, ...]

EDINET后缀剥离

EDINET在XBRL元素名称后附加会计标准和特定章节的后缀(例如。, TotalAssetsIFRSSummaryOfBusinessResults).这些会被自动剥离以匹配规范分类条目。非合并上下文被过滤掉,以首选合并数字。

建筑

EDINET API → Parser (XBRL/TSV) → Normalizer (taxonomy.yaml) → MCP Server
                                        ↓
                              StatementData["売上高"]
                              calculate_metrics(stmt)
                              compare_periods(stmt)

发展

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

数据归因

此项目使用以下数据 埃迪内 (投资者网络电子披露),由 Financial Services Agency of Japan (金融庁). EDINET数据根据 公共数据许可证1.0.

相关项目

日本金融数据栈 (同一作者):

社区:

许可证

阿帕奇-2.0。看 通知 第三方归因。

目录标签

目录标签

PythonClaude金融数据XBRL解析本地部署金融数据分析日本财务数据MCP服务器会计准则标准化

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP