TWSEMCPServer: Instructions file for Claude Code

CLAUDE.md

TWSEMCPServer CLAUDE.md is an instructions file for Claude Code from twjackysu/TWSEMCPServer. It costs 15,848 tokens per session, scanned A, original, MIT.

Repository instructions for a Python server that provides Taiwan stock-market data through the Model Context Protocol, a standard way for AI tools to call external data services.

In plain words
What is it for?
Use it when adding or fixing tools for Taiwan stocks, exchange-traded funds, futures, options, company reports, trading data, or market indicators.
Why use it?
They document the available market-data sources, their limits, and which endpoints support historical or current information, reducing incorrect data requests.

Instructions file for Claude Code

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

This is twjackysu/TWSEMCPServer's own configuration. It tells Claude Code how to work on TWSEMCPServer 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 TWSEMCPServer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to twjackysu/TWSEMCPServer. 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/twjackysu/TWSEMCPServer/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/twjackysu/TWSEMCPServer

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 TWSEMCPServer CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/twjackysu/twsemcpserver/claude-md/github.svg)](https://agentmods.dev/instructions/twjackysu/twsemcpserver/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/twjackysu/twsemcpserver/claude-md"><img src="https://agentmods.dev/badge/instructions/twjackysu/twsemcpserver/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 TWSEMCPServer CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/twjackysu/twsemcpserver/claude-md"><img src="https://agentmods.dev/badge/instructions/twjackysu/twsemcpserver/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15,848 This file is loaded in full into every session.
When invoked 15,848 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.15848 $0.15848
Opus 5.5 $0.06339 $0.06339
Sonnet 5.5 $0.03170 $0.03170
Haiku 4.5 $0.01585 $0.01585

Measured 4d ago against content hash 39b677d47e04, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

TWSEMCPServer 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 4d 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 · 293 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

TWStockMCPServer is a Model Context Protocol (MCP) server for Taiwan stock market data analysis. Built with FastMCP (Python) and requests. Data sources:

  • TWSE OpenAPI (openapi.twse.com.tw) — 105 tools: 公司治理、ESG、財務比率、公告名單、權證、券商
  • TWSE Web API (twse.com.tw) — 19 tools(不帶 date 即回最新交易日/本月;取代了同資料的 OpenAPI 僅最新版): 歷史日K、月均價、融資融券(/exchangeReport);估值(/rwd/zh/afterTrading/BWIBBU_d —— /exchangeReport/BWIBBU_ALL 會忽略 date 參數,只回最新交易日,不可用於歷史查詢);三大法人買賣超日報、個股明細(/rwd/zh/fund/T86);三大法人買賣金額、全市場收盤行情、市場成交量值、加權指數歷史、外資持股歷史(/rwd/zh/...,可查任意過去日期,與同名 openapi.twse.com.tw 端點僅回傳最近約12個交易日不同);個股月/年成交彙總、鉅額交易明細(無伺服器端股票篩選,本地端過濾)、融券借券餘額/成交、除權除息計算結果(TWT49U)、當日沖銷交易(TWTB4U)、全部指數含類股指數(MI_INDEX type=IND)(/rwd/zh/...)(legacy JSON,非 Swagger)
  • MIS (mis.twse.com.tw) — 2 tools: 盤中多股即時報價;ETF 已發行單位數/預估淨值/折溢價(stock/data/all_etf.txt,get_etf_daily_nav)
  • TPEx OpenAPI (tpex.org.tw/openapi) — 5 tools: 上櫃日收盤(最新一日;get_otc_daily 帶 date 時改用網站 afterTrading/otc(sources/tpex/daily_quotes.py),該來源不含定價交易、無均價)、注意股、處置股、零股、櫃買指數
  • TAIFEX OpenAPI (openapi.taifex.com.tw) — 6 tools: 選擇權分析(Delta/OI增減)、保證金、年月統計(這些沒有下載頁對應)
  • TPEx 網站 (www.tpex.org.tw/www/zh-tw/...) — 7 tools: 上櫃個股日K、三大法人明細(insti/dailyTrade,可依外資/投信/自營商排行)、三大法人買賣金額彙總(insti/summary 日/週/月,2026-10-19 與 openapi tpex_3insti_summary 8 列逐列相同後取代之)、融資融券、本益比/殖利率/淨值比、外資持股排行、除權除息計算結果(預設最新交易日,可查任意過去日期)
  • MOPS 公開資訊觀測站 (mops.twse.com.tw/mops/api, mopsov.twse.com.tw): 綜合損益表/資產負債表/現金流量表、月營收、股利(預設最新一期,可查任意過去期間;上市櫃、興櫃、公發公司皆可)、重大訊息(t05st01/t05st02 + 全文 *_detail)、董監持股與設質(stapap1)、內部人持股異動(query6_1)、庫藏股(t35sc09)、背書保證與資金貸與(t05st11)、法說會 — 11 tools
  • TDCC 集保 (opendata.tdcc.com.tw、www.tdcc.com.tw/portal/zh/smWeb/qryStock) — 1 tool: 集保戶股權分散表(weeks=1 最新一週完整級距,走開放資料 CSV;weeks 2–13 為逐週大戶/散戶趨勢,走查詢頁)
  • 投信投顧公會 ETF 專區 (www.sitca.org.tw/ROC/SITCA_ETF/、/ROC/Industry/IN2629|IN2630,utils/sitca.py) — 3 tools: get_etf_info(所有投信、上市與上櫃 ETF 基本資料;單檔另合併證交所 t187ap47_L 與櫃買 ETF/detail,清單補上 SITCA 沒有的期信/外幣級別代號;取代了 get_fund_basic_info)、get_etf_monthly_stats(每月規模/淨值/受益人數/申購買回/定期定額,2007 起)、get_etf_holdings(成分股:基金投資明細每月前十大 2021-08 起、每季占淨值 1% 以上 2021-09 起;以基金名稱對回 ETF 代號,只做精確比對)
  • 國發會 (ws.ndc.gov.tw,data.gov.tw 6099/6100) — 2 tools: 景氣對策信號與景氣指標、PMI/NMI
  • 中央銀行 (cpx.cbc.gov.tw) — 1 tool: 每日匯率
  • 衍生分析 (tools/analytics/) — 4 tools: 還原權息日K、技術指標、選股 screener、同業比較(services/market_snapshot.py:估值與行情取同一資料日;上市/上櫃產業代碼同一套)。由 services/price_series.py(上市 STOCK_DAY(sources/twse/stock_day.py)/上櫃 tradingStock(sources/tpex/trading_stock.py)日K、TWT49U(sources/twse/twt49u.py)/exDailyQ(sources/tpex/ex_daily_q.py)除權息,自動判斷市場並還原)與 utils/indicators.py(純計算)組成
  • TAIFEX 網站下載 (www.taifex.com.tw/cht/3/*Down、dlFutPrevious30DaysSalesData) — 11 tools: 期貨/選擇權每日行情、三大法人(期貨/選擇權分計、總表、各期貨契約、各選擇權契約、買賣權分計)、期貨與選擇權大額交易人(無伺服器端契約篩選,本地端過濾)、Put/Call Ratio。日期留空=最新交易日(往回逐日找有資料的一天),也可查過去區間。2026-09-29 逐列比對:最新一日的資料涵蓋同名 openapi 端點的全部內容且更完整,因此取代了那 9 個 openapi 工具;選擇權大額交易人於 2026-10-07 同樣逐列比對(320 列,僅「所有月份總計」代碼 999912 vs 999999 不同)後也改用下載頁(largeTraderOptDown,一次最多約一個月,整年區間會被拒絕)。get_futures_intraday:最近 30 個交易日的每筆成交 zip 彙總成分鐘 K 線。get_daily_futures_market_report 的 contract 可填股票代號(openapi SSFLists 換成股票期貨契約);get_monthly_trading_statistics(market=) 涵蓋期貨與選擇權(openapi)

Read the full file on GitHub · 293 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. 4d ago Changed · +44 lines · +2,527 tokens per session 39b677d47e04
  2. 5d ago Changed · +51 lines · +5,528 tokens per session 2823cd42e9d8
  3. 7d ago Changed · +1 lines · +378 tokens per session 7a5355d68b14
  4. 8d ago Changed · +2 lines · +362 tokens per session d46afc6b6190
  5. 12d ago Changed · +6 lines · +1,068 tokens per session b33683b806ba
  6. 18d ago Changed · +5 lines · +509 tokens per session 7dab4df2ec1d
  7. 26d ago Changed · +16 lines · +1,684 tokens per session 19ece282eb41
  8. 27d ago Changed · +6 lines · +347 tokens per session cebcb48ea280
  9. 1mo ago Changed · +1 lines · +66 tokens per session d7f35b07f6ba
  10. 1mo ago First seen · 161 lines · 3,379 tokens per session scan A 77bb77a5d377

Subscribe to this mod's changes

TWSEMCPServer CLAUDE.md is an instructions file published in the GitHub repository twjackysu/TWSEMCPServer (180 stars, last pushed 4d ago), licensed MIT. It adds 15,848 tokens to every session, about $0.0634 per session on Opus 5.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-30.

Related

Other instructions, from other repositories

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 · 9,715 tokens

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,786 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens