tossinvest-open-api-mcp: Instructions file for Claude Code

CLAUDE.md

tossinvest-open-api-mcp CLAUDE.md is an instructions file for Claude Code from hamcheeseburger/tossinvest-open-api-mcp. It costs 2,207 tokens per session, scanned A, original, MIT.

Project instructions for a self-hosted MCP server that connects to Toss Securities' Open API, an interface for retrieving account and market data. It defines the project's Python stack, directory structure, and architectural boundaries.

In plain words
What is it for?
Use it when changing this Toss Securities MCP server, especially its read-only account, holdings, transactions, and market-data tools.
Why use it?
It helps coding agents preserve fixed technology choices, keep the server focused on converting API data, and avoid putting investment analysis or trading actions in the wrong layer.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is hamcheeseburger/tossinvest-open-api-mcp's own configuration. It tells Claude Code how to work on tossinvest-open-api-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tossinvest-open-api-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to hamcheeseburger/tossinvest-open-api-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/hamcheeseburger/tossinvest-open-api-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/hamcheeseburger/tossinvest-open-api-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tossinvest-open-api-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tossinvest-open-api-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/hamcheeseburger/tossinvest-open-api-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,207 This file is loaded in full into every session.
When invoked 2,207 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02207 $0.02207
Opus 5 $0.01104 $0.01104
Sonnet 5 $0.00441 $0.00441
Haiku 4.5 $0.00221 $0.00221

Measured 9d ago against content hash dc9ca26a79c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

tossinvest-open-api-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — toss-securities-mcp

프로젝트 개요

토스증권 Open API를 감싸는 self-hosted MCP 서버. 사용자가 본인 API 키로 본인 머신에서 실행하며, Claude Desktop/Claude Code에 연결해 자연어로 계좌·시세를 조회한다.

이 프로젝트는 더 큰 시스템의 Phase 1이다:

  • Phase 1 (이 저장소): 토스 MCP — 토스증권 계좌 조회
  • Phase 2 (별도 저장소 portfolio-aggregator-mcp): 멀티 증권사 통합, FIFO 누적 실현손익, 행동 패턴 분석
  • Phase 4: NH QV MCP 추가

최종 목표: "매도하면 사라지는 수익률" 문제를 해결하는 누적 실현손익(Lifetime Realized P/L) 중심의 투자 보고·코칭 에이전트.

기술 스택 (고정 — 변경하지 말 것)

  • Python 3.12+
  • FastMCP (Anthropic MCP SDK의 고수준 인터페이스)
  • httpx (async HTTP)
  • Pydantic v2 (스키마)
  • uv (패키지 관리)
  • pytest + pytest-asyncio (테스트)

아키텍처 원칙

  1. MCP 서버는 얇게 — 이 저장소는 "토스 API → 표준화된 JSON" 변환만 담당. 분석 로직(FIFO, 손익 계산)은 절대 여기 넣지 않는다. 그건 Phase 2 Aggregator의 일.
  2. 도구는 읽기 전용부터 — 조회 도구(잔고, 보유종목, 거래내역, 시세)만 먼저 구현. 주문(매수/매도) 도구는 명시적 요청 전까지 구현하지 않는다.
  3. LLM에 친화적인 도구 설명 — 각 도구의 description은 "언제 이 도구를 호출해야 하는지"를 명확히 (예: "사용자가 '보유 종목', '내 주식' 등을 물을 때 호출").
  4. 응답은 구조화 — raw JSON 그대로 반환하지 말고 Pydantic 모델로 파싱 후 필요한 필드만 정리해 반환.

디렉토리 구조

toss-securities-mcp/
├── README.md            # 디스클레이머 필수 (아래 '약관 준수' 참고)
├── LICENSE              # MIT
├── .env.example         # 키 템플릿 (실제 값 절대 X)
├── .gitignore           # .env 반드시 포함
├── pyproject.toml
├── server.py            # MCP 엔트리포인트 (FastMCP)
├── toss_client/
│   ├── __init__.py
│   ├── auth.py          # OAuth 2.0 Client Credentials 토큰 관리
│   ├── api.py           # 토스 API 엔드포인트 래퍼
│   └── schemas.py       # 토스 응답 Pydantic 모델
├── scripts/
│   └── smoke_test.py    # 실 API 읽기 전용 스모크 테스트 (사용자 수동 실행)
└── tests/
    ├── test_auth.py
    └── test_api.py      # httpx MockTransport 사용

인증 (토스 Open API)

  • OAuth 2.0 Client Credentials Grant
  • 토큰 발급: POST /oauth2/token, application/x-www-form-urlencoded 본문에 grant_type/client_id/client_secret
  • refresh token 없음. 만료 시 동일 엔드포인트로 재발급
  • client당 유효한 access token은 1개 — 재발급 시 이전 토큰 즉시 무효화 (프로세스 내 단일 TokenManager로 관리)
  • 모든 API 호출: Authorization: Bearer {access_token}
  • 계좌·자산·주문 API: X-Tossinvest-Account: {accountSeq} 헤더 추가
  • 토큰은 메모리 캐시, 만료 60초 전 자동 갱신

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 149 lines · 2,207 tokens per session scan A dc9ca26a79c2

Subscribe to this mod's changes

tossinvest-open-api-mcp CLAUDE.md is an instructions file published in the GitHub repository hamcheeseburger/tossinvest-open-api-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 2,207 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens