kiwoom-private-mcp-server

kiwoom-private-mcp-server

Enables querying Kiwoom Securities account information and portfolio evaluation through MCP tools, supporting account balance and holdings analysis.

Category
Visit Server

README

πŸ“Š kiwoom-private-mcp-server

ν‚€μ›€μ¦κΆŒ REST APIλ₯Ό ν™œμš©ν•˜μ—¬ 주식 κ³„μ’Œ 정보 및 보유 μ’…λͺ©μ˜ 평가 ν˜„ν™©μ„ μ‘°νšŒν•  수 μžˆλŠ” 개인용 Model Context Protocol (MCP) μ„œλ²„μž…λ‹ˆλ‹€. Claude Desktop, Cursor λ“± LLM ν΄λΌμ΄μ–ΈνŠΈμ™€ μ—°λ™ν•˜μ—¬ AIκ°€ 직접 투자 μžμ‚° ν˜„ν™©μ„ νŒŒμ•…ν•˜κ³  μ„Ήν„° 적합도 뢄석 등을 μˆ˜ν–‰ν•  수 μžˆλ„λ‘ λ•μŠ΅λ‹ˆλ‹€.


πŸš€ μ£Όμš” κΈ°λŠ₯ (MCP Tools)

  • get_accounts: μ‚¬μš©μžκ°€ μ •μ˜ν•œ ν‚€μ›€μ¦κΆŒ κ³„μ’Œ λͺ©λ‘κ³Ό 각 κ³„μ’Œλ³„ νƒ€κ²Ÿ μ„Ήν„° 정보λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.
  • get_account_balance: νŠΉμ • κ³„μ’Œμ˜ 총 평가 μžμ‚°, κ°œλ³„ 보유 μ’…λͺ©μ˜ 평가 κΈˆμ•‘, 비쀑, 평단가 및 수읡λ₯ μ„ μ‘°νšŒν•©λ‹ˆλ‹€. (μ‹€μ œ μ„œλ²„ API 연동 및 λͺ¨μ˜ Mock 쑰회 지원)

πŸ› οΈ μš”κ΅¬ 사항 및 기술 μŠ€νƒ

  • Python: 3.10 이상
  • μ˜μ‘΄μ„± 도ꡬ:
    • uv: Rust 기반으둜 개발된 μ΄ˆκ³ μ† 파이썬 νŒ¨ν‚€μ§€/ν”„λ‘œμ νŠΈ κ΄€λ¦¬μž
    • mcp: Anthropic Model Context Protocol SDK
    • requests: API HTTP 톡신 라이브러리
    • python-dotenv: 둜컬 ν™˜κ²½ λ³€μˆ˜(.env) λ‘œλ“œ 라이브러리

πŸ“¦ μ„€μΉ˜ 및 둜컬 μ„€μ •

1. uv 도ꡬ μ„€μΉ˜ (Rust 기반의 μ΄ˆκ³ μ† νŒ¨ν‚€μ§€ λ§€λ‹ˆμ €)

터미널(PowerShell λ˜λŠ” bash)μ—μ„œ μ•„λž˜ λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•˜μ—¬ uvλ₯Ό μ„€μΉ˜ν•©λ‹ˆλ‹€.

  • Windows (PowerShell):
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  • macOS / Linux:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  • κΈ°μ‘΄ pipλ₯Ό μ‚¬μš©ν•˜λŠ” 경우:
    pip install uv
    

2. κ°€μƒν™˜κ²½ ꡬ좕 및 νŒ¨ν‚€μ§€ μ„€μΉ˜

ν”„λ‘œμ νŠΈ 루트 λ””λ ‰ν† λ¦¬μ—μ„œ λ‹€μŒ λͺ…령을 μ‚¬μš©ν•˜μ—¬ μ˜μ‘΄μ„±μ„ μ΄ˆκ³ μ†μœΌλ‘œ λ™κΈ°ν™”ν•©λ‹ˆλ‹€.

# κ°€μƒν™˜κ²½(.venv) 생성
uv venv

# pyproject.toml에 μ •μ˜λœ νŒ¨ν‚€μ§€ μ„€μΉ˜ 및 둜컬 ν”„λ‘œμ νŠΈ λΉŒλ“œ
uv pip install -e .

3. ν™˜κ²½ μ„€μ • 파일 ꡬ성

