Skip to main content
Glama
hamcheeseburger

toss-securities-mcp

toss-securities-mcp

토스증권 Open API를 감싸는 self-hosted MCP 서버입니다. 본인 API 키로 본인 머신에서 실행하고, Claude Desktop / Claude Code에 연결해 자연어로 계좌·시세를 조회할 수 있습니다.

"삼성전자 몇 주 들고 있어?" · "지난달 체결 내역 보여줘" · "AAPL 지금 얼마야?"

⚠️ 디스클레이머

  • 이 프로젝트는 토스증권 공식 제품이 아닌 비공식 커뮤니티 도구입니다.

  • 사용 시 토스증권 Open API 약관 준수 책임은 사용자 본인에게 있습니다.

  • 시세 정보는 본인 매매 목적으로만 사용 가능합니다 (약관).

  • 이 서버는 읽기 전용 조회 도구만 제공합니다. 주문(매수/매도) 기능은 없습니다.

  • self-hosted 전용입니다. 타인에게 호스팅 서비스 형태로 제공하지 마세요.

Related MCP server: tossinvest-mcp

제공 도구

도구

설명

get_account_balance()

계좌 잔고 요약 — 보유 주식 평가(매입/평가/손익) + 현금(KRW/USD 매수 가능 금액)

get_holdings(symbol?)

보유 종목 — 수량, 평단가, 현재가, 평가손익 (종목 필터 가능)

get_transactions(start_date, end_date, symbol?, only_filled?)

기간 내 체결 내역 (커서 페이징 자동 처리)

get_stock_price(symbols)

현재가 조회 (콤마 구분, 최대 200종목)

설치

요구사항: Python 3.12+, uv

git clone <this-repo>
cd toss-securities-mcp
uv sync

설정

  1. API 키 발급 — 토스증권 WTS 로그인 → 설정 → Open API 에서 client_id / client_secret 발급

  2. 환경변수 작성

cp .env.example .env
# .env 파일에 TOSS_CLIENT_ID, TOSS_CLIENT_SECRET 입력
  1. accountSeq 확인 + 스모크 테스트 (실계좌 읽기 전용 조회)

uv run scripts/smoke_test.py

출력된 accountSeq 값을 .envTOSS_ACCOUNT_SEQ에 입력하세요.

🔑 .env는 절대 커밋하지 마세요 (.gitignore에 포함되어 있습니다). 키가 노출되면 즉시 토스증권에서 재발급하세요.

Claude Desktop 연결

claude_desktop_config.json에 추가:

{
  "mcpServers": {
    "toss-securities": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/toss-securities-mcp", "server.py"],
      "env": {
        "TOSS_CLIENT_ID": "발급받은 client_id",
        "TOSS_CLIENT_SECRET": "발급받은 client_secret",
        "TOSS_ACCOUNT_SEQ": "계좌 accountSeq"
      }
    }
  }
}

Claude Code 연결

claude mcp add toss-securities \
  -e TOSS_CLIENT_ID=... -e TOSS_CLIENT_SECRET=... -e TOSS_ACCOUNT_SEQ=... \
  -- uv run --directory /absolute/path/to/toss-securities-mcp server.py

개발

uv run pytest          # 단위 테스트 (실 API 호출 없음, MockTransport)
uv run mypy            # 타입 체크 (strict)

로드맵

이 저장소는 더 큰 시스템의 Phase 1입니다:

  • Phase 1 (이 저장소): 토스 MCP — 계좌·시세 조회

  • Phase 2: portfolio-aggregator-mcp — 멀티 증권사 통합, FIFO 누적 실현손익(Lifetime Realized P/L), 행동 패턴 분석

  • Phase 4: NH QV MCP

라이선스

MIT

Available Tools

4 tools
get_account_balanceA

계좌 잔고 요약을 조회합니다.

사용자가 "내 계좌 잔고", "총 자산", "예수금/현금 얼마 있어" 등을 물을 때 호출하세요. 보유 주식 평가 요약(매입금액·평가금액·평가손익)과 현금(매수 가능 금액, KRW/USD)을 함께 반환합니다.

