# Miraeasset Account Mcp Unofficial

> Mirae Asset Securities Account Data MCP Server (Unofficial)

- **Type:** MCP server
- **Install:** `agentstack add mcp-astro36-miraeasset-account-mcp-unofficial`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Astro36](https://agentstack.voostack.com/s/astro36)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Astro36](https://github.com/Astro36)
- **Source:** https://github.com/Astro36/miraeasset-account-mcp-unofficial

## Install

```sh
agentstack add mcp-astro36-miraeasset-account-mcp-unofficial
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Miraeasset Account MCP (Unofficial)

> **⚠️ This is an unofficial, community-made MCP server. It is not affiliated with, endorsed by, or supported by Mirae Asset Securities (미래에셋증권). Use at your own risk.**

An [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that exposes your [Mirae Asset Securities](https://securities.miraeasset.com) account data to AI assistants such as Claude. It authenticates via a headless browser and queries the internal web API to retrieve your portfolio holdings and performance data.

---

## How It Works

1. On first use, a headless Chromium browser logs in to the Mirae Asset web portal using your credentials.
2. The session cookie (`MIREADW_D`) is extracted and cached in memory.
3. All subsequent data requests use that cookie to call the internal JSON APIs directly — no browser overhead.

---

## Available Tools

### `get_account_numbers`
Returns a list of your account numbers in formatted form (e.g. `123-45-678901`).

---

### `get_cash_equivalents`
Returns cash and cash-equivalent assets across all accounts, including:
- **Foreign currencies** — currency code, exchange rate, withdrawable market value
- **RP (Repurchase Agreement) products** — product name, maturity date, entry value, current value

Example response item:
```json
{
  "type": "foreign_currency",
  "account_number": "123-45-678901",
  "name": "USD",
  "currency": "USD",
  "exchange_rate": 1380.5,
  "market_value": 1500.0
}
```

---

### `get_equities`
Returns equity holdings (stocks and ETFs) across all accounts.

Each item includes:
- `account_number` — formatted account number
- `name` — asset name
- `symbol` — ticker/ISIN
- `currency` — denomination currency
- `exchange_rate` — KRW exchange rate
- `quantity` — number of shares held
- `market_value` — current market value in the asset's currency
- `entry_value` — total purchase cost in KRW

---

### `get_gold_spots`
Returns gold spot position assets. Same schema as `get_equities`.

---

### `get_all_assets`
Convenience tool that fetches all asset types in a single call.

Returns:
```json
{
  "cash_equivalents": [...],
  "equities": [...],
  "gold_spots": [...]
}
```

---

### `get_performance(start_date, end_date?)`
Returns a **single aggregated PnL record** for the entire date range — useful for monthly summaries or year-to-date performance.

- `start_date` — required, `YYYY-MM-DD`
- `end_date` — optional, defaults to today

Example response:
```json
{
  "start_date": "2025-01-01",
  "end_date": "2025-03-29",
  "initial_value": 10000000,
  "closing_value": 11200000,
  "cash_inflow": 500000,
  "cash_outflow": 200000
}
```

Fields use the **time-weighted return** methodology (holding-period return). `cash_inflow` and `cash_outflow` account for both deposits/withdrawals and realized gains/losses.

---

### `get_weekly_performance(start_date, end_date?)`
Returns PnL records **broken down week by week** (Monday–Sunday). Useful for charting performance trends or identifying which weeks drove returns.

- `start_date` — required, `YYYY-MM-DD`
- `end_date` — optional, defaults to today

Returns a list of records with the same schema as `get_performance`.

---

## Setup

### Prerequisites

- Python 3.12+
- Google Chrome / Chromium + matching `chromedriver` on your `PATH`
- A Mirae Asset Securities web login account

### Installation

```bash
git clone https://github.com/your-username/miraeasset-account-mcp-unofficial.git
cd miraeasset-account-mcp-unofficial
pip install -e .
```

### Configuration

Copy `.env.example` to `.env` and fill in your credentials:

```bash
cp .env.example .env
```

```env
MIRAE_USER_ID=your_login_id
MIRAE_USER_PASSWORD=your_password
```

> Your credentials are only used locally to obtain a session cookie. They are never sent anywhere other than the official Mirae Asset login page.

### Running

```bash
python server.py
```

The server communicates over stdio (standard MCP transport).

---

## Docker

A Docker setup is included that bundles Chromium and chromedriver — no local Chrome installation needed.

### Using Docker Compose (recommended)

```bash
# Make sure .env is configured
docker compose up --build
```

### Manual Docker

```bash
docker build -t miraeasset-mcp .
docker run --env-file .env -i miraeasset-mcp
```

---

## Connecting to Claude Desktop

Add the following to your `claude_desktop_config.json`:

**Without Docker (local Python):**
```json
{
  "mcpServers": {
    "miraeasset": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"],
      "env": {
        "MIRAE_USER_ID": "your_login_id",
        "MIRAE_USER_PASSWORD": "your_password"
      }
    }
  }
}
```

**With Docker:**
```json
{
  "mcpServers": {
    "miraeasset": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "MIRAE_USER_ID=your_login_id",
        "-e", "MIRAE_USER_PASSWORD=your_password",
        "miraeasset-mcp"
      ]
    }
  }
}
```

---

## Example Prompts

Once connected to an AI assistant, you can ask things like:

- *"What stocks do I currently hold?"*
- *"Show me my total portfolio value including foreign currencies."*
- *"How did my portfolio perform this year so far?"*
- *"Give me a week-by-week breakdown of my returns for Q1 2025."*
- *"What RP products do I have and when do they mature?"*

---

## Security Notes

- Credentials are read from environment variables and never logged or persisted.
- The session token is stored in memory only and lost when the process exits.
- This server uses Mirae Asset's **internal web APIs** — the same ones used by their mobile web portal. These APIs are not publicly documented and may change without notice.

---

## Disclaimer

This project is not affiliated with or endorsed by Mirae Asset Securities. The internal APIs used here are undocumented and subject to change at any time without notice. This tool is provided as-is with no warranty. The author is not responsible for any issues arising from its use, including but not limited to account access problems or data inaccuracies.

---

## License

See [LICENSE](LICENSE).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Astro36](https://github.com/Astro36)
- **Source:** [Astro36/miraeasset-account-mcp-unofficial](https://github.com/Astro36/miraeasset-account-mcp-unofficial)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-astro36-miraeasset-account-mcp-unofficial
- Seller: https://agentstack.voostack.com/s/astro36
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
