Kis AgentSAFE
한국투자증권 OpenAPI Python 래퍼 — CLI · Python SDK · LLM Agent · 실시간 WebSocket. 문서: unohee.github.io/kis-agent
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
한국투자증권 OpenAPI Python 래퍼 - Korea Investment & Securities Trading API Client
pip install kis-agent
[](https://pypi.org/project/kis-agent/) [](https://pypi.org/project/kis-agent/) [](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT) [](https://unohee.github.io/kis-agent/)
📖 공식 문서: [unohee.github.io/kis-agent](https://unohee.github.io/kis-agent/) — 설치, 빠른 시작, 모의투자, CLI · Python API 레퍼런스, LLM Agent · MCP 연동, 아키텍처 가이드.
CLI
pip install kis-agent 하면 kis 명령이 바로 설치됩니다.
kis price 005930 # 삼성전자 현재가 kis price 005930 --daily --days 5 # 일별 시세 5일 kis overseas NAS AAPL # AAPL 시세 kis overseas NAS AAPL --detail # PER/PBR/시총 포함 kis balance --holdings # 계좌 잔고 + 보유종목 kis orderbook 005930 # 호가 10호가 kis futures 101S03 # 선물 시세 kis order twap 005930 --side buy --qty 1000 --duration 30 # 30분 균등 분할 매수 kis order vwap 005930 --side buy --qty 1000 --duration 120 # 거래량 비례 분할 매수 kis order twap 005930 --side buy --qty 1000 --dry-run # 스케줄만 확인 kis trades # 당일 체결내역 kis trades --from 7d --pretty # 최근 7일 (사람 읽기용) kis trades --from 30d --sell # 최근 30일 매도만 kis trades --from 3m --profit # 기간별 실현손익 kis query stock get_stock_price code=005930 # API 직접 호출 kis schema Stock # 타입 스키마 (LLM introspection)
- JSON 출력 (LLM 파싱 최적화),
--pretty로 사람 읽기용 - 한투 필드명 자동 변환:
stck_prpr→currentPrice,prdy_ctrt→changeRate - 휴장일/장외 시간 자동 감지 — 직전 영업일 기준 데이터 안내
주요 특징
- **CLI 도구
a0932a6cb917OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add kis-agent --env KIS_APP_KEY=${KIS_APP_KEY} --env KIS_APP_SECRET=${KIS_APP_SECRET} --env KIS_SECRET=${KIS_SECRET} --env KIS_TOKEN_PATH=${KIS_TOKEN_PATH} -- uvx kis-agent{
"mcpServers": {
"kis-agent": {
"command": "uvx",
"args": [
"kis-agent"
],
"env": {
"KIS_APP_KEY": "${KIS_APP_KEY}",
"KIS_APP_SECRET": "${KIS_APP_SECRET}",
"KIS_SECRET": "${KIS_SECRET}",
"KIS_TOKEN_PATH": "${KIS_TOKEN_PATH}"
}
}
}
}Exposed tools (125)
105 read · 19 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
account_query | read | 계좌 정보 통합 조회 |
analyze_broker_accumulation | read | 특정 증권사의 기간별 매집 종목 분석 |
analyze_foreign_institutional_flow | read | 외국인/기관 동시 순매수 종목 분석 |
analyze_market_breadth | read | 시장 폭(Market Breadth) 분석 |
broker_trading | read | 증권사 매매동향 통합 조회 |
calculate_support_resistance | read | 지지/저항선 계산 |
data_management | read | 데이터 관리 통합 |
derivatives | read | 파생상품 조회 |
detect_volume_spike | read | 거래량 급등 종목 탐지 |
enable_adaptive_rate_limiting | write | 적응형 Rate Limiting 활성화/비활성화 |
fetch_minute_data | read | 4일간 분봉 데이터 수집 |
find_price_momentum | read | 가격 모멘텀 종목 탐색 |
get_account_balance | read | 계좌 잔고 조회 |
get_account_order_quantity | write | 계좌별 주문 가능 수량 조회 |
get_all_methods | read | Agent의 모든 공개 메서드 조회 |
get_asking_price_exp_ccn | read | 호가예상체결 조회 |
get_condition_stocks | read | 조건검색식 종목 조회 |
get_daily_credit_balance | read | 신용잔고 일별추이 조회 |
get_daily_minute_price | read | 특정일 전체 분봉 데이터 조회 (내부 페이지네이션) |
get_daily_price | read | 국내주식 기간별 시세 조회 (일봉 데이터) |
get_fluctuation_rank | read | 등락률 순위 상세 조회 |
get_foreign_broker_net_buy | read | 외국인/기관 순매수 조회 |
get_frgnmem_pchs_trend | read | 외국인 매수 추세 조회 |
get_frgnmem_trade_estimate | read | 외국인 매매 추정 조회 |
get_frgnmem_trade_trend | read | 외국인 매매 추세 조회 |
get_future_option_price | read | KOSPI200 선물옵션 가격 조회 |
get_holiday_info | read | 휴장일 정보 조회 |
get_index_daily_price | read | 지수 일봉 데이터 조회 |
get_index_minute_data | read | 지수 분봉 데이터 조회 |
get_interest_group_list | read | 관심종목 그룹 목록 조회 |
get_interest_stock_list | read | 관심종목 그룹별 종목 조회 |
get_intraday_price | read | 주식 당일 분봉 데이터 조회 (전체) |
get_investor_daily_by_market | read | 시장별 투자자 일별 매매동향 |
get_investor_program_trade_today | read | 당일 투자자 프로그램 매매 조회 |
get_investor_time_by_market | read | 시장별 투자자 시간대별 매매동향 |
get_investor_trade_by_stock_daily | read | 종목별 투자자 일별 매매동향 조회 |
get_investor_trend_estimate | read | 투자자별 추정 동향 조회 |
get_kospi200_futures_code | read | KOSPI200 선물 종목코드 조회 |
get_market_fluctuation | read | 시장 등락 현황 조회 |
get_market_rankings | read | 시장 순위 조회 |
get_member | read | 회원사 정보 조회 |
get_member_transaction | read | 증권사 기간별 거래 |
get_minute_price | read | [DEPRECATED] 분봉 데이터 조회 - get_intraday_price 또는 get_daily_minute_price 사용 권장 |
get_orderbook_raw | read | 호가 조회 |
get_pbar_tratio | read | 매수매도비율 조회 |
get_possible_order_amount | write | 주문 가능 금액/수량 조회 |
get_program_trade_by_stock | read | 종목별 프로그램 매매 |
get_program_trade_daily_summary | read | 프로그램 매매 일별 요약 |
get_program_trade_hourly_trend | read | 프로그램 매매 시간대별 추세 |
get_program_trade_market_daily | read | 시장 프로그램 매매 |
get_program_trade_period_detail | read | 프로그램 매매 기간 상세 |
get_rate_limiter_status | read | Rate Limiter 상태 조회 |
get_stock_basic | read | 종목 기본 조회 |
get_stock_ccnl | read | 주식 체결 조회 |
get_stock_financial | read | 종목 재무정보 조회 |
get_stock_info | read | 종목 기본정보 조회 |
get_stock_investor | read | 종목별 투자자 매매동향 |
get_stock_member | read | 증권사별 매매동향 |
get_stock_price | read | 주식 현재가 조회 |
get_tool_registry | read | 사용 가능한 도구 목록과 관계 조회 |
get_top_gainers | read | 등락률 순위 조회 |
get_total_asset | read | 총자산 조회 |
get_volume_power | read | 거래량 순위 조회 |
get_volume_power_rank | read | 체결강도 순위 조회 |
get_volume_rank | read | 거래량 순위 조회 |
index_data | read | 지수 데이터 통합 조회 |
init_minute_db | read | 분봉 데이터베이스 초기화 |
inquire_balance_rlz_pl | read | 잔고 평가 및 실현 손익 조회 |
inquire_ccnl | read | 주식 체결 정보 조회 |
inquire_credit_order_psbl | write | 신용주문가능조회 |
inquire_credit_psamount | read | 신용 거래 가능 금액 조회 |
inquire_daily_ccld | read | 일자별 체결 내역 조회 |
inquire_daily_overtimeprice | read | 시간외 일별 시세 조회 |
inquire_daily_price | read | 주식현재가 일자별 조회 (최근 30일/주/월) |
inquire_elw_price | read | ELW 시세 조회 |
inquire_index_category_price | read | 업종별 지수 조회 |
inquire_index_price | read | 지수 현재가 조회 |
inquire_index_tickprice | read | 지수 틱 데이터 조회 |
inquire_index_timeprice | read | 지수 시간별 데이터 조회 |
inquire_intgr_margin | read | 증거금 조회 |
inquire_minute_price | read | 분봉시세조회 - 하루 전체 분봉 데이터 조회 |
inquire_order_psbl | write | 주문가능조회 (상세) |
inquire_overtime_asking_price | read | 시간외 호가 조회 |
inquire_overtime_price | read | 시간외 현재가 조회 |
inquire_period_rights | read | 기간별 권리 조회 |
inquire_period_trade_profit | read | 기간별 매매 손익 조회 |
inquire_price | read | 주식 현재가 상세 조회 |
inquire_price_2 | read | 주식 현재가 상세 조회 2 |
inquire_psbl_order | write | 주문가능조회 |
inquire_psbl_rvsecncl | read | 정정취소가능조회 |
inquire_psbl_sell | read | 매도 가능 수량 조회 |
inquire_time_itemconclusion | read | 주식 시간별 체결 조회 |
inquire_vi_status | read | VI 발동 상태 조회 |
interest_stocks | read | 관심종목/조건검색 조회 |
investor_flow | read | 투자자 매매동향 통합 조회 |
is_holiday | read | 특정일 휴장일 여부 확인 |
market_ranking | read | 시장 순위 통합 조회 |
method_discovery | read | Agent 메서드 탐색 통합 |
migrate_minute_csv_to_db | read | CSV 데이터를 데이터베이스로 마이그레이션 |
order_cash | write | 현금 매수 |
order_cash_sor | write | 시장가 매수 |
order_credit_buy | write | 신용 매수 |
order_credit_sell | write | 신용 매도 |
order_execute | write | 주문 실행 통합 |
order_manage | write | 주문 관리 통합 (정정/취소/예약) |
order_resv | write | 예약 주문 |
order_resv_ccnl | write | 예약 주문 전체 취소 |
order_resv_rvsecncl | write | 예약 주문 정정/취소 |
order_rvsecncl | write | 주문 정정/취소 |
order_stock_cash | write | 현금 주문 (매수/매도) |
order_stock_credit | write | 신용 주문 (매수/매도) |
overtime_trading | read | 시간외 거래 통합 조회 |
plan_query_execution | read | 사용자 쿼리를 분석하여 실행 계획 생성 |
program_trading | read | 프로그램 매매 통합 조회 |
rate_limiter | read | Rate Limiter 관리 통합 |
reset_rate_limiter | destructive | Rate Limiter 상태 초기화 |
search_methods | read | Agent 메서드 검색 |
search_stock | read | 종목 검색 (종목코드 또는 종목명으로 검색) |
set_rate_limits | write | Rate Limiter 제한 값 설정 |
show_method_usage | read | 특정 메서드의 상세 사용법 조회 |
stock_chart | read | 주식 차트 데이터 통합 조회 |
stock_info | read | 종목 정보 통합 조회 |
stock_quote | read | 주식 시세/호가/체결 통합 조회 |
suggest_tool_combination | read | 목표 달성을 위한 도구 조합 제안 |
utility | read | 유틸리티 기능 통합 |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (4 observation(s))
- Network
- none-observed
- Shell
- declared (3 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (13)
reset_rate_limiter
.cxtignore
.flake8
.openswarm-preserved
.mcp.json.example
print(f"토큰 발급 성공: {self.client.token[:20]}...")unpad(cipher.decrypt(b64decode(cipher_text)), AES.block_size)
key = b64decode(header["tr_key"])
iv = b64decode(header.get("tr_iv", ""))unpad(cipher.decrypt(b64decode(cipher_text)), AES.block_size)
pytest, pytest-asyncio, pytest-cov, pytest-mock, ruff, black, mypy, isort
mcp, python-dotenv, pykis
requests, pandas, pytz, python-dotenv, pycryptodome
Gates applied: no_behavioural_pass.
a0932a6cb917full audit observations/trust-audit/mcp-server/unohee__kis-agent.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | a0932a6cb917 | SAFE | B | 89 | first audit |
Questions
What is the Kis Agent MCP server?
한국투자증권 OpenAPI Python 래퍼 — CLI · Python SDK · LLM Agent · 실시간 WebSocket. 문서: unohee.github.io/kis-agent
What tools does Kis Agent expose?
125 in total: 105 read-only, 19 that write, and 1 that can delete or overwrite (reset_rate_limiter). Every one is listed on this page with its risk.
Is Kis Agent safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Kis Agent need?
It reads KIS_APP_KEY, KIS_APP_SECRET, KIS_SECRET and KIS_TOKEN_PATH from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How current is this page?
The grade is for one exact copy of the source (a0932a6cb917), read on 2026-10-08. The repository is watched and re-audited when it changes.