kiwoom-private-mcp-server
# π 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**](https://github.com/astral-sh/uv): Rust κΈ°λ°μΌλ‘ κ°λ°λ μ΄κ³ μ νμ΄μ¬ ν¨ν€μ§/νλ‘μ νΈ κ΄λ¦¬μ
* `mcp`: Anthropic Model Context Protocol SDK
* `requests`: API HTTP ν΅μ λΌμ΄λΈλ¬λ¦¬
* `python-dotenv`: λ‘컬 νκ²½ λ³μ(`.env`) λ‘λ λΌμ΄λΈλ¬λ¦¬
---
## π¦ μ€μΉ λ° λ‘컬 μ€μ
### 1. `uv` λꡬ μ€μΉ (Rust κΈ°λ°μ μ΄κ³ μ ν¨ν€μ§ λ§€λμ )
ν°λ―Έλ(PowerShell λλ bash)μμ μλ λͺ
λ Ήμ΄λ₯Ό μ€ννμ¬ `uv`λ₯Ό μ€μΉν©λλ€.
* **Windows (PowerShell)**:
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
* **macOS / Linux**:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
* **κΈ°μ‘΄ pipλ₯Ό μ¬μ©νλ κ²½μ°**:
```bash
pip install uv
```
### 2. κ°μνκ²½ κ΅¬μΆ λ° ν¨ν€μ§ μ€μΉ
νλ‘μ νΈ λ£¨νΈ λλ ν 리μμ λ€μ λͺ
λ Ήμ μ¬μ©νμ¬ μμ‘΄μ±μ μ΄κ³ μμΌλ‘ λκΈ°νν©λλ€.
```bash
# κ°μνκ²½(.venv) μμ±
uv venv
# pyproject.tomlμ μ μλ ν¨ν€μ§ μ€μΉ λ° λ‘컬 νλ‘μ νΈ λΉλ
uv pip install -e .
```
### 3. νκ²½ μ€μ νμΌ κ΅¬μ±
λ‘컬 보μ λ° κ³μ’ μ 보 λ§€νμ μν΄ μ€μ ν
νλ¦Ώ νμΌλ€μ 볡μ¬νμ¬ μ€μ μ€μ νμΌμ μμ±ν©λλ€. (μ΄ νμΌλ€μ `.gitignore`μ λ±λ‘λμ΄ κΉ κ΄λ¦¬μμ λ°°μ λ©λλ€.)
1. **νκ²½ λ³μ νμΌ (`.env`) μμ±**:
`.env.example` νμΌμ 볡μ¬νμ¬ `.env` νμΌμ λ§λ€κ³ ν€μ API μΈμ¦μ νμν AppKey λ° SecretKeyλ₯Ό μ
λ ₯ν©λλ€.
```bash
cp .env.example .env
```
* `KIWOOM_USE_MOCK=false`λ‘ μ€μ νλ©΄ μ€μ ν€μ API μλ²μμ μ€μκ° μ 보λ₯Ό κ°μ Έμ΅λλ€. `true`μΌ κ²½μ° λ΄μ₯λ λͺ¨μ ν¬νΈν΄λ¦¬μ€ μ 보λ₯Ό λ°νν©λλ€.
2. **κ³μ’ λ§€ν μ€μ νμΌ (`accounts_config.json`) μμ±**:
`accounts_config.json.example` νμΌμ 볡μ¬νμ¬ `accounts_config.json` νμΌμ λ§λ€κ³ μ¬μ© μ€μΈ κ³μ’ λ²νΈμ κ° κ³μ’λ³λ‘ λΆμ¬νκ³ μ νλ νκ² ν¬μ μΉν°λͺ
μ μ
λ ₯ν©λλ€.
```bash
cp accounts_config.json.example accounts_config.json
```
---
## π» μ€ν λ° μ°λ κ°μ΄λ
### 1. λ‘컬 λ¨λ
ν
μ€νΈ
`uv`λ₯Ό ν΅ν΄ FastMCP μλ²λ₯Ό λͺ
λ Ήμ€μμ μ§μ ꡬλν΄ κΈ°λ μλ¬κ° μλμ§ κ²μ¦ν©λλ€.
```bash
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 μμ)**:
```json
{
"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`κ° λ°©μ΄νκ³ μμ΅λλ€.)
TDQS
Scored across 2 tools
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.
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.
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.
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.