참고: 현금은 미수를 제외한 '현금 기반 매수 가능 금액'으로, 예수금과 미세하게 다를 수 있습니다. 금액 필드는 정밀도 보존을 위해 문자열입니다.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that cash amounts may differ from deposits and that amount fields are strings for precision. It clearly explains the returned components. However, it does not mention error conditions, caching, or authentication requirements.

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: two front-loaded sentences covering purpose and usage, followed by a necessary nuance paragraph. Every sentence adds value without redundancy.

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

Completeness4/5

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

Given the zero-parameter complexity and existence of an output schema, the description covers the key points: what is returned and a notable cash precision detail. It could briefly mention error scenarios or context assumptions, but it is largely complete.

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?

The input schema has zero parameters, so there is no parameter description needed. The description adds value by detailing what the tool returns, which indirectly informs the agent that no input is required.

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 clearly states it retrieves an account balance summary ('계좌 잔고 요약을 조회합니다'), listing specific components (stock valuation summary, cash amounts) that distinguish it from sibling tools like get_holdings or get_stock_price.

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

Usage Guidelines4/5

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

The description provides explicit example queries ('내 계좌 잔고', '총 자산', '예수금/현금 얼마 있어') indicating when to use this tool. It does not explicitly state when not to use it or mention alternatives, but the examples cover typical use cases well.

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

get_holdingsA

보유 주식을 조회합니다.

사용자가 "보유 종목", "내 주식", "뭐 들고 있어", "삼성전자 몇 주 있어" 등을 물을 때 호출하세요. 종목별 수량·평단가·현재가·평가손익과 전체 합산 요약을 반환합니다. symbol을 지정하면 해당 종목만 조회합니다 (국내: 6자리 코드 예 "005930", 미국: 티커 예 "AAPL").

금액·수량 필드는 정밀도 보존을 위해 문자열입니다. rate 필드는 소수 (0.1077 = +10.77%)입니다.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description discloses important behavioral traits: return fields (quantity, average price, current price, P/L, summary), data types (strings for precision, decimals for rates). Could mention caching or rate limits, but adequate.

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 well-structured: purpose, usage context, output summary, parameter details, data format notes. Every sentence adds value without redundancy.

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

Completeness5/5

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

Given the single parameter and existence of an output schema, the description covers usage, input format, output fields, and data representation thoroughly. No missing critical information.

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

Parameters5/5

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

Schema coverage is 0%, but the description fully documents the symbol parameter: domestic 6-digit code, US ticker, and optional behavior. This compensates completely for the schema gap.

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 clearly states the specific verb '조회' (query) and the resource '보유 주식' (holdings stocks). It also distinguishes from sibling tools by focusing on holdings versus balance, price, or transactions.

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

Usage Guidelines4/5

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

The description provides explicit when-to-use examples ('보유 종목', '내 주식', etc.) and explains the optional symbol filter. It does not explicitly mention alternatives, but context from sibling names makes it clear.

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

get_stock_priceA

종목의 현재가를 조회합니다.

사용자가 "삼성전자 지금 얼마야", "AAPL 현재가" 등 시세를 물을 때 호출하세요. symbols는 콤마로 구분해 최대 200개까지 한 번에 조회할 수 있습니다 (국내: 6자리 코드 예 "005930", 미국: 티커 예 "AAPL,MSFT").

⚠️ 시세 정보는 토스증권 약관상 본인 매매 목적으로만 사용할 수 있습니다.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It identifies the operation as a read (current price) and discloses a usage restriction (personal trading only) and a capacity limit (200 symbols). However, it does not detail error handling or authentication requirements.

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 concise and front-loaded with the purpose. It uses two short paragraphs, but the warning about terms of use adds necessary behavioral context. Could be slightly more compact, but overall effective.

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

Completeness4/5

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

Given the simple single-parameter tool and the existence of an output schema, the description covers purpose, usage, parameter format, and restrictions. No significant gaps are present for this complexity level.

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

Parameters5/5

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

The input schema has 0% description coverage for the symbols parameter. The description compensates fully by explaining it is comma-separated, up to 200 symbols, with examples for domestic (6-digit codes) and US (tickers). This provides complete semantic meaning.

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 explicitly states it retrieves the current price of a stock ('종목의 현재가를 조회합니다') and provides usage context. It clearly distinguishes from sibling tools (account balance, holdings, transactions) which cover different financial data.

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

Usage Guidelines4/5

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

The description gives explicit when-to-use guidance: call when user asks about current stock price. It also specifies the symbol format and a batch limit of 200. It does not explicitly list when not to use, but the sibling tools cover other use cases.

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

get_transactionsA

기간 내 거래(체결) 내역을 조회합니다.

사용자가 "거래내역", "매매 내역", "지난달 뭐 샀어/팔았어", "체결 내역" 등을 물을 때 호출하세요. 날짜는 "YYYY-MM-DD" 형식이며 주문 생성 시간(KST) 기준 inclusive입니다. symbol 지정 시 해당 종목만 조회합니다.

only_filled=True(기본)면 체결된 주문(FILLED, PARTIAL_FILLED)만 반환하고, False면 취소·거부된 주문도 포함합니다. 각 항목의 execution 필드에 체결 수량·평균 체결가·수수료·세금이 담겨 있습니다.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolNo
end_dateYes
start_dateYes
only_filledNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses date format, timezone (KST), inclusive range, symbol filtering, only_filled behavior, and output field contents (execution). Does not cover pagination or rate limits, but sufficient for typical use.

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?

Two paragraphs with clear front-loading: first sentence states purpose, then usage guidance, then parameter details. No superfluous text, though could be slightly more compact.

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

Completeness4/5

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

Given 4 parameters, output schema exists, and no annotations, the description covers parameter semantics, filter defaults, and output field hints. Missing sorting or error handling, but adequate for the tool's complexity.

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?

Schema coverage is 0%, but description explains start_date/end_date format and inclusiveness, symbol as optional filter, and only_filled with default and behavior. Adds significant meaning beyond schema names.

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 clearly states the verb ('retrieves') and resource ('transaction/execution history'). It differentiates from siblings by focusing on transaction records, while siblings handle balance, holdings, and stock price.

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

Usage Guidelines4/5

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

Explicitly lists example user queries that should trigger this tool (e.g., 'transaction history', 'what did I buy/sell last month'). Lacks explicit when-not-to-use but provides clear context.

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. 4 tool updatesv0.1.0
    • First observedget_account_balance
    • First observedget_holdings
    • First observedget_stock_price
    • First observedget_transactions

TDQS

A4.4/5.0
Disambiguation5/5

Each tool targets a distinct aspect of securities (balance, holdings, price, transactions). No overlap in purpose; descriptions clearly differentiate them.

Naming Consistency5/5

All tools follow a consistent 'get_noun' pattern in snake_case, making it easy to infer functionality from names.

Tool Count5/5

Four tools cover the core read-only needs for a securities account (balance, holdings, price, transactions). This is well-scoped and not excessive.

Completeness4/5

Covers essential read operations but lacks any write/trading tools. For a purely informational server it is complete; for trading, order placement is missing.

Maintenance

ActivityMaintained
ResponsivenessSyncing

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

  • 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
    A
    quality
    C
    maintenance
    MCP server wrapping Toss Securities Open API, enabling stock price queries and trading for Korean and US stocks via natural language.
    36
    40
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Read-only MCP server that connects LLMs to personal investment accounts (Toss Securities, KIS), market data, SEC filings, and Binance futures for context-aware investment responses.
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A local MCP server that automatically generates tools from Toss Securities' official OpenAPI spec, enabling real API calls with multi-layered order safety and OAuth 2.0 authentication.
    36
    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/hamcheeseburger/tossinvest-open-api-mcp'

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