Metadata-Version: 2.4
Name: japanfinance-agent
Version: 0.1.2
Summary: Compound MCP agent combining 6 Japan finance data sources — EDINET, TDNET, e-Stat, BOJ, news, stock prices
Project-URL: Homepage, https://github.com/ajtgjmdjp/japanfinance-agent
Project-URL: Repository, https://github.com/ajtgjmdjp/japanfinance-agent
Project-URL: Issues, https://github.com/ajtgjmdjp/japanfinance-agent/issues
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agent,boj,edinet,estat,finance,financial-data,japan,mcp,stock,tdnet,xbrl
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: click>=8.0
Requires-Dist: fastmcp<3.0,>=2.0
Requires-Dist: httpx>=0.27
Requires-Dist: loguru>=0.7
Requires-Dist: pydantic>=2.0
Provides-Extra: all
Requires-Dist: boj-mcp>=0.1.0; extra == 'all'
Requires-Dist: edinet-mcp>=0.6.0; extra == 'all'
Requires-Dist: estat-mcp>=0.2.1; extra == 'all'
Requires-Dist: japan-news-mcp>=0.1.0; extra == 'all'
Requires-Dist: jquants-mcp>=0.1.0; extra == 'all'
Requires-Dist: tdnet-disclosure-mcp>=0.1.0; extra == 'all'
Provides-Extra: boj
Requires-Dist: boj-mcp>=0.1.0; extra == 'boj'
Provides-Extra: dev
Requires-Dist: boj-mcp>=0.1.0; extra == 'dev'
Requires-Dist: edinet-mcp>=0.6.0; extra == 'dev'
Requires-Dist: estat-mcp>=0.2.1; extra == 'dev'
Requires-Dist: japan-news-mcp>=0.1.0; extra == 'dev'
Requires-Dist: jquants-mcp>=0.1.0; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: tdnet-disclosure-mcp>=0.1.0; extra == 'dev'
Provides-Extra: edinet
Requires-Dist: edinet-mcp>=0.6.0; extra == 'edinet'
Provides-Extra: estat
Requires-Dist: estat-mcp>=0.2.1; extra == 'estat'
Provides-Extra: jquants
Requires-Dist: jquants-mcp>=0.1.0; extra == 'jquants'
Provides-Extra: news
Requires-Dist: japan-news-mcp>=0.1.0; extra == 'news'
Provides-Extra: tdnet
Requires-Dist: tdnet-disclosure-mcp>=0.1.0; extra == 'tdnet'
Description-Content-Type: text/markdown

# japanfinance-agent

[![CI](https://github.com/ajtgjmdjp/japanfinance-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/ajtgjmdjp/japanfinance-agent/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/japanfinance-agent.svg)](https://pypi.org/project/japanfinance-agent/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Compound [MCP](https://modelcontextprotocol.io/) agent that combines **6 Japan finance data sources** into high-value analysis tools. Instead of calling each source individually, get comprehensive company analysis, macro snapshots, and earnings monitoring in a single request.

Part of the [Japan Finance Data Stack](https://github.com/ajtgjmdjp/awesome-japan-finance-data): [edinet-mcp](https://github.com/ajtgjmdjp/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) | [japan-news-mcp](https://github.com/ajtgjmdjp/japan-news-mcp) (financial news) | [jquants-mcp](https://github.com/ajtgjmdjp/jquants-mcp) (stock prices)

## Why?

Each Japan finance MCP provides focused data from one source. But real analysis needs multiple sources combined:

| What you want | Without japanfinance-agent | With japanfinance-agent |
|---|---|---|
| Company analysis | 4 sequential MCP calls (EDINET → TDNET → news → stock) | `analyze 7203` |
| Macro overview | 3 sequential MCP calls (e-Stat → BOJ → news) | `macro -k GDP` |
| Earnings watchlist | N × TDNET calls for N companies | `monitor 7203 6758 6861` |

## Installation

```bash
# Core only (brings no data sources)
pip install japanfinance-agent

# With all data sources
pip install "japanfinance-agent[all]"

# Pick specific sources
pip install "japanfinance-agent[edinet,tdnet,news]"
```

Available extras: `edinet`, `tdnet`, `estat`, `boj`, `news`, `jquants`, `all`

## Configuration

Add to Claude Desktop config:

```json
{
  "mcpServers": {
    "japanfinance": {
      "command": "uvx",
      "args": ["japanfinance-agent[all]", "serve"],
      "env": {
        "EDINET_API_KEY": "your_edinet_key",
        "ESTAT_APP_ID": "your_estat_app_id"
      }
    }
  }
}
```

Then ask: "トヨタの財務分析をして" or "日本のGDP関連の最新データを見せて"

## MCP Tools

| Tool | Description |
|------|-------------|
| `analyze_japanese_company` | 企業の包括分析（EDINET財務 + TDNET開示 + ニュース + 株価） |
| `get_macro_snapshot` | マクロ経済スナップショット（e-Stat + BOJ + ニュース） |
| `monitor_earnings` | 複数企業の決算・開示モニタリング |
| `check_data_sources` | データソースの接続状況を確認 |

## CLI Usage

```bash
# Analyze a company (EDINET + TDNET + news + stock)
japanfinance-agent analyze 7203
japanfinance-agent analyze 7203 -e E02144 -p 2025 --json-output

# Macro economic snapshot (e-Stat + BOJ + news)
japanfinance-agent macro
japanfinance-agent macro -k CPI

# Monitor earnings for a watchlist
japanfinance-agent monitor 7203 6758 6861

# Check which data sources are available
japanfinance-agent test

# Start MCP server
japanfinance-agent serve
```

## Architecture

```
japanfinance-agent
├── analyze_company(code)     → EDINET + TDNET + news + stock (parallel)
├── macro_snapshot(keyword)   → e-Stat + BOJ + news (parallel)
├── earnings_monitor(codes[]) → TDNET × N companies (parallel)
└── check_data_sources()      → connectivity status

Adapters (graceful degradation — missing packages return empty results):
├── edinet-mcp    → Financial statements, metrics, company search
├── tdnet-mcp     → Timely disclosures (earnings, dividends, buybacks)
├── estat-mcp     → Government statistics (GDP, CPI, employment)
├── boj-mcp       → Bank of Japan data (rates, money supply)
├── japan-news-mcp → Financial news headlines
└── jquants-mcp   → Stock prices (OHLCV)
```

## Data Sources

| Source | Auth | Data |
|---|---|---|
| [EDINET](https://disclosure.edinet-fsa.go.jp/) | API key (free) | Securities filings, XBRL financial statements |
| [TDNET](https://www.release.tdnet.info/) | None | Timely disclosures (earnings, dividends) |
| [e-Stat](https://www.e-stat.go.jp/) | App ID (free) | Government statistics (GDP, CPI, employment) |
| [BOJ](https://www.stat-search.boj.or.jp/) | None | Central bank data (rates, money supply) |
| [News](https://news.yahoo.co.jp/categories/business) | None | RSS feeds (Yahoo, NHK, Reuters, Toyo Keizai) |
| [J-Quants](https://jpx-jquants.com/) | Email + Password | Stock prices, financials, earnings calendar |

## License

Apache-2.0
