Skip to main content
Glama

tossinvest-openapi-mcp

토스증권 Open API를 개발자와 AI 에이전트가 쉽게 탐색·연동할 수 있도록 돕는 MCP(Model Context Protocol) 서버.

npm version License: MIT MCP Node

언어: 한국어 · English · 日本語

tossinvest-openapi-mcp MCP server

이 서버는 토스증권 OpenAPI(Toss Securities Open API, 토스증권 오픈API) 명세를 내장하여 MCP 도구로 제공합니다. 읽기 전용 문서/탐색 서버로, 실제 API를 호출하거나 주문을 실행하지 않으며 어떤 인증 정보도 필요로 하지 않습니다. Claude·Cursor·Codex 등 MCP를 지원하는 AI 코딩 에이전트에 연결한 뒤 "토스증권 API로 주문을 어떻게 넣어?" 같이 물어보면, 명세에 근거한 정확한 답변과 코드 샘플을 얻을 수 있습니다.

토스증권 Open API 연동을 처음 시작하는 개발자가 엔드포인트·인증·주문/시세 API 구조를 빠르게 파악하고, AI 에이전트로 코드를 생성하는 데 활용할 수 있습니다.


개요

MCP 클라이언트에 연결하면 에이전트는 다음을 할 수 있습니다.

  • 토스증권 Open API의 모든 엔드포인트·카테고리 탐색

  • 요청/응답 스키마와 예시 조회

  • 키워드로 엔드포인트·데이터 모델 검색

  • 유스케이스 중심 연동 가이드 활용 — 인증, 시세·종목, 시장 지표, 랭킹, 수급 동향, 계좌·자산, 주문, 조건주문

  • curl / TypeScript / Python 요청 코드 샘플 생성

수록 범위

번들된 명세는 v1.2.17 기준이며, 13개 카테고리 · 36개 엔드포인트 · 90개 데이터 모델을 포함합니다.

그룹

카테고리

인증

Auth

시세·종목 정보

Market Data, Stock Info(기본 정보 + 국내 수급 동향), Market Info, Ranking, Market Indicators(지수·국채)

계좌·자산

Account, Asset

주문

Order, Order History, Order Info

조건주문

Conditional Order, Conditional Order History (SINGLE·OCO·OTO)

⚠️ 주의: 이 도구는 토스증권 공개 OpenAPI 문서를 설명하는 비공식 도구입니다. 실제 매매 실행, 계좌 접근, 인증 정보 전송을 하지 않습니다. 운영 적용 전 반드시 토스증권 Open API 공식 문서로 검증하세요.

Related MCP server: tossinvest-openapi-mcp

제공 도구

도구

용도

get_api_overview

API 전체 개요 (여기서 시작)

list_categories

카테고리(태그) 목록과 설명

list_endpoints

엔드포인트 목록 (카테고리 필터 가능)

search_endpoints

키워드 기반 엔드포인트 검색

get_endpoint

단일 엔드포인트 상세(파라미터·본문·응답)

list_schemas

데이터 모델 이름 목록/필터

get_schema

단일 데이터 모델의 필드 트리

get_integration_guide

호출 시퀀스를 포함한 유스케이스 가이드

generate_code_sample

엔드포인트별 curl/TS/Python 코드 샘플

요구 사항

  • Node.js 18 이상

  • MCP 호환 클라이언트 (Claude Desktop, Claude Code, Cursor 등)

설치 및 사용 (stdio)

이 서버는 stdio 방식으로 MCP를 통신합니다. 실행 명령을 하나 고른 뒤, 해당 블록을 MCP 클라이언트 설정에 붙여 넣으면 됩니다.

실행 명령

소스

명령 / 인자

npm (권장)

npx · -y, tossinvest-openapi-mcp

GitHub (npm 없이 최신 소스를 직접 실행)

npx · -y, github:JeongSeongMok/tossinvest-openapi-mcp

소스에서 실행 (git clone + npm install + npm run build 후)

node · /절대/경로/tossinvest-openapi-mcp/dist/index.js

Node.js 18+ 만 있으면 npx -y tossinvest-openapi-mcp 로 바로 실행됩니다. GitHub 명령은 npm 을 거치지 않고 저장소를 직접 클론·빌드·실행하므로, 항상 최신 소스가 필요할 때 사용합니다.

Claude (Claude Desktop / Claude Code / Cursor) — JSON

{
  "mcpServers": {
    "tossinvest-openapi": {
      "command": "npx",
      "args": ["-y", "tossinvest-openapi-mcp"]
    }
  }
}

Codex CLI — TOML (~/.codex/config.toml)

[mcp_servers.tossinvest-openapi]
command = "npx"
args = ["-y", "tossinvest-openapi-mcp"]

