toss-invest-mcp
Sends optional 6-digit order confirmation codes to the user's phone via ntfy notifications, requiring manual entry to authorize trades.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@toss-invest-mcp what's SOXL RSI? if oversold, preview buying 10 shares"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
toss-invest-mcp
토스증권 Open API를 Claude · Cursor 같은 AI 클라이언트에서 쓸 수 있게 해주는 비공식 MCP 서버입니다. 시세·차트·기술지표·잔고 조회는 자유롭게, 주문은 여러 겹의 안전장치를 거쳐서만 나갑니다.
⚠️ 토스증권과 무관한 개인 프로젝트입니다. 실제 돈이 오가는 도구이니 기본값(모의 주문)으로 충분히 써본 뒤에
live로 바꾸세요. 이 소프트웨어 사용으로 생긴 손실에 대해 작성자는 책임지지 않습니다 (MIT 라이선스).
할 수 있는 것
나: SOXL 지금 RSI 어때? 과매도면 10주 LOC 매수 미리보기 만들어줘
AI: (technicals → preview_order) RSI 27.4로 과매도 구간이에요.
[실주문] SOXL LOC(장마감 지정가) 매수 10주 @ 24.50 · 예상 금액 약 $245.00
⚠️ 레버리지/인버스 상품 (배수 3) ...
실행할까요?분류 | 툴 |
시세 |
|
지표 |
|
시장 |
|
계좌 |
|
주문 |
|
국내(6자리 코드)와 미국(티커) 주식 모두 지원합니다. 지정가, 시장가, LOC(장마감 지정가), 미국 금액 주문과 소수점 매도도 됩니다.
Related MCP server: io.github.kcw2034/toss-invest-mcp
주문 안전장치
AI가 실수하거나 프롬프트 인젝션에 당해도 사고가 커지지 않도록 설계했습니다.
2단계 주문:
preview_order로 한도·잔고·매도가능수량을 검사한 미리보기를 먼저 만들고, 사용자가 확인한 뒤에만place_order(preview_id)를 호출합니다. 미리보기는 5분 뒤 만료되고 한 번만 실행됩니다. 확인코드를 5번 틀리면 미리보기가 폐기됩니다.모드:
off(주문 툴 차단) /dry_run(기본값, 모의 체결) /live(실주문).매수 한도 (선택): 기본은 무제한이고, 사람이 환경변수로 직접 설정합니다. 1회·일일 금액 한도(USD/KRW 각각)와 일일 매수 건수 한도를 걸 수 있고, 시장가는 현재가에 3% 버퍼를 얹어 보수적으로 계산합니다. 매도는 손절이 막히지 않도록 한도 대상이 아닙니다 (매도가능수량 검사는 그대로). AI는 한도를 바꿀 수 없습니다.
허용 종목:
ALLOWED_SYMBOLS=AAPL,TSLA처럼 지정하면 다른 종목은 주문할 수 없습니다.킬스위치:
toss-invest-mcp kill on을 실행하면 재시작 없이 즉시 새 주문이 막힙니다. 취소는 계속 됩니다.폰 확인코드 (선택):
NTFY_TOPIC을 설정하면 6자리 코드가 ntfy 앱으로만 전송됩니다. AI는 코드를 볼 수 없어서 사람이 직접 입력해야만 주문이 나갑니다.멱등키:
preview_id를clientOrderId로 보내므로 네트워크 오류로 재시도해도 주문은 한 번만 접수됩니다.레버리지/인버스 경고와 현재가에서 멀리 떨어진 지정가 경고를 표시합니다.
모든 미리보기·실행·거절 내역을
orders.log.jsonl에 기록합니다.
준비
토스증권 Open API에서 API 키(Client ID / Secret)를 발급받습니다.
WTS > 설정 > Open API > 허용 IP 에 이 서버를 실행할 컴퓨터의 공인 IP를 등록합니다. (
curl ifconfig.me)Python 3.10 이상과 uv를 설치합니다 (pip도 됩니다).
토스는 Client 하나당 유효 토큰이 1개뿐입니다. 이 서버는 토큰을
DATA_DIR/token.json에 캐시해서 공유하니, 같은 키로 다른 스크립트를 함께 돌리면 토큰이 서로를 무효화할 수 있습니다.
설치 & 연결
Claude Desktop / Cursor / 그 밖의 stdio 클라이언트
{
"mcpServers": {
"toss-invest": {
"command": "uvx",
"args": ["--from", "git+https://github.com/jihwan0102/toss-invest-mcp", "toss-invest-mcp"],
"env": {
"TOSS_CLIENT_ID": "...",
"TOSS_CLIENT_SECRET": "...",
"TRADING_MODE": "dry_run"
}
}
}
}Claude Code
claude mcp add toss-invest \
-e TOSS_CLIENT_ID=... -e TOSS_CLIENT_SECRET=... -e TRADING_MODE=dry_run \
-- uvx --from git+https://github.com/jihwan0102/toss-invest-mcp toss-invest-mcpclaude.ai 커스텀 커넥터 (원격 HTTP)
허용 IP가 고정된 서버(VPS 등)에서 실행합니다.
uv tool install git+https://github.com/jihwan0102/toss-invest-mcp
cp .env.example toss.env && chmod 600 toss.env # 값 채우기
echo "MCP_PATH_SECRET=$(toss-invest-mcp gen-secret)" >> toss.env
toss-invest-mcp --env-file toss.env serve --http # 127.0.0.1:8000그다음 HTTPS 리버스 프록시(nginx, Caddy)를 앞에 두고 claude.ai > 설정 > 커넥터에
https://<도메인>/<MCP_PATH_SECRET>/mcp 를 등록합니다. 이 URL은 비밀번호나 마찬가지입니다.
헤더를 지원하는 클라이언트라면 MCP_AUTH_TOKEN 으로 Bearer 인증도 쓸 수 있습니다.
systemd 유닛과 nginx 예시는 deploy/에 있습니다.
관리 명령
toss-invest-mcp check # 키와 허용 IP 확인 (조회만 함)
toss-invest-mcp status # 모드, 매수 한도, 오늘 사용량
toss-invest-mcp kill on|off # 킬스위치
toss-invest-mcp logs -n 50 # 주문 로그
toss-invest-mcp gen-secret # 비밀값 생성모든 명령에 --env-file <파일> 을 줄 수 있습니다.
설정 (환경변수)
변수 | 기본값 | 설명 |
| 토스 Open API 키 (필수) | |
| 자동 | 계좌가 여러 개일 때 지정 (기본: 첫 종합매매 계좌) |
|
|
|
| 무제한 | 1회 매수 한도 (비우거나 |
| 무제한 | 일일 누적 매수 한도 (KST 기준) |
| 무제한 | 일일 매수 주문 건수 |
| 전체 | 콤마 구분 허용 종목 |
|
| 미리보기 유효 시간 |
|
| 시장가 금액 추정 버퍼 |
| / | 폰 확인코드 (토픽은 추측 못 하게 길게) |
|
| 토큰 캐시, 장부, 로그, 킬스위치 |
| HTTP 경로 비밀값 ( | |
| HTTP Bearer 토큰 | |
|
| HTTP 대기 주소 |
| 프록시 뒤 공개 호스트명 (Host 헤더 검사용) | |
| claude.ai, localhost | 허용 Origin |
개발
uv venv && uv pip install -e '.[dev]'
.venv/bin/pytest && .venv/bin/ruff check .테스트는 토스 API를 httpx.MockTransport 로 흉내 내므로 키 없이 돌아갑니다.
라이선스
MIT
Available Tools
17 toolsbuying_powerBRead-only
현금 기준 매수 가능 금액 (미수 제외).
Inputs: currency. Returns: object
cancel_orderADestructive
미체결 주문 취소. 위험을 줄이는 동작이라 킬스위치가 켜져 있어도 된다. dry_run 모드면 모의 취소.
Inputs: order_id (required). Returns: object
candlesBRead-only
캔들(OHLCV) 조회. interval 은 '1d'(일봉) 또는 '1m'(1분봉), count 최대 200. 최신 봉이 배열 첫 번째.
Inputs: symbol (required), count, interval. Returns: object
fx_usdkrwARead-only
원/달러 환율 (토스 표시 환율, 1분 갱신. 실제 체결 환율과 다를 수 있음).
Inputs: no named parameters. Returns: object
holdingsBRead-only
보유 주식과 평가손익. symbol 을 주면 그 종목만.
Inputs: symbol. Returns: object
kr_marketARead-only
국내 지수/국채 금리 현재가. 지원: KOSPI, KOSDAQ, KR_BOND_2Y/3Y/5Y/10Y/20Y/30Y.
Inputs: symbols. Returns: object
market_hours_usARead-only
미국장 세션 시간(데이마켓/프리/정규/애프터, 전일·당일·익일). 모든 시간 KST.
Inputs: no named parameters. Returns: object
orderbookCRead-only
호가(매수/매도 잔량) 조회.
Inputs: symbol (required). Returns: object
order_detailCRead-only
주문 상세 (체결 수량, 평균 체결가, 수수료 등).
Inputs: order_id (required). Returns: object
order_logBRead-only
이 서버가 남긴 최근 주문 관련 로그 (미리보기, 실행, 거절, 취소).
Inputs: n. Returns: object
ordersARead-only
주문 목록. OPEN=미체결/진행 중 전체, CLOSED=종료된 주문 (limit 최대 100).
Inputs: limit, status, symbol. Returns: object
place_orderADestructive
preview_order 로 만든 주문을 실행한다. 사용자가 미리보기를 보고 명시적으로 실행하라고 했을 때만 호출. 확인코드(폰 전송) 설정이면 사용자가 직접 입력한 6자리 코드를 confirm_code 로 넘긴다. 같은 preview_id 는 한 번만 실행된다.
Inputs: preview_id (required), confirm_code. Returns: object
preview_orderARead-only
주문 미리보기 (실제 주문 안 나감). 한도·잔고·매도가능수량을 검사하고 preview_id 를 돌려준다.
order_type: LIMIT(지정가), MARKET(시장가), LOC(미국주식 장마감 지정가 = 조건 만족 시 종가에 체결)
quantity: 주 수량 (소수점은 미국 시장가 매도만). order_amount_usd: 금액 주문 (미국 시장가만, 정규장 중).
price: LIMIT/LOC 필수. LOC 매도는 '이 가격 이상이면 종가로 판다', LOC 매수는 '이 가격 이하면 종가로 산다'. 결과 summary 와 warnings 를 사용자에게 그대로 보여주고, 사용자가 실행하라고 하면 place_order(preview_id) 를 호출한다.
Inputs: side (required), symbol (required), order_type (required), price, +2 more. Returns: object
quoteARead-only
현재가 조회. symbols 는 콤마 구분 (예: 'AAPL,TSLA' 또는 '005930,000660'). 미국은 티커, 국내는 6자리 코드.
Inputs: symbols (required). Returns: object
stock_infoCRead-only
종목 기본 정보: 이름, 시장, 통화, 상장 상태, 레버리지 배수(leverageFactor) 등.
Inputs: symbols (required). Returns: object
technicalsARead-only
기술 지표 요약: RSI(14, Wilder), 볼린저(20, 2σ), 이동평균 5/20/60, 1·5·20봉 등락률, 연속 상승/하락, 조회 구간 고점 대비 위치. 최근 120봉 기준. 마지막 봉이 진행 중이면 실시간 값이다.
Inputs: symbol (required), interval. Returns: object
trading_statusARead-only
주문 안전장치 상태: 모드(off/dry_run/live), 킬스위치, 1회·일일 한도, 오늘 사용량, 허용 종목, 확인 방식.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have clearly distinct purposes (e.g., quote vs. orderbook vs. candles), but 'order_type' is highly ambiguous—it sounds like a parameter or enum rather than a tool, and its description mixes order types with quantity/price parameters. This could lead an agent to mistake it for a configuration tool or parameter documentation.
Names are predominantly snake_case and lowercase, but there is a mix of single nouns (quote, orderbook, candles) and verb_noun patterns (preview_order, place_order, cancel_order). The deviation is minor and still readable, with no camelCase or chaotic naming.
The server provides 17 tools (per list), which is slightly above the ideal 3–15 range but justified for a trading platform covering market data, account info, order lifecycle, and safety. Most tools earn their place, though 'order_type' may be unnecessary.
The surface covers core trading workflows: market data, holdings, buying power, order preview/place/cancel, and safety status. Minor gaps include a direct cash balance tool (buying_power approximates) and order modification, but these are workable and not critical for the stated purpose.
Maintenance
Related MCP Connectors
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Licensed Borsa Istanbul (BIST) data for AI assistants: live or 15-minute delayed prices, OHLCV bars from 1 minute to monthly, financial statements, ratios, KAP disclosures, indices and sectors, indicator backtests and portfolio tracking for 600+ Turkish stocks. OAuth sign-in with an istfin subscription. Never places orders.
Agentic brokerage access to a US brokerage account: quotes, orders, positions, cash and documents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables querying Korean and US stock information, quotes, account assets, and order history via Toss Securities Open API. Optionally supports order placement with preview and confirmation safeguards.1MIT
- AlicenseAqualityDmaintenanceEnables trading and market data access for Toss Securities through natural language, with built-in trading guardrails to prevent errors.20MIT
- FlicenseAqualityDmaintenanceEnables interaction with Toss Securities API for market data, stock information, account details, and order management.20-
- AlicenseAqualityCmaintenanceA read-only MCP server for Toss Securities Open API that enables AI assistants to retrieve stock prices, resolve symbols, check holdings, buying power, exchange rates, and OHLCV candles without placing orders.2923 npm1MIT