Provides a Model Context Protocol (MCP) server enabling asynchronous access to domestic and international stock trading, real-time price inquiries, order management, and account balance retrieval via a REST API for seamless financial transactions.
Unlock the full potential of KIS REST API MCP Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available • No credit card required
한국투자증권(KIS)의 REST API를 사용하여 주식 거래 및 시세 정보를 조회하는 MCP(Model Context Protocol) 서버입니다. 국내 및 해외 주식 거래, 시세 조회, 계좌 관리 등 다양한 금융 거래 기능을 제공합니다.
🇰🇷 국내 주식 거래
🌏 해외 주식 거래
⚡ 특징
이 프로젝트는 아직 개발 중인 미완성 프로젝트입니다. 실제 투자에 사용하기 전에 충분한 테스트를 거치시기 바랍니다.
# 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 . mcp install server.py \ -v KIS_APP_KEY={KIS_APP_KEY} \ -v KIS_APP_SECRET={KIS_APP_SECRET} \ -v KIS_ACCOUNT_TYPE={KIS_ACCOUNT_TYPE} \ -v KIS_CANO={KIS_CANO}
You can also configure the MCP server using a JSON configuration file. Create a file named mcp-config.json
with the following content (replace the paths and environment variables with your own):
{ "mcpServers": { "KIS MCP Server": { "command": "/opt/homebrew/bin/uv", "args": [ "run", "--with", "httpx", "--with", "mcp[cli]", "--with", "xmltodict", "mcp", "run", "/path/to/your/project/server.py" ], "env": { "KIS_APP_KEY": "your_app_key", "KIS_APP_SECRET": "your_secret_key", "KIS_ACCOUNT_TYPE": "VIRTUAL", "KIS_CANO": "your_account_number" } } } }
This configuration can be used with MCP-compatible tools and IDEs to run the server with the specified dependencies and environment variables.
inquery_stock_price - 주식 현재가 조회
symbol
: 종목코드 (예: "005930") (string, required)order_stock - 주식 매수/매도 주문
symbol
: 종목코드 (string, required)quantity
: 주문수량 (number, required)price
: 주문가격 (0: 시장가) (number, required)order_type
: 주문유형 ("buy" 또는 "sell") (string, required)inquery_balance - 계좌 잔고 조회
inquery_order_list - 일별 주문 내역 조회
start_date
: 조회 시작일 (YYYYMMDD) (string, required)end_date
: 조회 종료일 (YYYYMMDD) (string, required)inquery_order_detail - 주문 상세 내역 조회
order_no
: 주문번호 (string, required)order_date
: 주문일자 (YYYYMMDD) (string, required)inquery_stock_ask - 호가 정보 조회
symbol
: 종목코드 (string, required)order_overseas_stock - 해외 주식 매수/매도 주문
symbol
: 종목코드 (예: "AAPL") (string, required)quantity
: 주문수량 (number, required)price
: 주문가격 (number, required)order_type
: 주문유형 ("buy" 또는 "sell") (string, required)market
: 시장코드 (string, required)
inquery_overseas_stock_price - 해외 주식 현재가 조회
symbol
: 종목코드 (string, required)market
: 시장코드 (string, required)환경 변수를 통해 API 키와 계좌 정보를 설정합니다:
KIS_APP_KEY
: 한국투자증권 앱키KIS_APP_SECRET
: 한국투자증권 시크릿키KIS_ACCOUNT_TYPE
: 계좌 타입 ("REAL" 또는 "VIRTUAL")KIS_CANO
: 계좌번호국내 주식:
해외 주식:
API 호출 시 발생할 수 있는 주요 에러:
MIT License
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!