설정 파일 위치

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

  • Claude Code: 프로젝트의 .mcp.json, 또는 claude mcp add tossinvest-openapi -- npx -y tossinvest-openapi-mcp 실행

  • Codex CLI: ~/.codex/config.toml

  • Cursor: ~/.cursor/mcp.json

설정 수정 후 클라이언트를 재시작하면 위 도구들이 에이전트에 노출됩니다.

동작 확인

npm run build
node dist/index.js
# → stderr에 "tossinvest-openapi-mcp running on stdio" 출력 후 stdin으로 MCP 메시지 대기

개발

src/
├─ index.ts        # stdio 진입점
├─ server.ts       # MCP 서버 + 도구 등록
├─ format.ts       # 에이전트 친화적 마크다운 렌더링
├─ codegen.ts      # curl / TS / Python 샘플 생성
├─ guides.ts       # 유스케이스 연동 가이드
└─ spec/store.ts   # openapi.json 로드·인덱싱, $ref 해소

토스증권 OpenAPI 문서는 저장소 루트의 openapi.json에 있으며 배포 패키지에 함께 번들됩니다. 명세를 갱신하려면 이 파일을 교체하고 다시 빌드하세요.

라이선스

MIT

Available Tools

9 tools
generate_code_sampleGenerate code sampleA

Generates a ready-to-adapt request snippet for one endpoint, with the right URL, headers (auth / account), path/query placeholders and request-body example pre-filled. Choose the language; defaults to curl.

Inputs: operationId (required), language.

get_api_overviewGet API overviewA

START HERE. Returns a high-level map of the Toss Securities Open API: title, version, base server URL, the authentication model, and every category (tag group). Call this first to orient yourself, then drill down with list_endpoints, get_endpoint, or get_integration_guide.

Inputs: no named parameters.

get_endpointGet endpoint detailA

Returns full detail for ONE endpoint: summary, description, auth requirement, parameters, request body schema, and response schemas with examples. Identify the endpoint either by operationId (preferred) or by both method and path.

Inputs: operationId, method, path.

get_integration_guideGet integration guideA

Returns a task-oriented walkthrough for a common use case: the concepts involved plus the recommended, ordered sequence of real endpoints to call. Prefer this over reading endpoints one by one when you want to accomplish an end-to-end task.

Inputs: usecase (required).

get_schemaGet schema detailA

Returns the field tree of one data model: field names, types, required flags (marked with *) and descriptions. Nested objects and arrays are expanded; recursive refs are shown as → Name. Find names with list_schemas.

Inputs: name (required).

list_categoriesList categoriesA

Lists every API category (OpenAPI tag) with its display group, endpoint count, and description. Use the category name as the category argument of list_endpoints.

Inputs: no named parameters.

list_endpointsList endpointsA

Lists endpoints as METHOD path (operationId) — summary. Pass category (an exact tag name from list_categories) to filter. Returns all endpoints when no filter is given. Use the operationId with get_endpoint for full detail.

Inputs: category.

list_schemasList / search schemasA

Lists the data model (schema) names defined by the API. Pass query to filter by substring. Use a name with get_schema to see its fields.

Inputs: query.

search_endpointsSearch endpointsA

Keyword search across operationId, path, summary, description and tags. Returns the best-matching endpoints ranked by relevance. Use this when you don't know the exact category or operationId. Example queries: 'place order', 'current price', 'holdings', 'exchange rate'.

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: code generation, API overview, endpoint detail, integration guide, schema detail, category listing, endpoint listing, schema listing, and keyword search. No two tools overlap in functionality, and descriptions clearly differentiate them.

    Naming Consistency5/5

    All tool names use a consistent verb_noun pattern in snake_case (e.g., generate_code_sample, list_endpoints, search_endpoints). The verbs are either 'get', 'list', 'generate', or 'search', and the pattern is uniform across all 9 tools.

    Tool Count5/5

    With 9 tools, the set is well-scoped for an API exploration assistant. Each tool contributes to a specific aspect of the workflow (overview, categorization, endpoint details, schemas, search, integration guides, code generation), without being too many or too few.

    Completeness5/5

    The tool surface covers the full lifecycle of discovering and understanding an OpenAPI specification: from high-level overview to category listing, endpoint listing and detail, schema listing and detail, keyword search, integration guides, and code sample generation. There are no obvious gaps for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • 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
      64 npm
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Safe-by-default MCP server for the official Toss Securities Open API, providing read-only market and account data with optional order operations protected by multiple safety gates.
      27
      2
      MIT
    • A
      license
      A
      quality
      D
      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
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Toss Securities Open API that exposes Korean (KRX) and US market data, portfolio holdings, order management, and conditional orders through 28 tools, with read-only and authenticated remote modes.
      28
      MIT