Skip to main content

KOSPI/KOSDAQ Stock Data MCP Server

Project description

Add to Cursor Add to VS Code Add to Claude Add to ChatGPT Add to Codex Add to Gemini

MseeP.ai Security Assessment Badge

kospi-kosdaq-stock-server

PyPI version smithery badge

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 symbol
    • adjusted (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, you need to configure the MCP server in your claude_desktop_config.json file.

  1. Locate the configuration file:

    • On macOS, the file is typically located at: /Users/username/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows, the file is typically located at: %APPDATA%/Claude/claude_desktop_config.json
  2. Add the server configuration: Open the claude_desktop_config.json file and add a new entry to the mcpServers object:

{
    "mcpServers": {
        "kospi-kosdaq": {
            "command": "uvx",
            "args": ["kospi_kosdaq_stock_server"]
        }
    }
}

Configuration Details:

  • 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
  1. Restart Claude: After saving the changes to claude_desktop_config.json, restart Claude for the changes to take effect.

Usage Example

After configuring the server, you can use it in Claude like this:

  1. First, 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.
  1. 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
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kospi_kosdaq_stock_server_fastmcp-0.2.3.tar.gz (68.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file kospi_kosdaq_stock_server_fastmcp-0.2.3.tar.gz.

File metadata

File hashes

Hashes for kospi_kosdaq_stock_server_fastmcp-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6e1eb4ea07cfc374bcc17086952f2031de4cb97b6d1379285bc70bb5eb65bb06
MD5 733fc43f9eebbd995f45be101a273838
BLAKE2b-256 5bdb7878841cf9782f60d052f2e879141046d1bc68635925bb9060a10f52caa1

See more details on using hashes here.

File details

Details for the file kospi_kosdaq_stock_server_fastmcp-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for kospi_kosdaq_stock_server_fastmcp-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ecb8ff0072b5caebdf16ffce69873b43732295cf2af090a16594a43a98b5a37
MD5 9a3e3881b354e9db9303bc4056ff7ba2
BLAKE2b-256 714446ece3736f6da7e767c0c6821d48f7d9046fff6eae7e6f499ef3fba98b3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page