Skip to main content
Glama

KIS REST API MCP Server

Korea Investment & Securities REST API MCP (Model Context Protocol)

Python 3.13+ License: MIT

This is an MCP (Model Context Protocol) server that uses the REST API of Korea Investment & Securities (KIS) to search for stock trading and price information. It provides various financial transaction functions such as domestic and overseas stock trading, price search, and account management.

✨ Key Features

  • 🇰🇷 Domestic stock trading

    • Real-time current price inquiry

    • Buy/Sell Order

    • Check balance

    • View household information

    • Check order history

  • 🌏 Foreign stock trading

    • Support for major markets including the US, Japan, China, Hong Kong, and Vietnam

    • Real-time current price inquiry

    • Buy/Sell Order

  • Features

    • Fast response with asynchronous processing

    • Real-time price and transaction information

    • Stable error handling

    • Scalable design

⚠️ Note

This project is still in development and is an unfinished project. Please test it thoroughly before using it for actual investment.

  • Any and all losses and liabilities arising from the use of this project are entirely the responsibility of the user.

  • When using the API, you must comply with the Korea Investment & Securities Terms of Use.

  • Caution is required when using a real account, and sufficient testing with a mock investment account is recommended.

  • Be sure to check the restrictions regarding API call limits.

Requirements

  • Python >= 3.13

  • uv (Python packaging tool)

Installation

# 1. Install uv if not already installed pip install uv # 2. Create and activate virtual environment uv venv source .venv/bin/activate # Linux/MacOS # or .venv\\Scripts\\activate # Windows # 3. Install dependencies uv pip install -e . # 4. Set environment variables export KIS_APP_KEY="앱키" export KIS_APP_SECRET="시크릿키" export KIS_ACCOUNT_TYPE="VIRTUAL" # 또는 "REAL" export KIS_CANO="계좌번호"

Functions

Domestic Stock Trading

  • inquery_stock_price - Inquire about current stock price

    • symbol : stock code (e.g. "005930") (string, required)

    • Returns: Current price, previous day's price, rate of increase or decrease, trading volume, etc.

  • order_stock - Stock buy/sell order

    • symbol : stock code (string, required)

    • quantity : Order quantity (number, required)

    • price : order price (0: market price) (number, required)

    • order_type : Order type ("buy" or "sell") (string, required)

  • inquery_balance - Inquire account balance

    • Returns: Holdings, valuation, profit and loss status, etc.

  • inquery_order_list - Inquire daily order history

    • start_date : Search start date (YYYYMMDD) (string, required)

    • end_date : End date of search (YYYYMMDD) (string, required)

  • inquery_order_detail - Inquire order details

    • order_no : order number (string, required)

    • order_date : Order date (YYYYMMDD) (string, required)

  • inquery_stock_ask - Inquire stock price information

    • symbol : stock code (string, required)

    • Returns: Ask/Buy price, bid quantity, etc.

Overseas Stock Trading

  • order_overseas_stock - Overseas stock buy/sell order

    • symbol : stock code (e.g. "AAPL") (string, required)

    • quantity : Order quantity (number, required)

    • price : order price (number, required)

    • order_type : Order type ("buy" or "sell") (string, required)

    • market : Market code (string, required)

      • "NASD": NASDAQ

      • "NYSE": New York

      • "AMEX": Amex

      • "SEHK": Hong Kong

      • "SHAA": Shanghai, China

      • "SZAA": Shenzhen, China

      • "TKSE": Japan

      • "HASE": Hanoi, Vietnam

      • "VNSE": Ho Chi Minh City, Vietnam

  • inquery_overseas_stock_price - Inquire about current overseas stock prices

    • symbol : stock code (string, required)

    • market : Market code (string, required)

Resources

Configuration

Set your API key and account information via environment variables:

  • KIS_APP_KEY : Korea Investment & Securities App Key

  • KIS_APP_SECRET : Korea Investment & Securities Secret Key

  • KIS_ACCOUNT_TYPE : Account type ("REAL" or "VIRTUAL")

  • KIS_CANO : Account number

Trading Hours

Domestic stocks:

  • Regular hours: 09:00 ~ 15:30

  • After-hours single price: 15:40 ~ 16:00

Foreign stocks:

  • US (NASDAQ/New York): 22:30 ~ 05:00 (Korean time)

  • Japan: 09:00 ~ 15:10

  • China: 10:30 ~ 16:00

  • Hong Kong: 10:30 - 16:00

  • Vietnam: 11:15 - 16:15

Error Handling

Major errors that can occur when calling the API:

  • Authentication error: Invalid API key or secret key

  • Insufficient funds: When the order amount is greater than the account balance

  • Time limit: Outside trading hours

  • Order Limit: If the order quantity or amount exceeds the limit.

About

  • Scalable design

  • Fast response with asynchronous processing

  • Real-time price and transaction information

  • Stable error handling

License

MIT License

Related MCP Servers

  • A
    security
    -
    license
    A
    quality
    A Model Context Protocol server providing tools for querying A-share stock market data, including historical prices, financial reports, market indices, and macroeconomic indicators.
    Last updated -
    27
    458
    MIT License
  • -
    security
    F
    license
    -
    quality
    A custom Model Context Protocol server that provides real-time financial analysis tools including stock monitoring, portfolio management, market summaries, and automated price alerts with Telegram notifications.
    Last updated -
  • -
    security
    F
    license
    -
    quality
    Implements a Model Context Protocol server that connects with Zerodha Kite API, allowing users to buy/sell stocks and retrieve holdings and positions information.
    Last updated -
    1
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that collects and analyzes Korean stock market news in real-time, providing investment insights through AI-based analysis of sentiment, market impact, and rumor detection.
    Last updated -
    MIT License

View all related MCP servers

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/migusdn/KIS_MCP_Server'

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