MCP server for korea stock
๐ฐ๐ท ํ๊ตญ์ด | ๐บ๐ธ English
ํ๊ตญ ์ฃผ์ ๋ถ์์ ์ํ MCP ์๋ฒ์
๋๋ค.
DART(์ ์๊ณต์์์คํ
)์ KRX(ํ๊ตญ๊ฑฐ๋์) ๊ณต์ API๋ฅผ ํตํด ์ฃผ๊ฐ ์ ๋ณด์ ๊ณต์ ์๋ฃ ๊ธฐ๋ฐ์ AI๋ถ์์ด ๊ฐ๋ฅํฉ๋๋ค.
๐ฌ ๊ฐ์ ์์ฒญ & ํผ๋๋ฐฑ ํ์ํฉ๋๋ค! ์ฌ์ฉํ๋ฉด์ ๋ถํธํ ์ ์ด๋ ๊ฐ์ ์์ด๋์ด๊ฐ ์์ผ์๋ฉด ํธํ๊ฒ ์ด๋ฉ์ผ ์ฃผ์ธ์. ๋น ๋ฅด๊ฒ ํ์ธํ๊ณ ๋ฐ์ํ๊ฒ ์ต๋๋ค. ๐ง wowlxx28@gmail.com
๋จผ์ DART์ KRX์ API KEY๋ฅผ ๋ฐ๊ธ๋ฐ์์ผ ํฉ๋๋ค.
ํ์๊ฐ์ : KRX OPEN API์์ ํ์๊ฐ์ ๋ฐ ๋ก๊ทธ์ธ
ํค ์ ์ฒญ: ๋ง์ดํ์ด์ง โ API ์ธ์ฆํค ์ ์ฒญ์์ ์ ์ฒญ
์๋น์ค ์ ์ฒญ: ์น์ธ ํ ์๋น์ค์ด์ฉ โ ์ฃผ์ ๋ฉ๋ด๋ก ์ด๋
API ์ด์ฉ์ ์ฒญ: ๋ค์ 6๊ฐ ํญ๋ชฉ์์ ๊ฐ๊ฐ "API ์ด์ฉ์ ์ฒญ" ํด๋ฆญ
โฑ๏ธ ์น์ธ๊น์ง ์ฝ 1์ผ ์์๋ฉ๋๋ค.
ํค ํ์ธ: ์น์ธ ํ ๋ง์ดํ์ด์ง โ API ์ธ์ฆํค ๋ฐ๊ธ๋ด์ญ์์ API KEY ํ์ธ
claude_desktop_config.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>"
}
}
}
}
์ด์ Claude์์ ํ๊ตญ ์ฃผ์ ๋ฐ์ดํฐ ๋ถ์์ ์์ํ ์ ์์ต๋๋ค.
์ผ๋ถ ๊ณต์๋ณด๊ณ ์(์ฌ์ ๋ณด๊ณ ์, ๋ถ๊ธฐ๋ณด๊ณ ์ ๋ฑ)๋ ์ MB์ ๋ฌํ๋ ๋์ฉ๋ XML ๋ฌธ์์ ๋๋ค. ์ด๋ฐ ๋ฌธ์๋ฅผ ํ ๋ฒ์ ๋ชจ๋ ์ฒ๋ฆฌํ๋ฉด AI ์๋ต ํ๋๋ฅผ ์ด๊ณผํ๊ฑฐ๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
๋ฌธ์ ํฌ๊ธฐ์ ๋ฐ๋ผ ์๋์ผ๋ก ์ฒ๋ฆฌ ๋ฐฉ์์ด ๋ฌ๋ผ์ง๋๋ค.
๋ณ๋๋ก ์กฐ์ํ ํ์๊ฐ ์์ต๋๋ค. Claude๊ฐ ๋์ฉ๋ ๋ฌธ์๋ฅผ ์๋์ผ๋ก ์ฒ๋ฆฌํฉ๋๋ค.
๋ฌธ์๊ฐ ํฌ๋ฉด Claude๊ฐ ์๋์ผ๋ก ๋ค์๊ณผ ๊ฐ์ด ๋์ํฉ๋๋ค:
์์:
ํ ๋ฒ์ ์ํ๋ ๋ต์ ์ป์ง ๋ชปํ ๋๋, ์ง๋ฌธ์ ์ฌ๋ฌ ๋จ๊ณ๋ก ๋๋๋ฉด ๋ ์ ํํ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, "์ธ๋ฒคํ ๋ผ์ ์ฆ๊ถ์ ๊ณ ์์์ ์ธ๊ตญ์ธ ๋ฐฐ์ ๋ด์ญ ์๋ ค์ค"๊ฐ ํ ๋ฒ์ ์ ๋๋ค๋ฉด:
์ด๋ ๊ฒ ๋จ๊ณ๋ณ๋ก ์งํํ๋ฉด ๊ฐ ๋จ๊ณ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ฉด์ ์ํ๋ ์ ๋ณด์ ๋๋ฌํ ์ ์์ต๋๋ค.
get_disclosure_list - ๊ณต์๊ฒ์
get_corp_code - ๊ณ ์ ๋ฒํธ ์กฐํ
corp_name) ๋๋ ์ข
๋ชฉ์ฝ๋(stock_code) ์ค ํ๋๋ก ์กฐํ ๊ฐ๋ฅget_disclosure - ๊ณต์๋ณด๊ณ ์ ์๋ฌธ
section_id๋ก ํน์ ์น์
์กฐํ ๊ฐ๋ฅget_financial_statement - ์ฌ๋ฌด์ ํ
get_stock_base_info - ์ข ๋ชฉ ๊ธฐ๋ณธ์ ๋ณด
get_stock_trade_info - ์ผ๋ณ ๋งค๋งค์ ๋ณด
get_market_type - ์์ฅ๊ตฌ๋ถ ์กฐํ
ํ๋กฌํํธ: "์ผ์์ํ์ 2023๋
, 2024๋
1~4๋ถ๊ธฐ, 2025๋
1,2๋ถ๊ธฐ ๋งค์ถ, ์์
์ด์ต ์กฐ์ฌํด์ฃผ๊ณ ์ฑ์ฅ๋ฅ ๋ ์กฐ์ฌํด์ค"
โ ์ผ์์ํ ๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ
ํ๋กฌํํธ: "์์ดํผ์์ 23๋
1๋ถ๊ธฐ๋ถํฐ 25๋
2๋ถ๊ธฐ๊น์ง์ ๋งค์ถ, ์์
์ด์ต ์ฑ์ฅ๊ณผ ์ฃผ๊ฐ, ์๊ฐ์ด์ก ํ๋ฆ์ ์กฐ์ฌํด์ค"
โ ์์ดํผ์ ๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ
ํ๋กฌํํธ: "HJ์ค๊ณต์
์ ๋ญ ํด์ ๋์ ๋ฒ๋ ํ์ฌ์ธ์ง๋ ์ฌ์
๋ถ๋ฌธ๋ณ ๋งค์ถ๊น์ง ๊ฐ์ด ์๋ ค์ค"
โ HJ์ค๊ณต์
๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ
ํ๋กฌํํธ: "Get the foreign allocation details for an IPO (e.g., Inventera / 0007J0)" โ ์ธ๋ฒคํ ๋ผ IPO ์ธ๊ตญ์ธ ๋ฐฐ์ ๋ถ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ
์์ค๋ฅผ ์์ ํ๋ฉด์ ๋ฐ๋ก ํ ์คํธํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
npm install
ํ๋ก์ ํธ ๋ฃจํธ์ .env ํ์ผ์ ์์ฑํฉ๋๋ค:
DART_API_KEY=your_dart_api_key
KRX_API_KEY=your_krx_api_key
npm run inspect
ํฐ๋ฏธ๋์ ์ถ๋ ฅ๋๋ ์ฃผ์(http://localhost:6274 ๋ฑ)๋ฅผ ๋ธ๋ผ์ฐ์ ์์ ์ด๋ฉด MCP Inspector UI๊ฐ ์ด๋ฆฝ๋๋ค.
Inspector์์ Connect ๋ฒํผ์ ํด๋ฆญํ ํ, ์ข์ธก ํด ๋ชฉ๋ก์์ ์ํ๋ ํด์ ์ ํํด ์ง์ ํธ์ถํ ์ ์์ต๋๋ค.
src/ ํ์ผ์ ์์ ํ๊ณ ์ ์ฅํ๋ฉด ์๋ฒ๊ฐ ์๋์ผ๋ก ์ฌ์์๋ฉ๋๋ค.
Inspector์์ Reconnect ๋ฒํผ์ ํด๋ฆญํ๋ฉด ๋ณ๊ฒฝ์ฌํญ์ด ์ฆ์ ๋ฐ์๋ฉ๋๋ค.
์ฐธ๊ณ : Node.js 18 ์ด์์ด ํ์ํฉ๋๋ค.
๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค! Pull Request๋ฅผ ๋ณด๋ด์ฃผ์ธ์.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)ISC ๋ผ์ด์ ์ค
๋ณธ ๋๊ตฌ๋ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ์ด๋ฉฐ, ํฌ์ ์กฐ์ธ์ด ์๋๋๋ค. ๋ชจ๋ ํฌ์ ๊ฒฐ์ ์ ๋ณธ์ธ ์ฑ ์์ ๋๋ค.
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).
๐ฌ Feedback & Feature Requests Welcome! If you have any ideas for improvement or issues while using this tool, feel free to email me. I'll review and address them as quickly as possible. ๐ง wowlxx28@gmail.com
You need to obtain API KEYs from both DART and KRX.
Sign Up: Register and login at KRX OPEN API
Request Key: Apply for API authentication key in My Page โ API Authentication Key Application
Service Application: After approval, go to Service Use โ Stock menu
API Usage Application: Click "API Usage Application" for each of the following 6 items
โฑ๏ธ Approval takes approximately 1 day.
Key Verification: After approval, check API KEY in My Page โ API Authentication Key Issuance History
claude_desktop_config.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>"
}
}
}
}
You can now start analyzing Korean stock data with Claude.
Some disclosure reports (annual reports, quarterly reports, etc.) are large XML documents of several MB. Processing such documents all at once can exceed AI response limits or cause errors.
The processing method changes automatically depending on document size.
No manual action required. Claude handles large documents automatically.
When a document is large, Claude automatically:
Examples:
If you can't get the answer you want in one shot, try breaking your question into smaller steps for more accurate results.
For example, instead of "Show me the foreign investor allocation details from Inventera's securities registration statement", try:
This way, you can verify each step's output and guide Claude toward the exact information you need.
get_disclosure_list - Disclosure Search
get_corp_code - Corporate Code Inquiry
corp_name) or stock code (stock_code)get_disclosure - Disclosure Report Content
section_id to fetch a specific sectionget_financial_statement - Financial Statements
get_stock_base_info - Basic Stock Information
get_stock_trade_info - Daily Trading Information
get_market_type - Market Type Inquiry
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
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
Prompt: "Tell me what HJ SHIPBUILDING & CONSTRUCTION does to make money and include sales by business segment" โ See HJ Shipbuilding & Construction Analysis Results
Prompt: "Get the foreign allocation details for an IPO (e.g., Inventera / 0007J0)" โ See Inventera IPO Foreign Allocation Analysis Results
How to test while modifying the source code.
npm install
Create a .env file in the project root:
DART_API_KEY=your_dart_api_key
KRX_API_KEY=your_krx_api_key
npm run inspect
Open the URL printed in the terminal (e.g. http://localhost:6274) in your browser to open the MCP Inspector UI.
Click Connect in the Inspector, then select any tool from the left panel to call it directly.
When you save a file under src/, the server restarts automatically.
Click Reconnect in the Inspector to pick up the changes immediately.
Note: Node.js 18 or higher is required.
Contributions are welcome! Please send us a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)ISC License
This tool is for informational purposes only and is not investment advice. All investment decisions are your own responsibility.
Source-derived launch command. Check the maintainerโs required arguments and credentials before running:
npx -y korea-stock-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-jjlabsio-korea-stock-mcp": {
"command": "npx",
"args": [
"-y",
"korea-stock-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientโs tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.jjlabsio/korea-stock-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.