kospi-kosdaq-stock-server
by: dragon1086
An MCP server that provides KOSPI/KOSDAQ stock data using FastMCP
📌Overview
Purpose: To provide users with comprehensive access to KOSPI and KOSDAQ stock data through a seamless server interface using FastMCP.
Overview: The KOSPI/KOSDAQ Stock Server is a specialized MCP server that delivers real-time stock information, including various financial metrics and historical data. It enables users to easily retrieve stock-related insights for thorough analysis and decision-making.
Key Features:
-
Ticker Lookup: Allows users to search for KOSPI and KOSDAQ ticker symbols and their corresponding names, facilitating quick identification of stocks.
-
OHLCV Data Retrieval: Provides Open/High/Low/Close/Volume data for specific stocks over a designated timeframe, essential for tracking price movements and trading activities.
-
Market Capitalization Data: Delivers current market capitalization figures for individual stocks, helping users assess company size and market presence.
-
Fundamental Data Access: Offers fundamental financial metrics, such as Price-to-Earnings Ratio (PER), Price-to-Book Ratio (PBR), and Dividend Yield, crucial for investment evaluations.
-
Investor Type Trading Volume Data: Retrieves detailed information on trading volume categorized by investor types, granting a better understanding of market dynamics and investor behavior.
kospi-kosdaq-stock-server
An MCP server that provides KOSPI/KOSDAQ stock data using FastMCP.
Features
- Lookup KOSPI/KOSDAQ ticker symbols and names
- Retrieve OHLCV data for a specific stock
- Retrieve market capitalization data for a specific stock
- Retrieve fundamental data (PER/PBR/Dividend Yield) for a specific stock
- Retrieve trading volume by investor type for a specific stock
Available Tools
-
load_all_tickers
Loads all ticker symbols and names for KOSPI and KOSDAQ into memory.- No arguments.
-
get_stock_ohlcv
Retrieves OHLCV (Open/High/Low/Close/Volume) data for a specific stock.fromdate
(string, required): Start date for retrieval (YYYYMMDD)todate
(string, required): End date for retrieval (YYYYMMDD)ticker
(string, required): Stock ticker symboladjusted
(boolean, optional): Whether to use adjusted prices (True: adjusted, False: unadjusted). Defaults to True.
-
get_stock_market_cap
Retrieves market capitalization data for a specific stock.fromdate
(string, required): Start date for retrieval (YYYYMMDD)todate
(string, required): End date for retrieval (YYYYMMDD)ticker
(string, required): Stock ticker symbol
-
get_stock_fundamental
Retrieves fundamental data (PER/PBR/Dividend Yield) for a specific stock.fromdate
(string, required): Start date for retrieval (YYYYMMDD)todate
(string, required): End date for retrieval (YYYYMMDD)ticker
(string, required): Stock ticker symbol
-
get_stock_trading_volume
Retrieves trading volume by investor type for a specific stock.fromdate
(string, required): Start date for retrieval (YYYYMMDD)todate
(string, required): End date for retrieval (YYYYMMDD)ticker
(string, required): Stock ticker symbol
Installation
This package requires uv for installation and execution.
Installing via Smithery
To install KOSPI/KOSDAQ Stock Data Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @dragon1086/kospi-kosdaq-stock-server --client claude
Manual Installation
# 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
Configuration for Claude.app
After installing the package, configure the MCP server in your claude_desktop_config.json
file.
-
Locate the configuration file:
- On macOS:
/Users/username/Library/Application Support/Claude/claude_desktop_config.json
- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
- On macOS:
-
Add the server configuration:
Open the file and add a new entry to themcpServers
object:
{
"mcpServers": {
"kospi-kosdaq": {
"command": "uvx",
"args": ["kospi_kosdaq_stock_server"]
}
}
}
- command: Use
uvx
to take advantage of uv's isolation and dependency management - args: Only the package name is needed since the entry point is defined in the package
- No additional environment variables are required
- Restart Claude: After saving the changes, restart Claude for the changes to take effect.
Usage Example
After configuring the server, use it in Claude like this:
- Load all available stock tickers:
Human: Please load all available stock tickers.
Assistant: I'll help you load all KOSPI and KOSDAQ stock tickers.
> Using tool 'load_all_tickers'...
Successfully loaded 2,873 stock tickers.
- Get OHLCV data for a specific stock:
Human: Show me Samsung Electronics' stock data for the last month.
Assistant: I'll retrieve Samsung Electronics' (005930) OHLCV data for the last month.
> Using tool 'get_stock_ohlcv'...
Date Open High Low Close Volume
2024-02-14 73,800 74,000 73,400 73,700 7,823,124
2024-02-13 73,600 74,200 73,200 73,800 8,943,217
...