KIS REST API MCP Server
The KIS REST API MCP Server acts as a Model Context Protocol interface to the Korea Investment & Securities REST API, enabling stock trading and market data retrieval for both domestic and overseas markets.
Domestic Stock Trading:
Inquire real-time stock prices (
inquery-stock-price) and bid/ask information (inquery-stock-ask)Place buy/sell orders (
order-stock)Check account balances (
inquery-balance)Retrieve order history (
inquery-order-list) and details (inquery-order-detail)Access daily stock price information (
inquery-stock-info) and historical data (inquery-stock-history)
Overseas Stock Trading:
Place buy/sell orders for international stocks (
order-overseas-stock)Inquire real-time prices for stocks in major markets including US (NASDAQ, NYSE, AMEX), Japan, China, Hong Kong, and Vietnam (
inquery-overseas-stock-price)
Integrates with Python 3.13+ as the required runtime environment for the MCP server, as indicated by both the badge and requirements section.
Uses Shields.io badges to display Python version requirements and license information in the README.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@KIS REST API MCP Server check Samsung Electronics current stock price"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Korea Investment & Securities (KIS) REST API MCP (Model Context Protocol)
This is a server that calls the Korea Investment & Securities (KIS) REST API as MCP tools. It provides domestic/foreign stock inquiries, account inquiries, and order-related APIs through both catalog-based general tools and frequently used convenience tools.
Key Features
API Catalog-based Calls
Provides 166 REST APIs across 8 groups
Check API groups/IDs, paths, HTTP methods, TR_ID candidates, and request parameters
Provides Korean labels, input guides, example values, and major code values for each parameter
Full list:
API_CATALOG.md
Domestic Stocks
Inquire current price, period/daily quotes, quotes (order book), industry indices, and basic information
Inquire balance, investment account asset status, buyable amount, and sellable quantity
Inquire orders/order history/correctable/cancellable orders
Foreign Stocks
Supports market codes for US, Japan, China, Hong Kong, and Vietnam
Inquire current price, balance, current balance based on execution, margin by currency, and buyable amount
Automatic selection of order TR_ID based on market/buy-sell direction
Execution/Operation
Supports
stdio,sse, andstreamable-httptransportsConfiguration based on
.envor command-line argumentsAutomatic completion of account number, account product code, and authentication values
Token cache based on app key and account type
Default rejection of unknown request parameters
Default blocking of order/correction/cancellation APIs
Related MCP server: kiwoom-mcp
Safety Defaults
APIs that change account status, such as orders/corrections/cancellations, are blocked by default.
KIS_ENABLE_TRADING=trueStatus change APIs are executed only when the above value is explicitly set. Do not set this if you are only using inquiry APIs.
Requirements
Python >= 3.13
uv
Installation
Proceed with installation based on INSTALL.md. LLMs or MCP clients should also read this file first when configuring.
INSTALL.md includes the following content:
uv-based dependency installation.envcreation and settingKIS_APP_KEY,KIS_APP_SECRET,KIS_CANO,KIS_ACNT_PRDT_CDExamples for registering with Codex CLI, Claude Code, Claude Desktop, and general MCP clients
KIS_MCP_TOOLSET=catalogsetting for context savingcall-kis-apiexamples for balance, buyable amount, and current price inquiries
Quick local setup:
pip install uv
uv sync
cp .env.example .env
chmod 600 .envThen, set the following values in .env. Refer to INSTALL.md for detailed value descriptions and registration commands for each client.
KIS_APP_KEY="발급받은 앱키"
KIS_APP_SECRET="발급받은 시크릿키"
KIS_ACCOUNT_TYPE="REAL" # REAL 또는 VIRTUAL
KIS_CANO="계좌번호 앞 8자리"
KIS_ACNT_PRDT_CD="01"
KIS_MCP_TOOLSET="catalog"Execution
# stdio, 로컬 MCP 클라이언트 권장
uv run python server.pyYou can also configure it via command-line arguments.
uv run python server.py \
--app-key "앱키" \
--app-secret "시크릿키" \
--account-type "REAL" \
--cano "계좌번호" \
--acnt-prdt-cd "01"Transport selection:
MCP_TYPE=stdio uv run python server.py
MCP_TYPE=streamable-http MCP_HOST=127.0.0.1 MCP_PORT=8000 MCP_PATH=/mcp uv run python server.py
MCP_TYPE=sse MCP_HOST=127.0.0.1 MCP_PORT=8000 MCP_PATH=/sse uv run python server.pyMCP client registration example:
Below is a minimal example for a general MCP client. Use INSTALL.md for Codex CLI, Claude Code, and Claude Desktop commands.
{
"mcpServers": {
"kis-mcp-server": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "<project-root>",
"env": {
"KIS_MCP_TOOLSET": "catalog",
"KIS_MCP_LOG_LEVEL": "WARNING"
}
}
}
}MCP Tool Configuration
Catalog Tools
Tool | Description |
| Inquire list based on API group/search term |
| Check path, TR_ID candidates, and parameters for a single API |
| Call catalog API with |
list-kis-api-specs returns labels, example values, and major code values for required parameters together.
get-kis-api-spec returns label, guide, examples, values, default, and auto_fill information for all parameters, allowing the LLM to immediately verify the input format required for the call.
call-kis-api performs the following common processing:
Automatic input of account number/account product code based on environment variables
Authentication token issuance and caching
GET/POST request configuration
Automatic selection of order TR_ID among multiple TR_IDs
Application of safety gate for status change APIs
Default rejection of parameters not in the catalog
Convenience Tools
Frequently used domestic/foreign stock functions are also provided as separate MCP tools.
Tool | Description |
| Domestic stock current price inquiry |
| Domestic stock balance inquiry |
| Domestic stock daily order/execution inquiry |
| Domestic stock order detail inquiry |
| Domestic stock daily quote inquiry |
| Domestic stock period quote inquiry |
| Domestic stock quote (order book) inquiry |
| Domestic industry/index current price inquiry |
| Domestic stock basic info inquiry |
| Foreign stock current price inquiry |
| Domestic stock buy/sell order |
| Foreign stock buy/sell order |
Order tools will not execute without KIS_ENABLE_TRADING=true.
Tool Loading Optimization
MCP clients load tool names, descriptions, and input schemas into the context when connecting to the server. Since exposing more convenience tools increases context usage at the start of a conversation, you can use a lightweight mode that exposes only the 3 catalog tools if necessary.
KIS_MCP_TOOLSET=catalog uv run python server.pyValue | Number of exposed tools | Exposed tools | Purpose |
| 15 | Catalog tools + all convenience tools | Compatible with existing behavior |
| 3 |
| Low context usage |
catalog mode is for reducing the MCP tool schema load. While convenience tools are hidden, all 166 APIs can still be called via call-kis-api. You can find the necessary API with list-kis-api-specs and look up required detailed parameters with get-kis-api-spec as needed.
Recommended usage flow:
Search for an API with
list-kis-api-specs.Check required parameters, example values, and code values with
get-kis-api-spec.Call the actual API with
call-kis-api.
You only need to add environment variables in the MCP client settings as well.
{
"env": {
"KIS_MCP_TOOLSET": "catalog"
}
}If you want to expose frequently used convenience tools directly in the tool list, use the default value full.
call-kis-api Examples
Domestic stock current price:
{
"group": "domestic_stock",
"api_type": "inquire_price",
"params": {
"fid_cond_mrkt_div_code": "J",
"fid_input_iscd": "005930"
}
}Foreign stock balance:
{
"group": "overseas_stock",
"api_type": "inquire_balance",
"params": {
"ovrs_excg_cd": "NASD",
"tr_crcy_cd": "USD"
}
}Foreign stock current balance based on execution:
{
"group": "overseas_stock",
"api_type": "inquire_present_balance",
"params": {
"wcrc_frcr_dvsn_cd": "01",
"natn_cd": "000",
"tr_mket_cd": "00",
"inqr_dvsn_cd": "00"
}
}Foreign stock buyable amount:
{
"group": "overseas_stock",
"api_type": "inquire_psamount",
"params": {
"ovrs_excg_cd": "NASD",
"ovrs_ord_unpr": "1",
"item_cd": "QQQ"
}
}Major API Groups
Group | Description | Number of APIs |
| Authentication | 2 |
| Domestic Stocks | 74 |
| Foreign Stocks | 34 |
| Domestic Bonds | 14 |
| Domestic Futures/Options | 20 |
| Foreign Futures/Options | 19 |
| ELW | 1 |
| ETF/ETN | 2 |
Full API IDs, paths, TR_IDs, and required parameter guides are summarized in API_CATALOG.md.
Environment Variables
Name | Description | Default |
| KIS App Key | - |
| KIS Secret Key | - |
|
| - |
| First 8 digits of account number | - |
| Account product code |
|
| Token cache file |
|
| Enable order/correction/cancellation APIs | Disabled |
| MCP tool exposure scope ( |
|
| Log level |
|
|
|
|
| HTTP/SSE host |
|
| HTTP/SSE port |
|
| HTTP/SSE path |
|
Development/Verification
uv run python -m compileall main.py server.py example.py tests
uv run python -m unittest discover -v
git diff --checkLicense
MIT
Available Tools
10 toolsinquery-balanceB
Get current stock balance information from Korea Investment & Securities
Inputs: no named parameters.
inquery-order-detailC
Get order detail from Korea Investment & Securities
Inputs: order_no (required), order_date (required).
inquery-order-listC
Get daily order list from Korea Investment & Securities
Inputs: start_date (required), end_date (required).
inquery-overseas-stock-priceC
Get overseas stock price from Korea Investment & Securities
Inputs: symbol (required), market (required).
inquery-stock-askC
Get stock ask price from Korea Investment & Securities
Inputs: symbol (required).
inquery-stock-historyC
Get daily stock price history from Korea Investment & Securities
Inputs: symbol (required), start_date (required), end_date (required).
inquery-stock-infoC
Get daily stock price information from Korea Investment & Securities
Inputs: symbol (required), start_date (required), end_date (required).
inquery-stock-priceC
Get current stock price information from Korea Investment & Securities
Inputs: symbol (required).
order-overseas-stockC
Order overseas stock (buy/sell) from Korea Investment & Securities
Inputs: symbol (required), quantity (required), price (required), order_type (required), +1 more.
order-stockC
Order stock (buy/sell) from Korea Investment & Securities
Inputs: symbol (required), quantity (required), price (required), order_type (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
The tools have clear distinctions between querying (inquery-*) and ordering (order-*), but within the querying tools there is significant overlap that could cause confusion. For example, inquery-stock-price, inquery-stock-info, and inquery-stock-ask all seem to retrieve stock price-related data with subtle differences that may not be immediately clear to an agent.
All tool names follow a consistent hyphen-separated pattern with a clear verb-noun structure (e.g., inquery-balance, order-stock). The naming is predictable and uniform across all 10 tools, making it easy for an agent to parse and understand the purpose of each tool.
With 10 tools, the count is well-scoped for a securities trading API, covering key operations like querying balances, orders, stock prices, and placing orders. Each tool appears to serve a distinct function within the domain, and the number is neither too sparse nor overwhelming.
The tool set provides comprehensive coverage for core trading operations, including querying various data (balances, orders, prices) and executing orders (domestic and overseas). A minor gap is the lack of tools for modifying or canceling orders, which might be necessary for full lifecycle management, but agents can likely work around this with the existing query and order tools.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables natural language control of Kiwoom Securities accounts through Claude Desktop. It provides tools for stock price lookup, buying and selling stocks, and analyzing portfolios or trade history via the Kiwoom REST API.112MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that wraps the Kiwoom Securities REST API to provide read-only access to Korean stock market information. It enables LLMs to query real-time prices, charts, investor trends, and account balances directly.4MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates Futu OpenAPI, enabling AI models to query real-time market data and execute trades across Hong Kong, US, and A-share markets.30 PyPI81MIT
- AlicenseAqualityBmaintenanceRead-only MCP server for Kiwoom Securities, enabling natural language queries of Korean stock market data and account information, including ISA tax status.49129 npm1MIT