Metadata-Version: 2.4
Name: kessan-mcp
Version: 0.0.1
Summary: MCP server for Kessan — Japan corporate disclosure data via EDINET + IR PDFs
Project-URL: Homepage, https://kessan.io
Project-URL: Documentation, https://kessan.io
Author-email: Kessan Maintainer <admin@kessan.io>
License: MIT
License-File: LICENSE
Keywords: ai-agent,claude,edinet,financial-data,japan,mcp,xbrl
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: anyio>=4.0
Requires-Dist: kessan>=0.0.1
Requires-Dist: mcp>=1.0
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# kessan-mcp

MCP (Model Context Protocol) server for Kessan — Japan corporate disclosure data
(EDINET regulatory filings + company IR PDFs) via a structured English-canonical API.

Lets Claude Desktop, Cursor, Cline, and any MCP-compatible client query Japanese
financial disclosures natively.

## Install

```bash
pip install -e .
```

Or once published:

```bash
pip install kessan-mcp
```

## Claude Desktop config

Add to `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or
`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):

```json
{
  "mcpServers": {
    "kessan": {
      "command": "kessan-mcp",
      "env": {
        "KESSAN_DB_PATH": "/path/to/edinet.duckdb"
      }
    }
  }
}
```

Restart Claude Desktop. You can then ask things like:
- "Show me Toyota's annual financials for the last 5 years"
- "What filings did Sony submit in 2024?"
- "List all companies in the automotive industry"

## Tools

### 1. `search_companies(query, limit=10)`

Search for Japanese listed companies by name (JP/EN), EDINET code, or ticker.

```
query: str   — "Toyota", "トヨタ", "E02144", "7203"
limit: int   — max results (1–100, default 10)
```

### 2. `get_company_filings(edinet_code, fiscal_year=None, doc_type_code=None, limit=50, lang="en")`

List disclosure filings for a company.

```
edinet_code:   str        — EDINET issuer code, e.g. "E02144"
fiscal_year:   int|None   — filter by year, e.g. 2024
doc_type_code: str|None   — "120"=Annual Report, "160"=Semi-Annual, "130"=Amendment
limit:         int        — max results (1–500, default 50)
lang:          "ja"|"en"  — "en" adds doc_type_name_en / doc_type_name_ja fields
```

### 3. `get_company_financials(edinet_code, period_type=None, source_types=None, lang="en")`

Return financial rows (EDINET XBRL + IR PDF combined).

```
edinet_code:  str         — EDINET issuer code, e.g. "E02144"
period_type:  str|None    — "annual", "FY", "Q1", "Q2", "Q3", "Q4", "semi_annual"
source_types: list|None   — ["edinet"], ["ir_pdf"], or ["edinet","ir_pdf"] (default)
lang:         "ja"|"en"   — "en" adds period_type_en field
```

### 4. `translate_concept(concept_code)`

Translate an XBRL financial concept element local-name to English.

```
concept_code: str   — e.g. "NetSales", "OperatingIncome", "jpcrp_cor:NetSales"
```

Returns `{concept, en, en_short, ja, unit, statement}` or null if unknown.

### 5. `list_industry_codes(lang="en")`

List all TSE 33-industry classification codes with English and Japanese names.

```
lang: "ja"|"en"   — primary label language (default "en")
```

## Import path

```python
from mcp.server.fastmcp import FastMCP   # FastMCP decorator pattern
from kessan_mcp.server import mcp        # the server instance
```
