README.mdโข10.8 kB
# Korea Stock MCP Server
[๐ฐ๐ท ํ๊ตญ์ด](#korea-stock-mcp-server) | [๐บ๐ธ English](#english-version)
ํ๊ตญ ์ฃผ์ ๋ถ์์ ์ํ MCP ์๋ฒ์
๋๋ค.
DART(์ ์๊ณต์์์คํ
)์ KRX(ํ๊ตญ๊ฑฐ๋์) ๊ณต์ API๋ฅผ ํตํด ์ฃผ๊ฐ ์ ๋ณด์ ๊ณต์ ์๋ฃ ๊ธฐ๋ฐ์ AI๋ถ์์ด ๊ฐ๋ฅํฉ๋๋ค.
## ๐ฏ ์ฃผ์ ๊ธฐ๋ฅ
- ๐ **๊ณต์๊ฒ์** - ํ์ฌ๋ณ, ๊ธฐ๊ฐ๋ณ ๊ณต์ ๊ฒ์
- ๐ **๊ณต์ ๋ฐ์ดํฐ** - ๊ณต์๋ณด๊ณ ์ ์๋ณธํ์ผ ํ์ฑํ ๋ฐ์ดํฐ ์ ๊ณต
- ๐ผ **์ฌ๋ฌด์ ํ ๋ถ์** - XBRL ๊ธฐ๋ฐ ์์ธ ์ฌ๋ฌด ๋ฐ์ดํฐ
- ๐ **์ฃผ์ ๋ฐ์ดํฐ** - KRX(์ฝ์คํผ/์ฝ์ค๋ฅ) ์ผ๋ณ ์ฃผ๊ฐ์ ๋ณด, ์ข
๋ชฉ ๊ธฐ๋ณธ์ ๋ณด
## โก ๋น ๋ฅธ ์์
### 1๏ธโฃ API KEY ๋ฐ๊ธ
๋จผ์ DART์ KRX์ API KEY๋ฅผ ๋ฐ๊ธ๋ฐ์์ผ ํฉ๋๋ค.
#### ๐ DART API KEY ๋ฐ๊ธ
1. **ํ์๊ฐ์
**: [OPEN DART](https://opendart.fss.or.kr) ํ์๊ฐ์
2. **ํค ์ ์ฒญ**: [์ธ์ฆํค ์ ์ฒญ ํ์ด์ง](https://opendart.fss.or.kr/uss/umt/EgovMberInsertView.do)์์ API KEY ์ ์ฒญ
3. **ํค ํ์ธ**: [์คํAPI ์ด์ฉํํฉ](https://opendart.fss.or.kr/mng/apiUsageStatusView.do)์์ ๋ฐ๊ธ๋ API KEY ํ์ธ
#### ๐ KRX API KEY ๋ฐ๊ธ
1. **ํ์๊ฐ์
**: [KRX OPEN API](https://openapi.krx.co.kr/contents/OPP/MAIN/main/index.cmd)์์ ํ์๊ฐ์
๋ฐ ๋ก๊ทธ์ธ
2. **ํค ์ ์ฒญ**: ๋ง์ดํ์ด์ง โ API ์ธ์ฆํค ์ ์ฒญ์์ ์ ์ฒญ
3. **์๋น์ค ์ ์ฒญ**: ์น์ธ ํ ์๋น์ค์ด์ฉ โ ์ฃผ์ ๋ฉ๋ด๋ก ์ด๋
4. **API ์ด์ฉ์ ์ฒญ**: ๋ค์ 6๊ฐ ํญ๋ชฉ์์ ๊ฐ๊ฐ "API ์ด์ฉ์ ์ฒญ" ํด๋ฆญ
- ์ ๊ฐ์ฆ๊ถ ์ผ๋ณ๋งค๋งค์ ๋ณด
- ์ฝ์ค๋ฅ ์ผ๋ณ๋งค๋งค์ ๋ณด
- ์ฝ๋ฅ์ค ์ผ๋ณ๋งค๋งค์ ๋ณด
- ์ ๊ฐ์ฆ๊ถ ์ข
๋ชฉ๊ธฐ๋ณธ์ ๋ณด
- ์ฝ์ค๋ฅ ์ข
๋ชฉ๊ธฐ๋ณธ์ ๋ณด
- ์ฝ๋ฅ์ค ์ข
๋ชฉ๊ธฐ๋ณธ์ ๋ณด
> โฑ๏ธ **์น์ธ๊น์ง ์ฝ 1์ผ ์์๋ฉ๋๋ค.**
5. **ํค ํ์ธ**: ์น์ธ ํ ๋ง์ดํ์ด์ง โ API ์ธ์ฆํค ๋ฐ๊ธ๋ด์ญ์์ API KEY ํ์ธ
### 2๏ธโฃ Claude Desktop ์ค์
1. **Claude Desktop** ์คํ
2. **์ค์ ** โ **๊ฐ๋ฐ์** โ **๊ตฌ์ฑํธ์ง** ํด๋ฆญ
3. `claude_desktop_config.json` ํ์ผ์ ๋ค์ ๋ด์ฉ ์ถ๊ฐ:
```json
{
"mcpServers": {
"korea-stock-mcp": {
"command": "npx",
"args": ["-y", "korea-stock-mcp@latest"],
"env": {
"DART_API_KEY": "<YOUR_DART_API_KEY>",
"KRX_API_KEY": "<YOUR_KRX_API_KEY>"
}
}
}
}
```
4. **์ฌ์์**: Claude Desktop์ ์ฌ์์ํ์ฌ ์ค์ ์ ์ฉ
> ์ด์ Claude์์ ํ๊ตญ ์ฃผ์ ๋ฐ์ดํฐ ๋ถ์์ ์์ํ ์ ์์ต๋๋ค.
## ์ฌ์ฉ ๊ฐ๋ฅํ ๋๊ตฌ
### DART (์ ์๊ณต์์์คํ
)
1. **get_disclosure_list** - ๊ณต์๊ฒ์
- ๊ณต์ ์ ํ๋ณ, ํ์ฌ๋ณ, ๋ ์ง๋ณ ๊ณต์๋ณด๊ณ ์ ๊ฒ์
2. **get_corp_code** - ๊ณ ์ ๋ฒํธ ์กฐํ
- DART ๋ฑ๋ก ๊ณต์๋์ํ์ฌ์ ๊ณ ์ ๋ฒํธ, ํ์ฌ๋ช
, ์ข
๋ชฉ์ฝ๋ ์ ๊ณต
3. **get_disclosure** - ๊ณต์๋ณด๊ณ ์ ์๋ฌธ
- DART API๋ฅผ ํตํ ๊ณต์๋ณด๊ณ ์ ์๋ณธํ์ผ ํ์ฑ
4. **get_financial_statement** - ์ฌ๋ฌด์ ํ
- ์์ฅ๋ฒ์ธ ๋ฐ ์ฃผ์ ๋น์์ฅ๋ฒ์ธ XBRL ์ฌ๋ฌด์ ํ
- ์ ๊ธฐ๋ณด๊ณ ์ ๋ด ๋ชจ๋ ๊ณ์ ๊ณผ๋ชฉ ๋ฐ์ดํฐ ์ ๊ณต
### KRX (ํ๊ตญ๊ฑฐ๋์)
1. **get_stock_base_info** - ์ข
๋ชฉ ๊ธฐ๋ณธ์ ๋ณด
- ์ฝ์คํผ, ์ฝ์ค๋ฅ, ์ฝ๋ฅ์ค ์์ฅ ์ข
๋ชฉ ๊ธฐ๋ณธ ์ ๋ณด
- ์ข
๋ชฉ๋ช
, ์ข
๋ชฉ์ฝ๋, ์์ฅ๊ตฌ๋ถ ๋ฑ ๊ธฐ๋ณธ ๋ฐ์ดํฐ
2. **get_stock_trade_info** - ์ผ๋ณ ๋งค๋งค์ ๋ณด
- ์ฝ์คํผ, ์ฝ์ค๋ฅ, ์ฝ๋ฅ์ค ์ข
๋ชฉ๋ณ ์ผ๋ณ ๊ฑฐ๋ ๋ฐ์ดํฐ
- ์ฃผ๊ฐ, ๊ฑฐ๋๋, ์๊ฐ์ด์ก ๋ฑ ์์ธ ๊ฑฐ๋ ์ ๋ณด
3. **get_market_type** - ์์ฅ๊ตฌ๋ถ ์กฐํ
- ์ข
๋ชฉ์ฝ๋๋ก ํด๋น ์ข
๋ชฉ์ ์์ฅ๊ตฌ๋ถ(์ฝ์คํผ/์ฝ์ค๋ฅ/์ฝ๋ฅ์ค) ์กฐํ
- ์ฃผ์ ๋ฐ์ดํฐ ์กฐํ ์ ํ์ํ ์์ฅ ์ ๋ณด ์ ๊ณต
### ๊ธฐํ ๋๊ตฌ
1. **get_today_date** - ์ค๋ ๋ ์ง ์กฐํ
- ํ์ฌ ๋ ์ง๋ฅผ YYYYMMDD ํ์์ผ๋ก ์ ๊ณต
- AI์ ์ ํํ ๋ ์ง ์กฐํ๋ฅผ ์ํ ๋๊ตฌ
## ์ค์ ์ฌ์ฉ ์์
### ๐ ์ฌ๋ฌด ๋ถ์ ์์
**ํ๋กฌํํธ**: "์ผ์์ํ์ 2023๋
, 2024๋
1~4๋ถ๊ธฐ, 2025๋
1,2๋ถ๊ธฐ ๋งค์ถ, ์์
์ด์ต ์กฐ์ฌํด์ฃผ๊ณ ์ฑ์ฅ๋ฅ ๋ ์กฐ์ฌํด์ค"
โ [์ผ์์ํ ๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ](./example/์ผ์์ํ.md)
**ํ๋กฌํํธ**: "์์ดํผ์์ 23๋
1๋ถ๊ธฐ๋ถํฐ 25๋
2๋ถ๊ธฐ๊น์ง์ ๋งค์ถ, ์์
์ด์ต ์ฑ์ฅ๊ณผ ์ฃผ๊ฐ, ์๊ฐ์ด์ก ํ๋ฆ์ ์กฐ์ฌํด์ค"
โ [์์ดํผ์ ๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ](./example/์์ดํผ์.md)
### ๐ข ๊ธฐ์
๋ถ์ ์์
**ํ๋กฌํํธ**: "HJ์ค๊ณต์
์ ๋ญ ํด์ ๋์ ๋ฒ๋ ํ์ฌ์ธ์ง๋ ์ฌ์
๋ถ๋ฌธ๋ณ ๋งค์ถ๊น์ง ๊ฐ์ด ์๋ ค์ค"
โ [HJ์ค๊ณต์
๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ](./example/HJ์ค๊ณต์
.md)
## API ๋ฐ์ดํฐ ์์ค
- **DART (์ ์๊ณต์์์คํ
)**: ์์ฅ๊ธฐ์
๊ณต์ ์ ๋ณด ๋ฐ ์ฌ๋ฌด์ ํ
- **KRX (ํ๊ตญ๊ฑฐ๋์)**: ์ข
๋ชฉ ๊ธฐ๋ณธ์ ๋ณด ๋ฐ ์ผ๋ณ ๋งค๋งค์ ๋ณด
## ๊ธฐ์ฌํ๊ธฐ
๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค! Pull Request๋ฅผ ๋ณด๋ด์ฃผ์ธ์.
1. ์ด ์ ์ฅ์๋ฅผ ํฌํฌํ์ธ์
2. ๊ธฐ๋ฅ ๋ธ๋์น๋ฅผ ๋ง๋์ธ์ (`git checkout -b feature/AmazingFeature`)
3. ๋ณ๊ฒฝ์ฌํญ์ ์ปค๋ฐํ์ธ์ (`git commit -m 'Add some AmazingFeature'`)
4. ๋ธ๋์น์ ํธ์ํ์ธ์ (`git push origin feature/AmazingFeature`)
5. Pull Request๋ฅผ ์ด์ด์ฃผ์ธ์
## ๋ผ์ด์ ์ค
ISC ๋ผ์ด์ ์ค
## ์ง์
- ๐ ์ด์๊ฐ ์๋ค๋ฉด GitHub Issues์ ๋ฑ๋กํด์ฃผ์ธ์
- โญ ์ ์ฉํ๋ค๋ฉด ์คํ๋ฅผ ๋๋ฌ์ฃผ์ธ์!
## ๋ฉด์ฑ
์กฐํญ
๋ณธ ๋๊ตฌ๋ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ์ด๋ฉฐ, ํฌ์ ์กฐ์ธ์ด ์๋๋๋ค. ๋ชจ๋ ํฌ์ ๊ฒฐ์ ์ ๋ณธ์ธ ์ฑ
์์
๋๋ค.
---
# English Version
MCP Server for Korean stock analysis.
Enables AI-powered analysis of stock prices and disclosure data through official APIs from DART (Data Analysis, Retrieval and Transfer System) and KRX (Korea Exchange).
## ๐ฏ Key Features
- ๐ **Disclosure Search** - Search corporate disclosures by company and date
- ๐ **Disclosure Data** - Provides parsed data from original disclosure reports
- ๐ผ **Financial Statement Analysis** - Detailed financial data based on XBRL
- ๐ **Stock Data** - KRX (KOSPI/KOSDAQ) daily stock prices and basic stock information
## โก Quick Start
### 1๏ธโฃ API KEY Registration
You need to obtain API KEYs from both DART and KRX.
#### ๐ DART API KEY Registration
1. **Sign Up**: Register at [OPEN DART](https://opendart.fss.or.kr)
2. **Request Key**: Apply for API KEY at [Authentication Key Application Page](https://opendart.fss.or.kr/uss/umt/EgovMberInsertView.do)
3. **Check Key**: Verify issued API KEY at [Open API Usage Status](https://opendart.fss.or.kr/mng/apiUsageStatusView.do)
#### ๐ KRX API KEY Registration
1. **Sign Up**: Register and login at [KRX OPEN API](https://openapi.krx.co.kr/contents/OPP/MAIN/main/index.cmd)
2. **Request Key**: Apply for API authentication key in My Page โ API Authentication Key Application
3. **Service Application**: After approval, go to Service Use โ Stock menu
4. **API Usage Application**: Click "API Usage Application" for each of the following 6 items
- Securities Daily Trading Information
- KOSDAQ Daily Trading Information
- KONEX Daily Trading Information
- Securities Basic Information
- KOSDAQ Basic Information
- KONEX Basic Information
> โฑ๏ธ **Approval takes approximately 1 day.**
5. **Key Verification**: After approval, check API KEY in My Page โ API Authentication Key Issuance History
### 2๏ธโฃ Claude Desktop Setup
1. Launch **Claude Desktop**
2. Go to **Settings** โ **Developer** โ **Edit Configuration**
3. Add the following content to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"korea-stock-mcp": {
"command": "npx",
"args": ["-y", "korea-stock-mcp@latest"],
"env": {
"DART_API_KEY": "<YOUR_DART_API_KEY>",
"KRX_API_KEY": "<YOUR_KRX_API_KEY>"
}
}
}
}
```
4. **Restart**: Restart Claude Desktop to apply settings
> You can now start analyzing Korean stock data with Claude.
## Available Tools
### DART (Data Analysis, Retrieval and Transfer System)
1. **get_disclosure_list** - Disclosure Search
- Search disclosure reports by type, company, and date
2. **get_corp_code** - Corporate Code Inquiry
- Provides unique codes, company names, and stock codes of DART-registered disclosure companies
3. **get_disclosure** - Disclosure Report Content
- Parse original disclosure report files through DART API
4. **get_financial_statement** - Financial Statements
- XBRL financial statements for listed and major unlisted companies
- Provides all account data from periodic reports
### KRX (Korea Exchange)
1. **get_stock_base_info** - Basic Stock Information
- Basic information for KOSPI, KOSDAQ, and KONEX listed stocks
- Basic data including stock names, codes, and market classifications
2. **get_stock_trade_info** - Daily Trading Information
- Daily trading data for KOSPI, KOSDAQ, and KONEX stocks
- Detailed trading information including stock prices, trading volume, and market capitalization
3. **get_market_type** - Market Type Inquiry
- Query market classification (KOSPI/KOSDAQ/KONEX) by stock code
- Provides market information needed for stock data queries
### Other Tools
1. **get_today_date** - Today's Date Inquiry
- Provides current date in YYYYMMDD format
- Tool for AI's accurate date inquiry
## Real Usage Examples
### ๐ Financial Analysis Examples
**Prompt**: "Investigate Samyang Foods's sales and operating profit for Q1-Q4 2023, Q1-Q4 2024, and Q1-Q2 2025, and also check growth rates"
โ [See Samyang Foods Analysis Results](./example/์ผ์์ํ.md)
**Prompt**: "Investigate APR's sales and operating profit growth from Q1 2023 to Q2 2025, along with stock price and market cap trends"
โ [See APR Analysis Results](./example/์์ดํผ์.md)
### ๐ข Corporate Analysis Examples
**Prompt**: "Tell me what HJ SHIPBUILDING & CONSTRUCTION does to make money and include sales by business segment"
โ [See HJ SHIPBUILDING & CONSTRUCTION Analysis Results](./example/HJ์ค๊ณต์
.md)
## API Data Sources
- **DART (Data Analysis, Retrieval and Transfer System)**: Listed company disclosure information and financial statements
- **KRX (Korea Exchange)**: Basic stock information and daily trading information
## Contributing
Contributions are welcome! Please send us a Pull Request.
1. Fork this repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## License
ISC License
## Support
- ๐ If you have issues, please register them in GitHub Issues
- โญ If you find it useful, please give it a star!
## Disclaimer
This tool is for informational purposes only and is not investment advice. All investment decisions are your own responsibility.