
An MCP server that provides KOSPI/KOSDAQ stock data using FastMCP
An MCP server that provides KOSPI/KOSDAQ stock data using FastMCP
·
An MCP server that provides KOSPI/KOSDAQ stock data from KRX Data Marketplace.
Since December 27, 2024, KRX Data Marketplace requires Kakao/Naver login for data access. This version implements:
# Required: Kakao login credentials
KAKAO_ID=your_kakao_id
KAKAO_PW=your_kakao_passwordImportant: Your Kakao account must have 2-step verification (2FA) disabled. On first login, you may need to approve the login request via KakaoTalk.
# Install Playwright and Chromium browser
pip install playwright
playwright install chromiumnpx -y @smithery/cli install @dragon1086/kospi-kosdaq-stock-server --client claude# Create and activate a virtual environment
uv venv .venv
source .venv/bin/activate # On Unix/macOS
# .venv\Scripts\activate # On Windows
# Install the package
uv pip install kospi-kosdaq-stock-server
# Install Playwright browser
playwright install chromiumcode ~/Library/Application\ Support/Claude/claude_desktop_config.json{
"mcpServers": {
"kospi-kosdaq": {
"command": "uvx",
"args": ["kospi_kosdaq_stock_server"],
"env": {
"KAKAO_ID": "your_kakao_id",
"KAKAO_PW": "your_kakao_password"
}
}
}
}Open the config file at %APPDATA%/Claude/claude_desktop_config.json
Add the same configuration as above
Restart Claude Desktop
load_all_tickersLoads all ticker symbols and names for KOSPI and KOSDAQ.
get_stock_ohlcvRetrieves OHLCV (Open/High/Low/Close/Volume) data for a specific stock.
fromdate (string, required): Start date (YYYYMMDD)todate (string, required): End date (YYYYMMDD)ticker (string, required): Stock ticker symbol (e.g., "005930")adjusted (boolean, optional): Use adjusted prices (default: True)get_stock_market_capRetrieves market capitalization data for a specific stock.
fromdate (string, required): Start date (YYYYMMDD)todate (string, required): End date (YYYYMMDD)ticker (string, required): Stock ticker symbolget_stock_fundamentalRetrieves fundamental data (PER/PBR/Dividend Yield) for a specific stock.
fromdate (string, required): Start date (YYYYMMDD)todate (string, required): End date (YYYYMMDD)ticker (string, required): Stock ticker symbolget_stock_trading_volumeRetrieves trading volume by investor type for a specific stock.
fromdate (string, required): Start date (YYYYMMDD)todate (string, required): End date (YYYYMMDD)ticker (string, required): Stock ticker symboldetail (boolean, optional): If true, returns 12 investor types; if false (default), returns 5 aggregated typesget_index_ohlcvRetrieves OHLCV data for market indices.
fromdate (string, required): Start date (YYYYMMDD)todate (string, required): End date (YYYYMMDD)ticker (string, required): Index ticker (e.g., "1001" for KOSPI, "2001" for KOSDAQ)freq (string, optional): Frequency - "d" (daily), "m" (monthly), "y" (yearly). Default: "d"stock://tickersReturns all KOSPI/KOSDAQ ticker symbols and names.
stock://index-tickersReturns index ticker information:
stock://data-sourcesReturns current data source status.
# Build and run
docker-compose up -d
# View logs
docker-compose logs -fCreate a .env file:
KAKAO_ID=your_kakao_id
KAKAO_PW=your_kakao_passwordOn first login, Kakao may require approval via KakaoTalk:
headless=False to see the browserSession expires after ~4 hours. The server auto-renews, but if it fails:
~/.krx_session.json# Install required packages on Ubuntu/Debian
apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2┌─────────────────────────────────────────────────────┐
│ MCP Server (FastMCP) │
│ kospi_kosdaq_stock_server.py │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ KRXDataClient │
│ - get_market_ohlcv() │
│ - get_market_cap() │
│ - get_market_fundamental() │
│ - get_market_trading_volume_by_date() │
│ - get_index_ohlcv() │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ KakaoAuthManager │
│ - Playwright headless browser │
│ - Kakao OAuth login │
│ - Session cookie management │
│ - Auto re-login on session expiry (4h) │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ KRX Data Marketplace │
│ data.krx.co.kr │
└─────────────────────────────────────────────────────┘Human: Please load all available stock tickers.
Assistant: I'll load all KOSPI and KOSDAQ stock tickers.
> Using tool 'load_all_tickers'...
Successfully loaded 2,738 stock tickers.Human: Show me Samsung Electronics' stock data for December 2024.
Assistant: I'll retrieve Samsung Electronics' (005930) OHLCV data.
> Using tool 'get_stock_ohlcv'...
Date Open High Low Close Volume
2024-12-20 53,800 54,200 53,500 53,900 8,234,521
2024-12-19 54,000 54,300 53,700 53,800 7,123,456
...MIT License
Issues and pull requests are welcome!
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add kospi-kosdaq -- uvx kospi_kosdaq_stock_server{
"mcpServers": {
"kospi-kosdaq": {
"env": {
"KAKAO_ID": "",
"KAKAO_PW": ""
},
"args": [
"kospi_kosdaq_stock_server"
],
"command": "uvx"
}
}
}code --add-mcp '{"name":"kospi-kosdaq","env":{"KAKAO_ID":"","KAKAO_PW":""},"args":["kospi_kosdaq_stock_server"],"command":"uvx"}'[mcp_servers.kospi-kosdaq]
command = "uvx"
args = ["kospi_kosdaq_stock_server"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/kospi-kosdaq-stock-server to learn what the "Kospi Kosdaq Stock Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
npx -y @smithery/cli install @dragon1086/kospi-kosdaq-stock-server --client claudeuv pip install kospi-kosdaq-stock-serverThis server runs locally, so we can't read its tool list over the web yet.
We could not run this server: it ships no npx package for our sandbox and no public endpoint. The four checks that need a live server are left out, and the grade tops out at B until one exists.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/kospi-kosdaq-stock-server)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "kospi-kosdaq-stock-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.