둜컬 λ³΄μ•ˆ 및 κ³„μ’Œ 정보 맀핑을 μœ„ν•΄ μ„€μ • ν…œν”Œλ¦Ώ νŒŒμΌλ“€μ„ λ³΅μ‚¬ν•˜μ—¬ μ‹€μ œ μ„€μ • νŒŒμΌμ„ μž‘μ„±ν•©λ‹ˆλ‹€. (이 νŒŒμΌλ“€μ€ .gitignore에 λ“±λ‘λ˜μ–΄ κΉƒ κ΄€λ¦¬μ—μ„œ λ°°μ œλ©λ‹ˆλ‹€.)

  1. ν™˜κ²½ λ³€μˆ˜ 파일 (.env) 생성: .env.example νŒŒμΌμ„ λ³΅μ‚¬ν•˜μ—¬ .env νŒŒμΌμ„ λ§Œλ“€κ³  킀움 API 인증에 ν•„μš”ν•œ AppKey 및 SecretKeyλ₯Ό μž…λ ₯ν•©λ‹ˆλ‹€.

    cp .env.example .env
    
    • KIWOOM_USE_MOCK=false둜 μ„€μ •ν•˜λ©΄ μ‹€μ œ 킀움 API μ„œλ²„μ—μ„œ μ‹€μ‹œκ°„ 정보λ₯Ό κ°€μ Έμ˜΅λ‹ˆλ‹€. true일 경우 λ‚΄μž₯된 λͺ¨μ˜ 포트폴리였 정보λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
  2. κ³„μ’Œ λ§€ν•‘ μ„€μ • 파일 (accounts_config.json) 생성: accounts_config.json.example νŒŒμΌμ„ λ³΅μ‚¬ν•˜μ—¬ accounts_config.json νŒŒμΌμ„ λ§Œλ“€κ³  μ‚¬μš© 쀑인 κ³„μ’Œ λ²ˆν˜Έμ™€ 각 κ³„μ’Œλ³„λ‘œ λΆ€μ—¬ν•˜κ³ μž ν•˜λŠ” νƒ€κ²Ÿ 투자 μ„Ήν„°λͺ…을 μž…λ ₯ν•©λ‹ˆλ‹€.

    cp accounts_config.json.example accounts_config.json
    

πŸ’» μ‹€ν–‰ 및 연동 κ°€μ΄λ“œ

1. 둜컬 단독 ν…ŒμŠ€νŠΈ

uvλ₯Ό 톡해 FastMCP μ„œλ²„λ₯Ό λͺ…λ Ήμ€„μ—μ„œ 직접 ꡬ동해 기동 μ—λŸ¬κ°€ μ—†λŠ”μ§€ κ²€μ¦ν•©λ‹ˆλ‹€.

uv run mcp_server.py
  • μ„œλ²„κ°€ μ •μƒμ μœΌλ‘œ κΈ°λ™λ˜λ©΄ mcp.server.fastmcp 엔진이 μž‘λ™ν•˜λ©° μž…μΆœλ ₯ λŒ€κΈ° μƒνƒœλ‘œ μ§„μž…ν•©λ‹ˆλ‹€.

2. Claude Desktop 연동 μ„€μ •

Claude Desktop μ•±μ—μ„œ 이 μ„œλ²„λ₯Ό 인식할 수 μžˆλ„λ‘ μ„€μ • 파일(config.json)에 μ•„λž˜μ™€ 같이 μΆ”κ°€ν•©λ‹ˆλ‹€.

  • μ„€μ • 파일 μœ„μΉ˜: C:\Users\<μ‚¬μš©μžλͺ…>\AppData\Roaming\EasyConnect\config.json λ˜λŠ” %APPDATA%\Claude\claude_desktop_config.json
  • μ„€μ • μΆ”κ°€ λ‚΄μš© (Windows μ˜ˆμ‹œ):
{
  "mcpServers": {
    "kiwoom-private-mcp-server": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "c:/Users/moony/home_document/kiwoom-rest-api/kiwoom-private-mcp-server",
        "mcp_server.py"
      ]
    }
  }
}

3. Cursor IDE 연동 μ„€μ •

  1. Cursor μ„€μ • (Settings -> Features -> MCP)으둜 μ΄λ™ν•©λ‹ˆλ‹€.
  2. + Add New MCP Server λ²„νŠΌμ„ λˆ„λ¦…λ‹ˆλ‹€.
  3. λ‹€μŒκ³Ό 같이 μž…λ ₯ν•©λ‹ˆλ‹€:
    • Name: kiwoom-private-mcp-server
    • Type: command
    • Command: uv run --directory c:/Users/moony/home_document/kiwoom-rest-api/kiwoom-private-mcp-server mcp_server.py

πŸ”’ λ³΄μ•ˆ 주의 사항

  • λ³Έ ν”„λ‘œμ νŠΈλŠ” 개인 투자 κ³„μ’Œ 및 λ―Όκ°ν•œ API 인증 정보(AppKey, SecretKey)λ₯Ό λ‹€λ£Ήλ‹ˆλ‹€.
  • μ ˆλŒ€ .env 파일과 accounts_config.json νŒŒμΌμ„ Public GitHub μ €μž₯μ†Œμ— 컀밋/ν‘Έμ‹œν•˜μ§€ μ•Šλ„λ‘ κ°λ³„νžˆ μœ μ˜ν•΄ μ£Όμ‹­μ‹œμ˜€. (기본적으둜 .gitignoreκ°€ λ°©μ–΄ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured