Skip to main content
Glama

korea-stock-mcp

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.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jjlabsio/korea-stock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server