Skip to main content
Glama
moony211

kiwoom-private-mcp-server

by moony211

πŸ“Š kiwoom-private-mcp-server

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


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

  • get_accounts: μ‚¬μš©μžκ°€ μ •μ˜ν•œ ν‚€μ›€μ¦κΆŒ κ³„μ’Œ λͺ©λ‘κ³Ό 각 κ³„μ’Œλ³„ νƒ€κ²Ÿ μ„Ήν„° 정보λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.

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


Related MCP server: kiwoom-mcp

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

  • 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κ°€ λ°©μ–΄ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.)

Available Tools

2 tools
get_account_balanceA

νŠΉμ • κ³„μ’Œμ˜ 총 평가 μžμ‚° 및 상세 보유 μ’…λͺ© 리슀트(ν‰κ°€κΈˆμ•‘, 비쀑, 평단가 λ“±)λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.

Args: account_no: μ‘°νšŒν•  ν‚€μ›€μ¦κΆŒ κ³„μ’Œ 번호 (예: '61724222') use_mock: Mock 데이터λ₯Ό κ°•μ œλ‘œ μ‚¬μš©ν• μ§€ μ—¬λΆ€ (κΈ°λ³Έκ°’: None, .env의 KIWOOM_USE_MOCK 섀정을 따름)

Returns: JSON ν˜•μ‹μ˜ κ³„μ’Œ μž”κ³  및 보유 μ’…λͺ© 데이터

ParametersJSON Schema
NameRequiredDescriptionDefault
use_mockNo
account_noYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description lacks behavioral disclosures such as authentication requirements, rate limits, error handling, or side effects. With no annotations provided, the description carries the full burden, and it fails to disclose whether the operation is read-only or if it requires prior account setup.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the purpose, and structured with clear Args and Returns sections. Every sentence adds value, with no redundant or vague phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (implied by the Returns description), the description provides adequate information about the return value. However, it omits details on error handling, prerequisites (like account number validity), and the relationship to the sibling tool 'get_accounts'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema provides no parameter descriptions (0% coverage), the description compensates by explaining 'account_no' as a Kiwoom securities account number with an example, and 'use_mock' with its default behavior based on environment settings. This adds significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb '쑰회' (retrieve) and clearly identifies the resource as a specific account's total evaluation assets and detailed holdings list. It distinguishes itself from the sibling tool 'get_accounts' which likely lists all accounts, thus providing clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description explains the parameters, it does not provide explicit guidance on when to use this tool versus alternatives. No when-not-to-use scenarios or preconditions are mentioned, leaving the agent to infer context from the sibling tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_accountsB

μ„€μ •λœ ν‚€μ›€μ¦κΆŒ κ³„μ’Œ λͺ©λ‘κ³Ό 각 κ³„μ’Œλ³„λ‘œ μ§€μ •λœ νƒ€κ²Ÿ μ„Ήν„° 및 상세 μ„€λͺ…을 μ‘°νšŒν•©λ‹ˆλ‹€.

Returns: JSON ν˜•μ‹μ˜ κ³„μ’Œ λͺ©λ‘ 데이터

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not explicitly state that the tool is read-only or has no side effects. With no annotations, the description should include such context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and front-loaded with the purpose. The 'Returns:' line is somewhat redundant given the output schema but does not detract significantly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (zero parameters, output schema exists), the description is adequate. However, it misses the chance to contrast with the sibling tool, leaving some context incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, schema coverage is 100%, so the baseline is 3. The description adds value by specifying that returned data includes target sectors and descriptions, going beyond the schema's lack of parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves a list of accounts with target sectors and descriptions, providing a specific verb and resource. However, it does not differentiate from the sibling 'get_account_balance'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, lacking any when-not or context cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedget_account_balance
    • First observedget_accounts

TDQS

B3.3/5.0
Disambiguation5/5

The two tools, get_account_balance and get_accounts, have clearly distinct purposes: one retrieves detailed holdings and balance for a specific account, while the other lists all accounts with their metadata. There is no overlap or ambiguity.

Naming Consistency5/5

Both tool names follow a consistent verb_noun snake_case pattern (get_account_balance, get_accounts). The naming is predictable and clearly indicates the action and resource.

Tool Count2/5

With only two tools, the server is well below the typical 3-15 tool range for a comprehensive service. While the tools are focused, a trading platform like Kiwoom would typically require many more operations (e.g., placing orders, history), making the tool set feel incomplete.

Completeness2/5

The tool set only covers reading account info (list and balance). For a securities trading server, obvious operations like order management, stock search, and transaction history are missing. This leaves significant gaps that would hinder agent workflows.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Provides comprehensive Taiwan stock market data and analysis through MCP tools. Enables querying real-time stock prices, historical data, company information, technical analysis, and market overviews for TWSE and TPEx listed companies.
    8
    15
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    An 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.
    11
    2
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides Korean stock market data (KOSPI, KOSDAQ, KONEX) including prices, fundamentals, investor trading, short selling, and indices via MCP protocol, enabling natural language queries from AI agents like ChatGPT and Claude.
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Read-only MCP server for Kiwoom Securities, enabling natural language queries of Korean stock market data and account information, including ISA tax status.
    49
    322
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/moony211/kiwoom-private-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server