Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words Sign in

Kiwoom Securities (키움증권) REST API

by younghwan91version 0.5.0i★ 2iRuns on your computerOfficial site ↗
Registry nameio.github.younghwan91/kiwoom-client

How to install

What it does

Korean stocks via the Kiwoom REST API: quotes, charts, rankings, account. Live orders opt-in only.

  • Connects Runs on your computer
  • Account or key Needs KIWOOM_APP_KEY, KIWOOM_APP_SECRET
  • Category Online shops & payments

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity6/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score18/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install Kiwoom Securities (키움증권) REST API. Follow https://mcp.popnx.com/i/younghwan91-kiwoom-client.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 21, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Kiwoom Securities (키움증권) REST API for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "kiwoom-client": { "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Kiwoom Securities (키움증권) REST API key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the Kiwoom Securities (키움증권) REST API site ↗

  3. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  4. Paste these settings and save the file

    {
      "mcpServers": {
        "kiwoom-client": {
          "command": "uvx",
          "args": [
            "kiwoom-client"
          ],
          "env": {
            "KIWOOM_APP_KEY": "your-value",
            "KIWOOM_APP_SECRET": "your-value"
          }
        }
      }
    }

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Quit Claude and open it again

  6. Try it

    Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected

3 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default true
  • KIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.
  • KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Kiwoom Securities (키움증권) REST API yet

Kiwoom Securities (키움증권) REST API runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Kiwoom Securities (키움증권) REST API

  • You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
  • You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
  • You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

B · Others in Online shops & payments that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Kiwoom Securities (키움증권) REST API for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-client 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Kiwoom Securities (키움증권) REST API key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the Kiwoom Securities (키움증권) REST API site ↗

  3. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  4. Paste this command and press Enter

    claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-client

    Replace “your-value” with your key before pressing Enter

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Type /mcp in Claude Code

    You should see Kiwoom Securities (키움증권) REST API listed as connected

  6. Try it

    Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected

3 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default true
  • KIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.
  • KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Kiwoom Securities (키움증권) REST API for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "kiwoom-client": { "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Kiwoom Securities (키움증권) REST API key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the Kiwoom Securities (키움증권) REST API site ↗

  3. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  4. Fill in your key

    In the Kiwoom Securities (키움증권) REST API settings, KIWOOM_APP_KEY, KIWOOM_APP_SECRET is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in Cursor in Agent mode

  6. Try it

    Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected

3 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default true
  • KIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.
  • KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Kiwoom Securities (키움증권) REST API for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "kiwoom-client": { "type": "stdio", "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Kiwoom Securities (키움증권) REST API key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the Kiwoom Securities (키움증권) REST API site ↗

  3. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  4. Fill in your key

    In the Kiwoom Securities (키움증권) REST API settings, KIWOOM_APP_KEY, KIWOOM_APP_SECRET is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in VS Code in Agent mode

  6. Try it

    Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected

3 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default true
  • KIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.
  • KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Kiwoom Securities (키움증권) REST API💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-client

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "kiwoom-client": {
      "command": "uvx",
      "args": [
        "kiwoom-client"
      ],
      "env": {
        "KIWOOM_APP_KEY": "your-value",
        "KIWOOM_APP_SECRET": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "kiwoom-client": {
      "command": "uvx",
      "args": [
        "kiwoom-client"
      ],
      "env": {
        "KIWOOM_APP_KEY": "your-value",
        "KIWOOM_APP_SECRET": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "kiwoom-client": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "kiwoom-client"
      ],
      "env": {
        "KIWOOM_APP_KEY": "your-value",
        "KIWOOM_APP_SECRET": "your-value"
      }
    }
  }
}

Values you fill in

  • KIWOOM_APP_KEY secret required env
    Kiwoom REST API app key (키움 REST API 앱키)
  • KIWOOM_APP_SECRET secret required env
    Kiwoom REST API app secret (시크릿키)
  • KIWOOM_IS_MOCK env
    true = paper trading server (모의투자). Default false = live server.
  • KIWOOM_MCP_TOOLSETS env
    Comma-separated modules to expose, e.g. market,chart,account. Default: all.
  • KIWOOM_MCP_MODE env
    discovery = expose only search_tools/describe_tool/call_tool to save context.

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
249/wk
Connection
Runs on your computer
Latest versioni
0.5.0
Published to registryi
Nov 21, 2026
Code last changedi
Nov 21, 2026
Maker
younghwan91
Packages
pypi: kiwoom-client
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 21, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account younghwan91, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed today

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for kiwoom-client@0.5.0

Checks only this package version, not every dependency · checked Nov 21, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/younghwan91-kiwoom-client.svg)](https://mcp.popnx.com/en/servers/younghwan91-kiwoom-client)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Online shops & paymentsi

  • More stars than 94% of the other 3027 servers in this category
  • Published to the registry more recently than 99% of the other 3027 servers in this category
  • Basic checks equal to or better than 99% of the other 3027 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Kiwoom Securities (키움증권) REST API safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

You need to fill in: KIWOOM_APP_KEY, KIWOOM_APP_SECRET

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed today, and the latest version (0.5.0) reached the registry today.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: Stripe MCP, FlightClaw, Trade It, Marketplace Ad Pros: Amazon Ads & Seller Central, idealo MCP Server

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Stripe MCP

Stripe’s official server lets AI view and manage customers, products, payments and invoices. Connect to Stripe’s cloud and sign in with OAuth.

by stripeWidely used★ 2.1KUpdated 13 months ago

Runs in the cloud✓ service owner · stripe.com

FlightClaw

Search, price-track and book flights from about 300 airlines, paid on a hosted checkout link.

by flightclawGrowing★ 87Updated today

Runs in the cloud✓ service owner · flightclaw.com

Trade It

Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.

by trade-it-incGrowing★ 62Updated 36 days ago

Runs in the cloud✓ service owner · tradeit.app

idealo MCP Server

Search products, compare prices and discover deals across 6 European markets with your AI assistant.

by idealoEarly★ 28Updated 6 months ago

Runs in the cloud✓ service owner · mcp.idealo.com
Compared with similar ones
This one
Kiwoom Securities (키움증권) REST API
Stripe MCPFlightClawTrade ItMarketplace Ad Pros: Amazon Ads & Seller Centralidealo MCP Server
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyYesNoNoNoNoNo
Add with + in ClaudeNoYesNoNoNoNo
Basic checks3/34/44/45/54/44/4
LicenseMITMITMITCC0-1.0MITMIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

한국어 | English

kiwoom-client — 키움증권 REST API 파이썬 클라이언트

키움 REST API, 파이썬과 AI 에이전트로. 182개 엔드포인트, 실시간 WebSocket, 그리고 MCP 서버로 AI 에이전트까지 — OpenAPI+ 의 COM/OCX 없이 Windows · macOS · Linux 어디서나 자동매매·데이터 수집 코드가 돌아갑니다. 키움증권과 무관한 비공식 오픈소스입니다.

  • REST 182개 + 조건검색 4종 + 실시간 19종을 모듈 15개로 감쌌습니다. 아래 그림은 코드에서 센 것이라 타일 하나가 엔드포인트 하나입니다.
  • MCP 서버 내장 — Claude Code · Cursor 가 stock_info_basic_stock_info 같은 도구로 시세·계좌·주문을 직접 부릅니다. 실전 계좌에서는 KIWOOM_MCP_ALLOW_LIVE_ORDERS=true 를 켜기 전까지 주문 도구가 등록조차 되지 않습니다.
  • 봇이 토큰 만료로 죽지 않습니다 — 만료 전 자동 갱신, 401 이면 재발급 후 재시도. TR별 Rate Limiter 가 429 를 막고, 그래도 나오면 백오프 후 다시 보냅니다.

빠른 시작

pip install kiwoom-client
from kiwoom_client import KiwoomAPI

api = KiwoomAPI.from_env(is_mock=True) # KIWOOM_APP_KEY·KIWOOM_APP_SECRET 환경변수 (.env 는 from_env(".env"))

또는 직접: KiwoomAPI(app_key="발급받은_앱키", app_secret="발급받은_시크릿키", is_mock=True)

info = api.stock_info.basic_stock_info(stk_cd=api.stock_code("삼성전자")) # 종목명 → 005930 chart = api.chart.stock_daily_chart(stk_cd="005930", base_dt="20260326", upd_stkpc_tp="1") # 일봉 print(info["stk_nm"])

접근토큰은 첫 호출에서 자동 발급되고 만료 전에 갱신되므로 따로 할 일이 없습니다. 앱키·시크릿키는 키움 REST API 포털에서 발급받고, 처음에는 모의투자(is_mock=True)로 시작하세요.

AI 에이전트에서 (MCP)
pip install 'kiwoom-client[mcp]'

claude mcp add --transport stdio \ --env KIWOOM_APP_KEY=발급받은_앱키 --env KIWOOM_APP_SECRET=발급받은_시크릿키 --env KIWOOM_IS_MOCK=true \ kiwoom-client -- kiwoom-client-mcp

이제 Claude Code 에서 "삼성전자 지금 얼마야?" 라고 물으면 됩니다. Cursor 등 다른 클라이언트 설정과 환경변수는 MCP 서버로 사용하기.

실서버를 호출하지 않고 만든 예시 화면입니다(시세 값은 가상). 실전투자 서버에서는 KIWOOM_MCP_ALLOW_LIVE_ORDERS=true 를 켜기 전까지 주문 도구가 등록되지 않아, 에이전트가 주문할 방법 자체가 없습니다.

더 읽을거리: 왜 kiwoom-client 인가 — OpenAPI+·pykiwoom·다른 REST 래퍼와 비교 · 엔드포인트 전체 목록

무엇을 하나

  • 크로스 플랫폼: REST 기반이라 Windows · macOS · Linux, 헤드리스 서버에서도 돌아갑니다.
  • sync / async 양쪽: KiwoomAPI 와 AsyncKiwoomAPI 가 같은 엔드포인트를 제공합니다.
  • 자동 토큰 관리: 발급·만료 전 갱신·401 재발급을 라이브러리가 맡습니다.
  • 내장 Rate Limiter: TR(api_id)별 토큰 버킷(1 req/s, 버스트 2) + 429 자동 재시도.
  • 자동 페이지네이션: request_all() 이 cont-yn/next-key 를 끝까지 따라갑니다.
  • 바로 쓰는 응답: to_dataframe() 이 "+70000" 같은 문자열을 숫자로 바꿔 DataFrame 으로 넘깁니다.
  • 호가단위 보정: round_to_tick() 으로 지정가를 KRX 호가단위에 맞춥니다.
  • 실시간 WebSocket: 체결·호가·잔고 등 19종 구독, PING 응답·재연결·구독 복원 내장. 조건검색도 같은 소켓.
  • MCP 서버: 모듈 15개의 REST 엔드포인트 전부와 조건검색 4종이 MCP 도구로 노출됩니다.
기존 키움 OpenAPI / pykiwoom 과 무엇이 다른가?

키움 OpenAPI+(OCX/COM) 와 이를 감싼 pykiwoom 은 32bit Windows 에 묶여 있어 서버 배포·자동화가 어렵습니다. 이 라이브러리는 키움의 신규 REST API 를 쓰므로 그 제약이 없습니다.

항목키움 OpenAPI+ (OCX)pykiwoomkiwoom-client
연동 방식COM/OCXOCX 래퍼REST + WebSocket
운영체제Windows 전용Windows 전용Windows · macOS · Linux
Python 비트수32bit 전용32bit 전용64bit 지원
서버/헤드리스 배포어려움 (GUI 필요)어려움가능
실시간 데이터이벤트 콜백이벤트 콜백async WebSocket
설치별도 모듈 설치OCX + 모듈`pip install` 한 줄

키움 공식 저장소·다른 REST 래퍼까지 넣은 비교는 왜 kiwoom-client 인가, OpenAPI+ TR·함수를 REST 로 옮기는 대응표는 옮겨 오기.

설치와 사전 준비

pip install kiwoom-client            # 기본

pip install 'kiwoom-client[pandas]' # to_dataframe() 까지 pip install 'kiwoom-client[mcp]' # MCP 서버까지 uv add kiwoom-client # uv 를 쓴다면

  • Python 3.10 이상. 소스에서 쓰려면 git clone 뒤 pip install -e .
  • 키움 REST API 포털에서 API 사용신청으로 앱키·시크릿키를 발급받습니다. 환경변수는 .env.example 참고.
  • 모의투자용 키와 실전투자용 키는 다릅니다. is_mock 과 짝이 맞지 않으면 인증이 거부됩니다.
구분실전투자모의투자
is_mockFalse (기본값)True
REST URLhttps://api.kiwoom.comhttps://mockapi.kiwoom.com
WebSocket URLwss://api.kiwoom.com:10000wss://mockapi.kiwoom.com:10000

사용법

계좌와 주문
evaluation = api.account.account_evaluation(qry_tp="0", dmst_stex_tp="KRX")  # 계좌 평가 현황

deposit = api.account.deposit_detail(qry_tp="3") # 예수금 상세 position = api.account.filled_position(dmst_stex_tp="KRX") # 체결 잔고 unfilled = api.account.unfilled_orders(all_stk_tp="0", trde_tp="0", stex_tp="0") # 미체결 주문

삼성전자 10주 지정가 매수 — 값은 키움 공식 스펙 기준 (문자열)

result = api.order.buy_order( dmst_stex_tp="KRX", # 거래소 구분: KRX / NXT / SOR stk_cd="005930", # 종목코드 ord_qty="10", # 주문 수량 ord_uv="70000", # 주문 단가 trde_tp="0", # 매매구분: 0 보통(지정가), 3 시장가, 28 스톱지정가 ... ) api.order.sell_order(dmst_stex_tp="KRX", stk_cd="005930", ord_qty="10", ord_uv="75000", trde_tp="0") api.order.modify_order( # 정정 (kt10002) dmst_stex_tp="KRX", orig_ord_no="원주문번호", stk_cd="005930", mdfy_qty="5", mdfy_uv="71000", ) api.order.cancel_order( # 취소 (kt10003) — cncl_qty="0" 이면 잔량 전부 dmst_stex_tp="KRX", orig_ord_no="원주문번호", stk_cd="005930", cncl_qty="5", )

api.logout() # 토큰 폐기 (선택) api.close() # 연결 종료 — with 문을 쓰면 자동

지정가(ord_uv)는 KRX 호가단위의 배수여야 합니다. 아니면 거부되거나 의도와 다른 가격에 체결됩니다.

from kiwoom_client import add_ticks, round_to_tick, tick_size

tick_size(70123) # Decimal('100') (5만~20만원대는 1틱 100원) round_to_tick(70123) # Decimal('70100') (직전 유효 호가로 내림) add_ticks(49950, 2) # Decimal('50100') (구간 경계를 넘는 N틱 이동)

api.order.buy_order( dmst_stex_tp="KRX", stk_cd="005930", ord_qty="10", ord_uv=str(round_to_tick(target_price)), trde_tp="0", )

asyncio

AsyncKiwoomAPI 는 KiwoomAPI 와 같은 엔드포인트를 제공하며, 호출 앞에 await 만 붙이면 됩니다.

import asyncio

from kiwoom_client import AsyncKiwoomAPI

async def main(): async with AsyncKiwoomAPI(app_key="앱키", app_secret="시크릿키", is_mock=True) as api:

서로 다른 TR은 동시에 나간다 — 직렬로 돌리면 3배 걸린다

info, chart, ranking = await asyncio.gather( api.stock_info.basic_stock_info(stk_cd="005930"), api.chart.stock_daily_chart(stk_cd="005930", base_dt="20260326", upd_stkpc_tp="1"), api.ranking.top_volume_today( # ka10030 — 필드는 api.describe("ka10030") mrkt_tp="000", sort_tp="1", mang_stk_incls="0", crd_tp="0", trde_qty_tp="0", pric_tp="0", trde_prica_tp="0", mrkt_open_tp="0", stex_tp="3", ), ) print(info["stk_nm"])

asyncio.run(main())

Rate Limiter 는 TR(api_id)별로 걸립니다. 서로 다른 TR 은 서로를 막지 않고 동시에 나가며, 같은 TR 을 반복 호출할 때만 초당 1건으로 조여집니다. 전체 예제는 examples/async_usage.py.

응답을 숫자·DataFrame으로 받기

키움은 모든 값을 문자열로 돌려줍니다. 가격은 "+70000", 등락률은 "-1.23", 거래량은 "1,234,567" 같은 식이라 그대로는 계산에 쓸 수 없습니다.

from kiwoom_client import to_dataframe, to_number, normalize

result = api.ranking.top_volume_today(...)

df = to_dataframe(result) # 페이로드 키를 자동으로 찾아 DataFrame 으로 (문자열 → 숫자 포함) print(df["cur_prc"].mean()) # 바로 계산 가능

data = normalize(result) # dict 그대로 쓰고 싶다면 price = to_number("+70000") # 70000

종목코드("005930")처럼 앞자리 0 이 의미를 갖는 값과 base_dt 같은 날짜·식별자 필드는 문자열로 남깁니다. to_dataframe() 에는 pandas 가 필요합니다(pip install 'kiwoom-client[pandas]'). 차트 응답은 to_ohlcv(resp) 가 open/high/low/close/volume + 날짜 인덱스 DataFrame 으로 바꿉니다.

샘플 응답을 to_dataframe() 에 넣은 실제 출력입니다. 시세 값 자체는 예시입니다 — stk_cd 는 문자열로 남고 가격·거래량만 숫자가 되는 것을 보세요.

실시간 WebSocket
import asyncio

from kiwoom_client import KiwoomAPI

api = KiwoomAPI(app_key="앱키", app_secret="시크릿키") ws = api.create_websocket()

async def main():

connect()가 LOGIN 핸드셰이크까지 끝냅니다. 실패하면 KiwoomWebSocketError

await ws.connect()

콜백은 REAL 프레임의 항목 하나를 받습니다:

{"type": "0B", "item": "005930", "values": {"10": "+70000", ...}}

ws.on("0B", lambda d: print(f"체결 {d['item']}: {d['values'].get('10')}")) ws.on("0D", lambda d: print(f"호가 {d['item']}: {d['values'].get('41')}"))

async 콜백도 그대로 등록할 수 있습니다

async def save(d): ... ws.on("0B", save)

삼성전자 실시간 체결+호가 구독

await ws.subscribe("0B", "005930") await ws.subscribe(["0B", "0D"], ["005930", "000660", "035420"])

PING 응답과 재연결(재로그인·구독 복원)은 listen()이 알아서 처리합니다

await ws.listen()

asyncio.run(main())

values 의 키는 키움 FID 번호입니다(10=현재가, 13=누적거래량, 41=매도최우선호가).

조건검색도 같은 WebSocket 을 씁니다. api.condition_search 가 요청 페이로드를 만들고, ws.send() 로 보낸 뒤 ws.on_trnm() 으로 응답을 받습니다.

await ws.connect()

ws.on_trnm("CNSRLST", lambda d: print("조건식 목록:", d["data"])) ws.on_trnm("CNSRREQ", lambda d: print("검색 결과:", d.get("data")))

조건식 목록을 먼저 조회해야 seq를 알 수 있습니다

await ws.send(api.condition_search.condition_list())

seq로 검색 (search_type="1"이면 실시간 편입/이탈까지 수신)

await ws.send(api.condition_search.condition_search_realtime(seq="1")) await ws.listen()

검증 상태: 실서버(api.kiwoom.com) 대상으로 LOGIN 핸드셰이크 · PING 프레임 · REG 등록 응답까지 확인했습니다.

다만 REAL 프레임의 항목 필드명(`item`/`values`)은 장 마감 중이라 아직 미확정입니다. 장중 이상 동작을 만나면

이슈로 알려주세요. 직접 확인하려면 python tests/integration_ws_smoke.py --prod.

연속 조회 (페이지네이션)

응답 헤더의 cont-yn 이 "Y" 이면 다음 페이지가 있다는 뜻입니다. request_all() 이 끝까지 따라갑니다.

all_data = api._client.request_all(

"/api/dostk/acnt", "ka10076", data_key="filled_list", # 응답에서 리스트 데이터의 키 이름 )

요청 제한 (Rate Limit)

키움 REST API 는 TR(api_id)별로 독립적인 호출 제한을 둡니다. 실측 결과:

항목측정값
지속(sustained) 안전 속도TR당 약 1 req/s (이 속도에선 거부 0)
순간 버스트(burst) 허용량TR당 약 2건
초과 시 응답HTTP 429 + {"return_code": 5, "return_msg": "허용된 요청 개수를 초과하였습니다"}
제한 단위TR(api_id)별 독립 — 서로 다른 TR은 영향 없음

라이브러리는 기본으로 TR별 토큰 버킷(1 req/s, 버스트 2) 을 걸고, 그래도 429 가 나면 *

Only the beginning is shown; read the rest in the repo