RedoxNet.Mcp.LsOpenApi
1.3.0
See the version list below for details.
{ "inputs": [ { "type": "promptString", "id": "ls_appkey", "description": "LS Securities OpenAPI AppKey", "password": true }, { "type": "promptString", "id": "ls_appsecretkey", "description": "LS Securities OpenAPI AppSecretKey", "password": true }, { "type": "pickString", "id": "ls_market", "description": "LS OpenAPI environment: real or virtual", "default": "real", "options": ["real", "virtual"] } ], "servers": { "RedoxNet.Mcp.LsOpenApi": { "type": "stdio", "command": "dnx", "args": ["RedoxNet.Mcp.LsOpenApi@1.3.0", "--yes"], "env": { "LS_APPKEY": "${input:ls_appkey}", "LS_APPSECRETKEY": "${input:ls_appsecretkey}", "LS_MARKET": "${input:ls_market}" } } } }
.vscode/mcp.json settings file.
dotnet tool install --global RedoxNet.Mcp.LsOpenApi --version 1.3.0
dotnet new tool-manifest
dotnet tool install --local RedoxNet.Mcp.LsOpenApi --version 1.3.0
#tool dotnet:?package=RedoxNet.Mcp.LsOpenApi&version=1.3.0
nuke :add-package RedoxNet.Mcp.LsOpenApi --version 1.3.0
RedoxNet.Mcp.LsOpenApi
MCP server for the LS 증권 OpenAPI — exposes Korean and US/overseas (Nasdaq / NYSE / AMEX) stock market data as MCP tools so AI assistants can query quotes, charts, ETF data, market screeners, and index / industry / theme context in natural language, alongside a local-only portfolio module (multi-account holdings, watchlists, watched themes, JSON backup / restore).
Unofficial third-party MCP server. Not affiliated with or endorsed by LS Securities Co., Ltd. (LS증권). v0.x.x scope: read-only market data + local portfolio notes (manual entry; no broker sync, no order placement).
Install
Prerequisite. dnx is the dotnet tool launcher that ships with .NET SDK 10 or later. Install from .NET downloads if you don't have it yet. Verify with dnx --help.
dnx fetches the latest published version from NuGet on every launch — no separate install step. Wire it into your MCP host:
Claude Desktop / Claude Code
claude_desktop_config.json (Claude Desktop) or .mcp.json at your workspace root (Claude Code):
{
"mcpServers": {
"lsopenapi": {
"command": "dnx",
"args": ["RedoxNet.Mcp.LsOpenApi", "--yes"],
"env": {
"LS_APPKEY": "...",
"LS_APPSECRETKEY": "...",
"LS_MARKET": "real" // default if omitted; use "virtual" only for LS mock accounts
}
}
}
}
Codex CLI
%USERPROFILE%\.codex\config.toml (Windows) or ~/.codex/config.toml (macOS / Linux):
[mcp_servers.lsopenapi]
command = "dnx"
args = ["RedoxNet.Mcp.LsOpenApi", "--yes"]
[mcp_servers.lsopenapi.env]
LS_APPKEY = "..."
LS_APPSECRETKEY = "..."
LS_MARKET = "real" # default if omitted; use "virtual" only for LS mock accounts
VS Code
Workspace .vscode/mcp.json:
{
"servers": {
"lsopenapi": {
"type": "stdio",
"command": "dnx",
"args": ["RedoxNet.Mcp.LsOpenApi", "--yes"],
"env": {
"LS_APPKEY": "...",
"LS_APPSECRETKEY": "...",
"LS_MARKET": "real" // default if omitted; use "virtual" only for LS mock accounts
}
}
}
}
FieldCure AssistStudio
Settings → Connect → Add MCP Server, then fill the dialog:
| Field | Value |
|---|---|
| Server Name | Any label, e.g. LS Open Api |
| Description (for AI) | Leave blank — auto-filled from the server on first connect |
| Transport | Stdio |
| Command | dnx |
| Arguments | RedoxNet.Mcp.LsOpenApi --yes — space-separated, no quotes or commas |
| Environment Variables | one KEY=VALUE per line (see below) |
LS_APPKEY=...
LS_APPSECRETKEY=...
LS_MARKET=real
AssistStudio renders the optional Plotly chart spec from ls_get_chart / ls_get_overseas_chart
inline in the chat — call either with include_chart=true (single timeframe) to get a
candlestick chart directly in the conversation.
Environment variables
| Name | Required | Description |
|---|---|---|
LS_APPKEY |
yes | LS OpenAPI app key. |
LS_APPSECRETKEY |
yes | LS OpenAPI app secret key. |
LS_MARKET |
no | real or virtual (default real). |
LS_TOOL_PROFILE |
no | standard (default — hides the 3 catalog tools from tools/list) or all (exposes them). |
LS_TOOL_PROFILE_STRICT |
no | true rejects a tools/call for a profile-hidden tool instead of honoring it (default false). |
LS_BASEURL |
no | Override REST base URL (rarely needed). |
LS_LOG_LEVEL |
no | Trace/Debug/Information/Warning/Error/Critical/None (default Information). |
LSOPENAPI_DB_PATH |
no | Override the local portfolio SQLite path. Default: alongside token.db. |
Credentials are accepted only through the process environment — never through chat, tool arguments, or MCP elicitation. Prompting for them in conversation would either log them or train callers to share them in transcripts, so that input path is intentionally closed off.
Local data lives at %LOCALAPPDATA%\RedoxNet\LsOpenApi\ on Windows and ~/.local/share/redoxnet/lsopenapi/ on Linux/macOS: token.db (auth cache, SHA-256 keyed) and portfolio.db (user-supplied holdings/watchlists; never read or written by tools outside the portfolio family).
Tools (37 in the standard profile, 40 in all)
Recent surface highlights (full history in RELEASENOTES.Mcp.md):
- v1.3 — first-class US/overseas stocks (Nasdaq / NYSE / AMEX):
ls_search_overseas_stock,ls_get_overseas_quote,ls_get_overseas_chart.ls_add_indicator/ls_reframe_chartaccept overseasdataset_ids through the shared handle cache. - v1.2 — chart side-channel adapts per host via MCP Apps capability negotiation (SEP-1865
io.modelcontextprotocol/ui+ aclientInfoallowlist). Text-only hosts get neitherinclude_chartnorstructuredContent.chart; chart-rendering hosts get the Plotly spec. - v1.1 — program-trading slice (
ls_get_program_trading,ls_analyze_program_flow). - v0.10 — surface compressed via five action-routed portfolio dispatchers (
ls_account,ls_watchlist,ls_watched_themes,ls_portfolio_io,ls_holding);LS_TOOL_PROFILEhides the 3 catalog tools by default.
Market data (LS-backed, credentials required)
ls_search_tr / ls_describe_tr / ls_call_tr are catalog tools — hidden in the default standard profile; set LS_TOOL_PROFILE=all to expose them.
| Tool | TR | Purpose |
|---|---|---|
ls_search_tr |
— | Search the embedded TR catalog by Korean / English keyword. |
ls_describe_tr |
— | Full InBlock / OutBlock schema for a specific TR. |
ls_call_tr |
any | Invoke any TR with a caller-supplied in_block. |
ls_get_quote |
t1101 |
Current price + 10-level order book. |
ls_get_multi_quote |
t8407 |
Up to 50 stocks per call. Accepts 6-character codes (digits, optionally one uppercase letter for ETFs e.g. 0117V0). |
ls_get_top_stocks |
t1441 / t1444 / t1452 / t1463 / t1466 |
Top gainers/losers, market cap, volume, trading value, and volume-surge screeners. |
ls_get_stock_info |
t1102 + t1716 |
PER/PBR/EPS, quarterly financials, 52-week + YTD ranges, top-5 brokerages, SPAC / 관리종목 flags, and an opt-in foreign ownership-level section. Pick blocks with sections (default snapshot+fundamentals). |
ls_get_chart |
t8410 / t8412 / t1301 |
OHLCV (day/week/month/year/min/tick), indicators (SMA/EMA/RSI/MACD/BB), token-efficient summary + dataset_id, multi-timeframe in one call, optional Plotly v5 chart spec. Raw bars only with output_mode='export'; with_warmup toggles the summary warm-up; summary.coverage explains any null indicators. |
ls_add_indicator |
(handle cache + chart TR) | Adds an indicator to a dataset_id returned by ls_get_chart or ls_get_overseas_chart and returns the updated summary + chart spec. KR and US datasets share the same cache. Example: "add MA200 too". |
ls_reframe_chart |
(handle cache + chart TR) | Reframes a dataset_id to a new period/count using the cached symbol. Works on both KR and US chart datasets. Example: "이걸 일봉으로 바꿔서 최근 6개월만 보여줘". |
ls_search_stock |
t8436 |
Name → code search with instrument filter (all / stock / etf). |
ls_get_etf_info |
t1901 |
ETF/ETN snapshot — NAV, 괴리율, 추적오차율, reference index, AUM, LP list. |
ls_get_etf_holdings |
t1904 |
ETF PDF (구성종목) — per-holding weight / valuation. limit caps the rows (default 20; limit=-1 for the full list). |
ls_get_global_market_quote |
t3521 |
Overseas index / FX / futures snapshot. Aliases include nasdaq, sp500, dow, soxx, usdkrw, wti, gold; raw LS symbols like NAS@IXIC are accepted. |
US / overseas individual stocks (LS-backed)
| Tool | TR | Purpose |
|---|---|---|
ls_search_overseas_stock |
g3104 + g3190 |
Ticker / Korean name / English name search across the LS overseas stock master. Ticker-pattern keywords short-circuit through a direct g3104 probe (so NVDA resolves to the real ticker, not an unrelated ETF whose name contains "NVDA"); name keywords fall back to a ranked paginated master scan. Returns keysymbol, exchcd, symbol for follow-up calls. |
ls_get_overseas_quote |
g3101 + opt. g3104 / g3106 |
Overseas stock quote snapshot — price, change %, OHLC, 52-week range, PER/EPS, optional company/security profile and 10-level order book. |
ls_get_overseas_chart |
g3204 / g3203 / g3202 |
OHLCV candles for US stocks — day/week/month/year (g3204), N분봉 (g3203), N틱 (g3202). Same indicator stack and summary / dataset_id / Plotly chart spec as ls_get_chart; response carries currency (USD for Nasdaq/NYSE/AMEX) and bar_timezone (America/New_York) so the model can disambiguate "5/22 일봉" as the NYSE session rather than an Asia/Seoul calendar date. |
Index + industry (LS-backed)
| Tool | TR | Purpose |
|---|---|---|
ls_get_index_quote |
t1511 |
Single Korean index snapshot. Aliases: kospi/kosdaq/kospi200/krx100. Returns value, change %, OHLC with timestamps, 52-week + YTD range, market breadth, and 4 related auxiliary indices. |
ls_get_index_history |
t1514 |
Daily/weekly/monthly index time series — per-bar OHLC, volume, breadth, foreign/institutional net flow. verbosity shapes the payload; output_mode=export caches the whole series under a dataset_id for no-API-call drill (from / to / recent_n). |
ls_get_industry_indices |
t8424 + t1511 fanout |
Top-N industry indices sorted by change %. 60s cache so repeated calls with different limit reuse one fanout. |
ls_get_industry_stocks |
t1516 |
Stocks inside one industry + the industry's index summary. Body-based paging. Accepts upcode or industry_keyword (LIKE on cached t8424 catalog). |
ls_get_market_funds_trend |
t8428 |
Market-liquidity time series — 고객예탁금, 신용잔고, 미수금, 선물예수금, and equity/mixed/bond/MMF fund money (억원). |
LS themes (LS-backed)
| Tool | TR | Purpose |
|---|---|---|
ls_get_theme_stocks |
t1537 |
Stocks inside one LS curated theme + summary (tmcnt/upcnt/uprate). Header-based tr_cont paging. Accepts theme_code or theme_keyword. |
ls_get_stock_themes |
t1532 |
Reverse lookup — every theme a stock belongs to. Empty array is a valid response. |
Screeners & per-stock analytics (LS-backed)
| Tool | TR | Purpose |
|---|---|---|
ls_get_fundamentals_rank |
t3341 |
Rank stocks by a fundamental metric: per / pbr / peg / eps / bps / roe / 매출액·영업이익·세전계속이익 증가율 / 부채비율 / 유보율. PER/PBR/PEG forced ascending. Each row carries the full fundamental snapshot so two metrics on the same stock are visible in one call. |
ls_get_investor_flow |
t1601 + t1702 |
Investor-type flow across 12 categories (개인 / 외국인 / 기관계 / 증권 / 투신 / 은행 / 보험 / 종금 / 기금 / 국가 / 기타 / 사모펀드). No shcode → intraday market-wide snapshot (six unlabeled segments). With shcode → single-stock daily time series with metric (volume/value/price) + direction (net/buy/sell) + cumulative toggle. |
ls_get_stock_events |
t3202 |
Per-stock corporate-action / 주주총회 calendar covering all 14 LS event types. kinds accepts English snake_case, Korean labels, or raw two-char upgu codes. TBD entries survive date filtering. |
ls_get_market_warnings |
t1404 + t1405 |
Union of the two KRX surveillance screens (13 designations: 관리 / 불성실공시 / 투자유의 / 투자환기 / 투자경고 / 매매정지 / 정리매매 / 투자주의 / 투자위험 / 위험예고 / 단기과열지정 / 이상급등 / 상장주식수부족). shcodes clips against holdings for "내 보유 중 관리종목" queries. |
ls_get_analyst_opinions |
t3401 |
Per-stock brokerage (sell-side) investment-opinion history — rating + target price before/after each change, broker, opinion-day close, plus a current-price snapshot. |
ls_get_short_selling_trend |
t1927 |
Per-stock daily short-selling (공매도) — short volume/value (백만원), short ratio, average short price, cumulative short volume, uptick-applied vs. exempt split. |
ls_get_high_low_stocks |
t1442 |
New-high / new-low (신고가 / 신저가) screener. direction, period (52w default), maintained (돌파유지 vs 일시돌파); ETF/ETN excluded by default. |
Program trading (LS-backed)
| Tool | TR | Purpose |
|---|---|---|
ls_get_program_trading |
t1662 / t1633 / t1636 / t1637 |
Program-trading (프로그램매매) flow. scope=market — intraday (t1662) or daily (t1633) market-wide 차익 / 비차익 net buying with the KOSPI200 index; scope=ranking — per-stock net-buy ranking (t1636) with a market-cap-normalized footprint ratio; scope=stock — one stock's intraday / daily flow (t1637). include_chart=true ships an inline Plotly v5 chart. |
ls_analyze_program_flow |
t1637 |
Program-trading footprint analysis for one stock — a regime (accumulation / distribution / churn / neutral), a 0–1 confidence, signals (persistence, churn ratio, intensity, intraday pace, price coupling), and plain-language evidence to narrate. |
Portfolio (local-only, no broker sync)
Manual entries persisted to portfolio.db next to token.db. v0.10 folds the twenty v0.9 portfolio tools into five action-routed dispatchers — each takes an action argument and validates the per-action required parameters — plus two standalone tools. List responses fall back to a quote_error envelope when LS credentials are missing, but saved data still returns.
| Tool | Actions | Purpose |
|---|---|---|
ls_account |
list / upsert / remove |
Registered accounts. upsert also renames a broker label across accounts (rename_broker_from mode); remove is a two-step confirm cascade with auto-succession of the default (id ASC). |
ls_holding |
set / buy / sell / remove / corporate_action |
Holding writes — initial state, weighted-average buy merge, partial/full sell (auto-remove at zero, InsufficientQuantity above the position), outright delete, and the open-enum corporate action (type ∈ split / reverse_split / bonus). |
ls_holdings_list |
— | Holdings grouped by account with per-account + total summary. Optional account, theme_code, theme_keyword, industry (FICS substring) filters (AND-combine). Standalone — the read path is the most common portfolio intent. |
ls_stocks_refresh_metadata |
— | Synchronous refresh for theme / FICS-industry caches. Default scope = holdings ∪ watchlist symbols when shcodes omitted. Standalone. |
ls_watchlist |
list / add / remove / group_upsert / group_delete |
Saved watchlist items and their groups. list takes scope (items / groups); group_upsert creates, updates, or renames a group (rename_from). |
ls_watched_themes |
list / add / remove |
Track LS theme codes (t1531 tmcode such as 0064); list carries each theme's avg percent change. |
ls_portfolio_io |
export / import |
Versioned JSON snapshot (schema v1) of accounts/holdings/watchlists/watched themes. import mode=replace requires confirm=true and writes a before-import-*.json auto-backup. |
Ambiguity policy. Reads fall back; writes require an explicit target when ambiguous. 0 accounts → RequiresAccount; 1 account → auto with applied_to echo; 2+ → AmbiguousAccount with candidates[] so the model can re-call without prompting the user. Every mutation response includes applied_to (single account) or applied_to[] with before/after snapshots (corporate actions).
Error envelopes. RequiresAccount / AmbiguousAccount / AccountNotFound / RequiresConfirmation / InsufficientQuantity / ValidationError — all carry structured fields (candidates, identifier, holding count + market value, etc.) so the LLM can recover automatically.
Full release notes: https://github.com/redoxnet/mcp-lsopenapi/blob/main/RELEASENOTES.Mcp.md
Documentation & source
- Project home: https://github.com/redoxnet/mcp-lsopenapi
- TR inventory: https://github.com/redoxnet/mcp-lsopenapi/blob/main/docs/LS-TR-INVENTORY.md
- SDK package: https://www.nuget.org/packages/RedoxNet.LsOpenApi.Core/
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.2 | 256 | 10/5/2026 |
| 1.6.1 | 157 | 10/4/2026 |
| 1.6.0 | 647 | 5/28/2026 |
| 1.5.1 | 424 | 5/27/2026 |
| 1.5.0 | 415 | 5/27/2026 |
| 1.4.0 | 381 | 5/26/2026 |
| 1.3.0 | 384 | 5/26/2026 |
| 1.2.0 | 158 | 5/22/2026 |
| 1.1.0 | 409 | 5/22/2026 |
| 1.0.0 | 426 | 5/21/2026 |
| 0.10.1 | 422 | 5/20/2026 |
| 0.10.0 | 148 | 5/20/2026 |
| 0.9.0 | 155 | 5/20/2026 |
| 0.8.0 | 150 | 5/20/2026 |
| 0.7.0 | 162 | 5/18/2026 |
| 0.6.0 | 150 | 5/16/2026 |
| 0.5.0 | 168 | 5/15/2026 |
| 0.4.0 | 148 | 5/15/2026 |
| 0.3.0 | 154 | 5/14/2026 |
| 0.2.0 | 151 | 5/14/2026 |
v1.3.0 — first-class overseas stock support. Adds ls_search_overseas_stock, ls_get_overseas_quote, and ls_get_overseas_chart over the LS g31xx/g32xx overseas-stock TRs, with optional profile/order-book enrichment and Plotly chart rendering. Existing tools are unchanged. See https://github.com/redoxnet/mcp-lsopenapi/blob/main/RELEASENOTES.Mcp.md.